Subject RE: [IBO] A problem with a procedure
Author Malcolm Smith
Jason,

The exception (invalid handle) is raised on the line 'FCursor->First();'

Due to time factors I have had to find a workaround. Using the exact same
code but changing:

SQL_LOGPARAMSSELECT = 'EXECUTE PROCEDURE P_LP_SELECT_ONE
(:LP_PROCESSNAME_IN)';

to

SQL_LOGPARAMSSELECT = 'SELECT * FROM LOGPARAMS WHERE LP_PROCESSNAME =
:LP_PROCESSNAME_IN';

works as I require. Just for reference, the current procedure is defined
as:

BEGIN
SELECT
LP_PROCESSNAME,
LP_LOGMASK,
LP_LOGPATH,
LP_DAYLIMIT
FROM
LOGPARAMS
WHERE
UPPER(LP_PROCESSNAME) = UPPER(:LP_PROCESSNAME_IN)
INTO
:LP_PROCESSNAME,
:LP_LOGMASK,
:LP_LOGPATH,
:LP_DAYLIMIT;
END


BTW, the procedure works as expected in Database Workbench.

(I've removed the monitor output from the bottom of this email due to length
but have left everything else in place).

The error occurs when there is no data to be found in the table.
Additionally, when there is data, it does not return the data. If the
problem is in my code then I have no idea where it is ????

For now I'll have to use the SQL statement as indicated above.


Malcolm Smith
Analyst Programmer
Comvision Pty Ltd
http://www.comvision.net.au

-----Original Message-----
From: Malcolm Smith [mailto:m.smith@...]
Sent: Friday, 26 November 2004 22:14
To: IBObjects@yahoogroups.com
Subject: RE: [IBO] A problem with a procedure



Jason,

This time I got an 'invalid request handle'. It is currently after 10pm and
I have to leave the office (the wife is going to kill me I'm sure). I
decided to try a default monitor, so here are the results (there is no data
in the table being executed against).

I'm using a TIB_Cursor, using this code:

// first this code:

FCursor->SQL->Clear();
FCursor->SQL->Add(SQLString);

// followed by (shared by other cursors that return many records):

bool PrepareDatabase(void)
{
if(FCursor)
{
FCursor->Execute();
FCursor->First();
}

return FCursor && !FCursor->Eof;
}


I used these properties for the monitor (ie, default I think):

object DBMonitor: TIB_Monitor
ItemEnd = '----*/'
MinTicks = 10
NewLineText = #13#10
OnMonitorOutputItem = DBMonitorMonitorOutputItem
Left = 56
Top = 148
end