Result Set from ref cursor into pro*c variables [message #40313] |
Thu, 26 September 2002 11:08 |
prazak
Messages: 3 Registered: September 2002
|
Junior Member |
|
|
Yo.
I am having trouble getting the results out of my result set I called into my pro*c variables.
Here is the table desc:
SQL*PLUS<FITSD1>desc fits_discrete_values
Name Type
----------- --------
KEY_WORD VARCHAR2(20)
DISC_VALUE VARCHAR2(80)
Here is the i'm using procedure in the fitcheck package:
CREATE OR REPLACE PACKAGE fitcheck
IS
TYPE helpCursor IS REF CURSOR;
PROCEDURE help1b (c_help IN OUT helpCursor);
END fitcheck;
CREATE OR REPLACE PACKAGE BODY fitcheck
IS
PROCEDURE help1b (c_help IN OUT helpCursor)
IS
BEGIN
OPEN c_help FOR
SELECT disc_value
FROM fits_discrete_values
WHERE key_word LIKE 'HELP_DR_H1_%'
ORDER BY key_word;
END help1b;
END fitcheck;
Here is the relevant pro*c code that calls the stored procedure. I have determined that the error handler is invoked during the fetch call, ouputting the following message:
"Error 666 = Error while trying to retrieve text for error ORA-01002"
getHelp()
{
exec sql begin declare section;
sql_cursor a_cursor;
varchar text[[80]];
exec sql end declare section;
exec sql whenever sqlerror goto Error666;
exec sql allocate :a_cursor;
text.len = 80;
EXEC SQL CALL fitcheck.help1b(:a_cursor);
EXEC SQL FETCH :a_cursor INTO :text;
EXEC SQL CLOSE :a_cursor;
Error666:
fprintf(stdout,"nError 666 = %sn",
sqlca.sqlerrm.sqlerrmc);
}
I suspect that somehow my text variable is bad. Any help?
|
|
|
|
|