I have a pointer defined in PL / SQL and I am wondering what is the best way to use it from ProC. Usually for a cursor defined in ProC, you should:
EXEC SQL DECLARE curs CURSOR FOR SELECT 1 FROM DUAL;
EXEC SQL OPEN curs;
EXEC SQL FETCH curs INTO :foo;
EXEC SQL CLOSE cusr;
I was hoping the same (or similar) syntax would work for a packed cursor. For example, I have a MyPack package with an ad
type MyType is record (X integer);
cursor MyCurs(x in integer) return MyType;
Now in my Pro * C code I have a rather unsatisfactory part of the embedded PL / SQL that opens the cursor, makes a selection, etc., since I could not get the first syntax style to work. Using an example
EXEC SQL EXECUTE
DECLARE
XTable is table of MyPack.MyType;
BEGIN
OPEN MyPack.MyCurs(:param);
FETCH MyPack.MyCurs INTO XTable;
CLOSE MyPack.MyCurs;
END;
END-EXEC;
Does anyone know if there is a cleaner approach for Pro * C?
source
share