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.

Executing a sql statement stored in in a string variable

2 posts in DataWindow .NET Last posting was on 2004-08-22 14:27:28.0Z
ANAND Posted on 2004-08-22 06:19:53.0Z
Sender: 550.41283ac7.1804289383@sybase.com
From: Anand
Newsgroups: sybase.public.datawindow.net
Subject: Executing a sql statement stored in in a string variable
X-Mailer: WebNews to Mail Gateway v1.1t
Message-ID: <41283c66.555.1681692777@sybase.com>
X-Original-NNTP-Posting-Host: 10.22.241.42
X-Original-Trace: 21 Aug 2004 23:25:42 -0700, 10.22.241.42
Lines: 14
X-Original-NNTP-Posting-Host: forums-2-dub.sybase.com
X-Original-Trace: 21 Aug 2004 23:10:04 -0700, forums-2-dub.sybase.com
NNTP-Posting-Host: forums-master.sybase.com
X-Original-NNTP-Posting-Host: forums-master.sybase.com
Date: 21 Aug 2004 23:19:53 -0700
X-Trace: forums-1-dub 1093155593 10.22.108.75 (21 Aug 2004 23:19:53 -0700)
X-Original-Trace: 21 Aug 2004 23:19:53 -0700, forums-master.sybase.com
X-Authenticated-User: ngsysop
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.datawindow.net:183
Article PK: 124611

Hi All
I have created a datawindow based on a Procedure created in
Adaptive Server Anywhere 8.0.The SQL inside the procedure is
constructed based on some parameters.After constructing the
sql i want to execute the sql.Is there any statement
available?Please help me.

Declare @ls_sql Varchar(100)
Set @ls_sql='select * from empl where empl_code='+ls_empl

I want to get the result of the above statement when I
execute the procedure.I tried with EXECUTE IMMEDIATE,Later I
came to know that EXECUTE IMMEDIATE can only be used for
sql's which do not produce result sets,Please help me


dfish Posted on 2004-08-22 14:27:28.0Z
From: dfish@_no_spam_sybase.com (Dave Fish [Team Sybase])
Newsgroups: sybase.public.datawindow.net
Subject: Re: Executing a sql statement stored in in a string variable
Organization: Sybase Professional Services
Reply-To: nospam_dfish@sybase.com_nospam
Message-ID: <4128aad3.139719155@forums.sybase.com>
References: <41283c66.555.1681692777@sybase.com>
X-Newsreader: Forte Free Agent 1.21/32.243
NNTP-Posting-Host: vpn-dub-039.sybase.com
X-Original-NNTP-Posting-Host: vpn-dub-039.sybase.com
Date: 22 Aug 2004 07:27:28 -0700
X-Trace: forums-1-dub 1093184848 10.22.120.39 (22 Aug 2004 07:27:28 -0700)
X-Original-Trace: 22 Aug 2004 07:27:28 -0700, vpn-dub-039.sybase.com
Lines: 24
X-Authenticated-User: TeamSybase
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.datawindow.net:184
Article PK: 124613

This newsgroup is for DataWindow .NET. You should post your question
in the powerbuilder.general newsgroup.

Regards,
Dave Fish
Sybase

On 21 Aug 2004 23:19:53 -0700, Anand wrote:

>Hi All
> I have created a datawindow based on a Procedure created in
>Adaptive Server Anywhere 8.0.The SQL inside the procedure is
>constructed based on some parameters.After constructing the
>sql i want to execute the sql.Is there any statement
>available?Please help me.
>
>Declare @ls_sql Varchar(100)
>Set @ls_sql='select * from empl where empl_code='+ls_empl
>
>I want to get the result of the above statement when I
>execute the procedure.I tried with EXECUTE IMMEDIATE,Later I
>came to know that EXECUTE IMMEDIATE can only be used for
>sql's which do not produce result sets,Please help me