Results 1 to 2 of 2
  1. #1
    Join Date
    Apr 2006
    Posts
    1

    Unanswered: raiserror syntax in sybase for procedure returning No Data

    Hello,

    Does anyone know the error number, syntax to use in Sybase?

    For SQL Server, the following works:

    RAISERROR ('No data found today for the GetOOHHedgeFundTrades Report.',16,1) WITH SETERROR

    I am not sure about how to use this in Sybase.

    Many Thanks
    sybasenovice123

  2. #2
    Join Date
    Feb 2004
    Location
    UK
    Posts
    43

    raiserror

    Sybtax in Sybase is :

    RAISERROR error-number [ format-string ] [, arg-list]

    ex :
    RAISERROR 99999 'Invalid entry for this column: %1!', @val

    U can also create user defined error message which is use by RAISERROR or Print. user-defined message must be 20000 or greater

    To create user defined message use following :

    CREATE MESSAGE message-number
    ... AS 'message-text'

    Same thing u can achieve by sp_addmessage SP also. like this :

    sp_addmessage message_num, message_text
    [, language [, with_log [, replace]]]

    Ex :
    sp_addmessage 25001,
    "There is already a remote user named '%1!'
    for remote server '%2!'."

    raiserror 25001, jane, myserver

    Hope this will help u.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •