I need to select certain fields from various tables, format them and dump them into a commen table using Pro* C. I know i can do this by fetching the fields into a cursor and then inserting the entire cursor into the new table. What i don't know is, if i can use cursors in Pro* C. And if I can, HOW? Please, somebody reply soon.
Thanx in advance.
PRO*C cursors have the same 4 steps as a regular PL/SQL:
EXEC SQL DECLARE emp_cursor CURSOR FOR
SELECT ename, empno, sal
WHERE deptno = :dept_number;
EXEC SQL OPEN emp_cursor;
EXEC SQL FETCH emp_cursor
INTO :emp_name, :emp_number, :salary;
EXEC SQL CLOSE emp_cursor;
You handle the cursor not found by
EXEC SQL WHENEVER NOT FOUND..
Hope this helps.
Click Here to Expand Forum to Full Width