-
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.
Khurram.
-
PRO*C cursors have the same 4 steps as a regular PL/SQL:
DECLARE:
EXEC SQL DECLARE emp_cursor CURSOR FOR
SELECT ename, empno, sal
FROM emp
WHERE deptno = :dept_number;
OPEN:
EXEC SQL OPEN emp_cursor;
FETCH:
EXEC SQL FETCH emp_cursor
INTO :emp_name, :emp_number, :salary;
CLOSE:
EXEC SQL CLOSE emp_cursor;
You handle the cursor not found by
EXEC SQL WHENEVER NOT FOUND..
Hope this helps.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|