basilhs_s
asked on
powerbuilder , stored procedure, output parameters
i have created a stored procedure in sql server 2000 as follows (only the parameters are included)
CREATE procedure sp_update_logist_01
@scr_code_ph nvarchar(08)
,@scr_date datetime
,@scr_xwros nvarchar(2)
,@scr_n_seira nvarchar(2)
,@scr_parast nvarchar(2)
,@scr_parast_no decimal
,@scr_status int output
how can i execute this stored procedure from powerbuilder ? How can i receive the value of @scr_status which is an output parameter and store its value to a local int variable?
CREATE procedure sp_update_logist_01
@scr_code_ph nvarchar(08)
,@scr_date datetime
,@scr_xwros nvarchar(2)
,@scr_n_seira nvarchar(2)
,@scr_parast nvarchar(2)
,@scr_parast_no decimal
,@scr_status int output
how can i execute this stored procedure from powerbuilder ? How can i receive the value of @scr_status which is an output parameter and store its value to a local int variable?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
this is exactly what i want
If stored procedure is supposed to return multiple records (again... records not the columns)
for given input then i would recommend to create datawindow using that stored procedure and retrieve it.
Otherwise, create stored function instead of stored procedure.
Both stored procedure and stored functions can be also called as RPC.
1. create non-visual object of type Transaction
2. declare stored procedure or function as external function to it.
subroutine sp_update_logist_01(string
(see pb help - 'Declaring DBMS stored procedures as remote procedure calls' for more detail)
3. change sqlca property to above transaction object in your application object.
Open applicaiton object > properties > general tab.. click additional properties > variable types tab... change sqlca value.
4. now you can call stored procedure from anywhere by
sqlca.sp_update_logist_01(
where arg6 is the result returned from procedure.
Regards,
Sandeep