Welcome to the dBforums forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions, articles and access our other FREE features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload your own photos and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact contact support.

If you prefer not to see double-underlined words and corresponding ads, place your cursor
here for ContentLink opt out.

Go Back  dBforums > Database Server Software > Sybase > SET command

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 06-30-08, 02:52
karthi_syb karthi_syb is offline
Registered User
 
Join Date: Jun 2008
Location: India
Posts: 58
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'.
Reply With Quote
  #2 (permalink)  
Old 06-30-08, 05:06
mike_bike_kite mike_bike_kite is offline
Registered User
 
Join Date: Jun 2007
Location: London
Posts: 944
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
Reply With Quote
  #3 (permalink)  
Old 06-30-08, 05:18
karthi_syb karthi_syb is offline
Registered User
 
Join Date: Jun 2008
Location: India
Posts: 58
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'.
Reply With Quote
  #4 (permalink)  
Old 06-30-08, 06:47
mike_bike_kite mike_bike_kite is offline
Registered User
 
Join Date: Jun 2007
Location: London
Posts: 944
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
Reply With Quote
  #5 (permalink)  
Old 06-30-08, 08:23
karthi_syb karthi_syb is offline
Registered User
 
Join Date: Jun 2008
Location: India
Posts: 58
As you said, If i changed it to Select, it works fine.
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On