Posted by: Rainer Gareis
Hi all,
I have a problem with a stored procedure. When I execute the procedure,
the selected ID is shown in the server console (so it seems the
procedure is working) but I don't get the data in my application.
SB 11.0.2
TD 5.1 SP6
My call in TD:
...
Set dfTxt1 = '\'%' || sSuchtext || '%\''
If SqlRetrieve( hSqlGlobal, 'SYSADM.PRUEFPLANID', ':dfTxt1, :dfTxt2',
':dfTxt2')
Call SqlExecute( hSqlGlobal )
Return dfTxt2
...
PROCEDURE: PRUEFPLANID
Parameters
String: sName
Receive String: sPruefplanid
Local Variables
Sql Handle: hSqlCur1
Number: nFetch
string: sPlanID
long string: sAbfrage
string: sTrace
Actions
On Procedure Execute
Set sTrace = 'Execute'
Trace sTrace
Set sAbfrage = 'Select distinct @datetochar (pplanident, \'yyyy-mm-dd
hh.mm.ss.999999\') from sysadm.spc_plan
where @Upper (Teil) like ' || sName || ' into :sPruefplanid '
Trace sAbfrage
Call SqlConnect( hSqlCur1 )
Call SqlPrepareAndExecute ( hSqlCur1, sAbfrage )
Set sTrace = 'Fetch'
Trace sTrace
if SqlFetchNext (hSqlCur1, nFetch)
Set sPlanID = sPruefplanid
Trace sPlanID
Return 0
else
Return 1
On Procedure Close
Call SqlDisconnect( hSqlCur1 )
Any hint is appreciated
Best regards
Rainer