Results 1 to 5 of 5

Thread: SET command

  1. #1
    Join Date
    Jun 2008
    Location
    India
    Posts
    96

    Unanswered: SET command

    Will sybase12.0 support SET command ? Becuae i got the below error message.


    Server Message: Number 102, Severity 15
    Server 'DEV', Line 2:
    Incorrect syntax near '@sql'.

  2. #2
    Join Date
    Jun 2007
    Location
    London
    Posts
    2,527
    The set command certainly works in version 12.5 but I don't have an earlier version to try it on. Is it in your manual? Could you supply the code that creates the error rather than just word?

    If it helps here's a working example:
    Code:
    declare @sql varchar(80)
    set @sql = "Works in version " + @@version
    select @sql
    
    Works in version Adaptive Server Enterprise/12.5.3/EBF 12331 ESD#1/P/Sun_svr4/OS

  3. #3
    Join Date
    Jun 2008
    Location
    India
    Posts
    96
    Hi Mike,

    Thanks for your reply.

    I have executed your sample query, again i got the same error message.

    declare @sql varchar(80)
    set @sql = "Works in version " + @@version
    select @sql

    Server Message: Number 102, Severity 15
    Server 'DEV', Line 2:
    Incorrect syntax near '@sql'.

  4. #4
    Join Date
    Jun 2007
    Location
    London
    Posts
    2,527
    My guess then is that it doesn't work on version 12

    Just change the set to a select and it should work fine.

    Mike

  5. #5
    Join Date
    Jun 2008
    Location
    India
    Posts
    96
    As you said, If i changed it to Select, it works fine.

Posting Permissions

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