Sybase NNTP forums - End Of Life (EOL)

The NNTP forums from Sybase - forums.sybase.com - are now closed.

All new questions should be directed to the appropriate forum at the SAP Community Network (SCN).

Individual products have links to the respective forums on SCN, or you can go to SCN and search for your product in the search box (upper right corner) to find your specific developer center.

Syntax Error on '=' on SET statement for Version 7

4 posts in General Discussion Last posting was on 2003-05-16 18:50:22.0Z
Richard Posted on 2003-05-16 16:40:41.0Z
From: Richard
Date: Fri, 16 May 2003 12:40:41 -0400
Newsgroups: ianywhere.public.general
Subject: Syntax Error on '=' on SET statement for Version 7
Message-ID: <3369A495B0C25BCE005B9DBE85256D28.005B9DCD85256D28@webforums>
Lines: 14
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Path: forums-1-dub!forums-master.sybase.com!webforums.sybase.com!news
Xref: forums-1-dub ianywhere.public.general:1028
Article PK: 2994

Is there a difference between Version 7 and Version 8 for the following
T-SQL statement in a Stored Procedure

IF @UseTemplate = 1
set @UserType=0 --<<<I am getting error on this line
ELSE set @UserType = 1


This execute and compiles fine in Version 8

Any Ideas?

Thanks
Richard


Glenn Paulley Posted on 2003-05-16 16:52:10.0Z
Date: Fri, 16 May 2003 12:52:10 -0400
From: Glenn Paulley <paulley@ianywhere.com>
Reply-To: paulley@ianywhere.com
Organization: iAnywhere Solutions
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.2.1) Gecko/20021130
X-Accept-Language: en-us, en
MIME-Version: 1.0
Subject: Re: Syntax Error on '=' on SET statement for Version 7
References: <3369A495B0C25BCE005B9DBE85256D28.005B9DCD85256D28@webforums>
In-Reply-To: <3369A495B0C25BCE005B9DBE85256D28.005B9DCD85256D28@webforums>
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
Message-ID: <##kt3v8GDHA.334@forums-1-dub>
Newsgroups: ianywhere.public.general
NNTP-Posting-Host: paulley-xp.sybase.com 172.31.141.96
Lines: 29
Path: forums-1-dub!forums-master.sybase.com!forums-1-dub.sybase.com
Xref: forums-1-dub ianywhere.public.general:1030
Article PK: 3350

SET was added to Transact-SQL support in 8.0.2 specifically for
compatibility with Microsoft SQL Server. AFAIK, ASE (any release) does
not support the SET statement, and you must continue to perform
assignments using the SELECT statement in ASE Transact-SQL procedures.

Glenn

Richard wrote:
> Is there a difference between Version 7 and Version 8 for the following
> T-SQL statement in a Stored Procedure
>
> IF @UseTemplate = 1
> set @UserType=0 --<<<I am getting error on this line
> ELSE set @UserType = 1
>
>
> This execute and compiles fine in Version 8
>
> Any Ideas?
>
> Thanks
> Richard

--
Glenn Paulley
Research and Development Manager, Query Processing
iAnywhere Solutions Engineering

EBF's and Patches: http://downloads.sybase.com
choose SQL Anywhere Studio >> change 'time frame' to all

To Submit Bug Reports: http://casexpress.sybase.com/cx/cx.stm

SQL Anywhere Studio Supported Platforms and Support Status
http://my.sybase.com/detail?id=1002288

Whitepapers, TechDocs, and bug fixes are all available through the iAnywhere
Developer Community at www.ianywhere.com/developer


Richard Posted on 2003-05-16 18:50:22.0Z
From: Richard
Date: Fri, 16 May 2003 14:50:22 -0400
Newsgroups: ianywhere.public.general
Subject: Re: Syntax Error on '=' on SET statement for Version 7
Message-ID: <9E362E8BAA4AFD9F00677D0785256D28.006331F185256D28@webforums>
References: <3369A495B0C25BCE005B9DBE85256D28.005B9DCD85256D28@webforums> <##kt3v8GDHA.334@forums-1-dub>
Lines: 1
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Path: forums-1-dub!forums-master.sybase.com!webforums.sybase.com!news
Xref: forums-1-dub ianywhere.public.general:1033
Article PK: 3352

The Select work...Thanks for the help!


Breck Carter [TeamSybase] Posted on 2003-05-16 16:54:34.0Z
From: "Breck Carter [TeamSybase]" <NOSPAM__bcarter@risingroad.com>
Subject: Re: Syntax Error on '=' on SET statement for Version 7
Date: Fri, 16 May 2003 12:54:34 -0400
Organization: RisingRoad Professional Services
Reply-To: NOSPAM__bcarter@risingroad.com
Message-ID: <ts5acvomv6g8be9bu7p4t8p13238k35bdf@4ax.com>
References: <3369A495B0C25BCE005B9DBE85256D28.005B9DCD85256D28@webforums>
X-Newsreader: Forte Agent 1.8/32.548
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Newsgroups: ianywhere.public.general
NNTP-Posting-Host: nnc010.canpar.ca 204.225.91.186
Lines: 15
Path: forums-1-dub!forums-master.sybase.com!forums-1-dub.sybase.com
Xref: forums-1-dub ianywhere.public.general:1032
Article PK: 3351

SET isn't Transact SQL. Try SELECT.

Or put in some THENs and semicolons and switch to Watcom SQL :)

Breck

On Fri, 16 May 2003 12:40:41 -0400, Richard wrote:

>Is there a difference between Version 7 and Version 8 for the following
>T-SQL statement in a Stored Procedure
>
>IF @UseTemplate = 1
>set @UserType=0 --<<<I am getting error on this line
>ELSE set @UserType = 1
>
>
>This execute and compiles fine in Version 8
>
>Any Ideas?
>
>Thanks
>Richard

bcarter@risingroad.com
Mobile and Distributed Enterprise Database Applications
http://www.risingroad.com