Stored procedure parameter
If the parameter name or number does not match, PowerBuilder
will display an error indicating that the parameter does not exist;
while PowerServer will check the schema of stored procedure or
function and automatically match the corresponding parameter type and
position, therefore PowerServer may be able to execute the stored
procedure without errors.
Suppose the stored procedure is like this:
|
1 2 3 4 |
CREATE PROCEDURE [dbo].[up_trs_003] @v_out_name varchar(20) Output AS Select @v_out_name = v_name From trs_emp where c_id = '101' |
And the PowerScript is like this:
|
1 2 3 4 5 6 7 8 9 |
//the stored procedure has output values but PowerScript has not declared the output values(-1) string ls_return Declare lpr_P004 procedure For up_trs_003; Execute lpr_P004; messagebox('After the stored procedure is executed',"sqldbcode "+ string(sqlca.sqldbcode) + " errtext: " + sqlca.sqlerrtext + " Result" +ls_return) fetch lpr_P004 into :ls_return; messagebox('After the result is fetched',"sqldbcode "+ string(sqlca.sqldbcode) + " errtext: " + sqlca.sqlerrtext + " Result" +ls_return) Close lpr_P004; commit using sqlca; |
|
When the above PowerScript is |
When the above PowerScript is |
|||||
|---|---|---|---|---|---|---|
|
For Execute |
|
|
||||
|
For Fetch |
|
|
Document get from Powerbuilder help
Thank you for watching.
Subscribe
Login
0 Comments
Oldest