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.

where is execute documentation is sybooks??

3 posts in Unix Last posting was on 2001-03-23 17:02:38.0Z
Allen Cornell Posted on 2001-03-23 05:53:18.0Z
Message-ID: <3ABAE4CE.FCE6E9CF@email.msn.com>
Date: Thu, 22 Mar 2001 21:53:18 -0800
From: Allen Cornell <xxxxxxx@email.msn.com>
X-Mailer: Mozilla 4.75 [en] (Win98; U)
X-Accept-Language: en
MIME-Version: 1.0
Subject: where is execute documentation is sybooks??
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Newsgroups: sybase.public.sqlserver.unix
Lines: 15
NNTP-Posting-Host: 1Cust187.tnt10.denver2.co.da.uu.net 63.36.251.187
Path: forums-1-dub!forums-master.sybase.com!forums.sybase.com
Xref: forums-1-dub sybase.public.sqlserver.unix:704
Article PK: 1092793

where is documentation for the "execute" statment in sybooks anybody
know? I would like to know what you can and cant use within it.

I was trying to build a dynamic sql statment within a stored procedure
declare @sqlText varchar(255)
select @sqlText = "select .... from where "
execute ( @sqlText )

This work fine however, I then tried to use it with a cursor and could
not get it to work

Example:
execute ("declare cursor user_cursor for " +@sqlText
+ "open cursor
fetch
.....
Is this not supported or is there some trick to it???

Thanks.


Bret Halford Posted on 2001-03-23 17:02:38.0Z
Message-ID: <3ABB81AE.DEA9B364@sybase.com>
Date: Fri, 23 Mar 2001 10:02:38 -0700
From: Bret Halford <bret@sybase.com>
Organization: Sybase, Inc.
X-Mailer: Mozilla 4.5 [en]C-CCK-MCD (WinNT; I)
X-Accept-Language: en
MIME-Version: 1.0
Subject: Re: where is execute documentation is sybooks??
References: <3ABAE4CE.FCE6E9CF@email.msn.com>
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Newsgroups: sybase.public.sqlserver.unix
Lines: 23
NNTP-Posting-Host: bret-pc.sybase.com 157.133.80.211
Path: forums-1-dub!forums-master.sybase.com!forums.sybase.com
Xref: forums-1-dub sybase.public.sqlserver.unix:701
Article PK: 1092790

It is documented under "EXECUTE" in the ASE Reference Manual.
What you ware trying to do is not supported, "DECLARE CURSOR"
is one of the commands that is not allowed within the string (see the
second bullet under "Dynamically Executing Transact-SQL" on page 6-274.

-bret

Allen Cornell wrote:

> where is documentation for the "execute" statment in sybooks anybody
> know? I would like to know what you can and cant use within it.
>
> I was trying to build a dynamic sql statment within a stored procedure
> declare @sqlText varchar(255)
> select @sqlText = "select .... from where "
> execute ( @sqlText )
>
> This work fine however, I then tried to use it with a cursor and could
> not get it to work
>
> Example:
> execute ("declare cursor user_cursor for " +@sqlText
> + "open cursor
> fetch
> .....
> Is this not supported or is there some trick to it???
>
> Thanks.


<Andy> Posted on 2001-03-23 12:30:22.0Z
From: <Andy>
References: <3ABAE4CE.FCE6E9CF@email.msn.com>
Subject: Re: where is execute documentation is sybooks??
Date: Fri, 23 Mar 2001 14:30:22 +0200
Lines: 30
Organization: iTouch
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 5.00.2314.1300
X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300
Message-ID: <o8EWAc5sAHA.53@forums.sybase.com>
Newsgroups: sybase.public.sqlserver.unix
NNTP-Posting-Host: devco.net 196.15.188.2
Path: forums-1-dub!forums-master.sybase.com!forums.sybase.com
Xref: forums-1-dub sybase.public.sqlserver.unix:702
Article PK: 1092791

Its in the Adaptive Server "Reference Manual" under "Manual Pages for
Transact-SQL Commands".
I don't know wether you can do that or not.

Andy

Allen Cornell <xxxxxxx@email.msn.com> wrote in message
news:3ABAE4CE.FCE6E9CF@email.msn.com...
> where is documentation for the "execute" statment in sybooks anybody
> know? I would like to know what you can and cant use within it.
>
> I was trying to build a dynamic sql statment within a stored procedure
> declare @sqlText varchar(255)
> select @sqlText = "select .... from where "
> execute ( @sqlText )
>
> This work fine however, I then tried to use it with a cursor and could
> not get it to work
>
> Example:
> execute ("declare cursor user_cursor for " +@sqlText
> + "open cursor
> fetch
> .....
> Is this not supported or is there some trick to it???
>
> Thanks.
>