PowerBuilder 2019 R3 Build 2703
MSSQL : Microsoft SQL Server 2014 - 12.0.2000.8 (Intel X86) Feb 20 2014 19:20:46
Copyright (c) Microsoft Corporation Standard Edition on Windows NT 6.3 <X64> (Build 19041: )
DECLARE proc_chk090 PROCEDURE FOR dbo.sp_chk090 (:sPLU, '2', :gs_cc_code, :gs_sub_code, :s_message) USING SQLCA ;
EXECUTE proc_chk090 ;
FETCH proc_chk090 into :s_message ;
CLOSE proc_chk090 ;
IF SQLCA.SQLCODE <> 0 THEN
ROLLBACK USING SQLCA ;
MessageBox("sp_chk090", s_message)
GOTO CLR_RTN
END IF
When you run the procedure syntax above,
The return message was not returned, so I debugged it.
The debug message came out as below.
I ask for tips from experts to see if there's anything wrong with the phrase I wrote.
[debug message 01]
long code = 102
string sqlerrtext = "SQLSTATE = 42000Microsoft OLE DB Driver for SQL Server'153750000001'The syntax nearby is wrong."
string sqlsyntax = "execute dbo.sp_chk090('153750000001', '2', '480950', '480950', '')"
[debug message 02]
long code = -4
string sqlerrtext = "Cursor is not open"
string sqlsyntax = ""
[debug message 03]
long code = -4
string sqlerrtext = "Procedure has not been executed or has no results"
string sqlsyntax = ""
1. s_message is output.
2. It is the same phenomenon even though we excluded the fetch phrase as you advised.
[Question]
In the Global Local Funeral section of the Generated Application Object, see:
function long sp_chk090(string ag_ex_code,string ag_io,string ag_ccode,string ag_subcode,ref string ag_message) RPCFUNC ALIAS FOR "dbo.sp_chk090"
Why don't we declare it as and apply the program?