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.

Declaring Stored Procedure in PowerScript with OUT parameter

2 posts in General Discussion (Chinese) Last posting was on 2010-02-22 03:48:24.0Z
Mike Moller Posted on 2010-02-04 21:42:03.0Z
Sender: 56e1.4b6b3e44.1804289383@sybase.com
From: Mike Moller
Newsgroups: sybase.public.chinese.powerbuilder.general
Subject: Declaring Stored Procedure in PowerScript with OUT parameter
X-Mailer: WebNews to Mail Gateway v1.1t
Message-ID: <4b6b3f2b.5701.1681692777@sybase.com>
NNTP-Posting-Host: 10.22.241.41
X-Original-NNTP-Posting-Host: 10.22.241.41
Date: 4 Feb 2010 13:42:03 -0800
X-Trace: forums-1-dub 1265319723 10.22.241.41 (4 Feb 2010 13:42:03 -0800)
X-Original-Trace: 4 Feb 2010 13:42:03 -0800, 10.22.241.41
Lines: 21
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.chinese.powerbuilder.general:502
Article PK: 104525

Does anyone know the proper syntax for declaring a stored
procedure in powerbuilder when the procedure has a OUT
parameter? My result is always zero. I've declared stored
procedures with success, but they never returned a value.
Example:
ALTER PROCEDURE "DBA"."ye_test"( INOUT c_rows INTEGER )

BEGIN
select count(*) into c_rows
from cust;

END

Powerscript:
DECLARE ye_test2 PROCEDURE FOR ye_test
c_rows = :li_rows;


EXECUTE ye_test2;
FETCH ye_test2 INTO :li_rows;
CLOSE ye_test2;


hgong Posted on 2010-02-22 03:48:24.0Z
Sender: 385.4b81f5d4.1804289383@sybase.com
From: hgong
Newsgroups: sybase.public.chinese.powerbuilder.general
Subject: Re: Declaring Stored Procedure in PowerScript with OUT parameter
X-Mailer: WebNews to Mail Gateway v1.1t
Message-ID: <4b81fe88.57e.1681692777@sybase.com>
References: <4b6b3f2b.5701.1681692777@sybase.com>
NNTP-Posting-Host: 10.22.241.41
X-Original-NNTP-Posting-Host: 10.22.241.41
Date: 21 Feb 2010 19:48:24 -0800
X-Trace: forums-1-dub 1266810504 10.22.241.41 (21 Feb 2010 19:48:24 -0800)
X-Original-Trace: 21 Feb 2010 19:48:24 -0800, 10.22.241.41
Lines: 26
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.chinese.powerbuilder.general:504
Article PK: 104526


> Does anyone know the proper syntax for declaring a stored
> procedure in powerbuilder when the procedure has a OUT
> parameter? My result is always zero. I've declared
> stored procedures with success, but they never returned a
> value. Example:
> ALTER PROCEDURE "DBA"."ye_test"( INOUT c_rows INTEGER )
>
> BEGIN
> select count(*) into c_rows
> from cust;
>
> END
>
> Powerscript:
> DECLARE ye_test2 PROCEDURE FOR ye_test
> c_rows = :li_rows;
>
>
> EXECUTE ye_test2;
> FETCH ye_test2 INTO :li_rows;
> CLOSE ye_test2;

You can use Transaction objects to call stored procedures.
and you can get detail steps from powerbuilder help (search
"Using Transaction objects to call stored procedures" in
<<Compiled HTML Help File>> ).