Topic
No replies
onevedrov
onevedrov
1 Post
ACCEPTED ANSWER

Pinned topic PL/SQL in Oracle connector

‏2012-11-14T10:33:42Z |
Hello,

I'm trying to figure out how to pull data from oracle database using PL/SQL. We are not allowed to create any objects in the database. I'm trying to find the way to consolidate data using PL/SQL. In Oracle Connector stage I set read mode to PL/SQL and defined following code in PL/SQL block:
DECLARE
V_EMNO INT;
V_EMNM VARCHAR(10);
v_emp_refcur SYS_REFCURSOR;
BEGIN
DBMS_OUTPUT.PUT_LINE('EMPNO ENAME');
DBMS_OUTPUT.PUT_LINE('----- -------');
OPEN v_emp_refcur FOR SELECT EMNO empno, EMNM ename FROM EMP ;
LOOP
FETCH v_emp_refcur INTO V_EMNO, V_EMNM;
EXIT WHEN v_emp_refcur%NOTFOUND;
DBMS_OUTPUT.PUT_LINE(V_EMNO || ' ' || V_EMNM);
END LOOP;
CLOSE v_emp_refcur;
END;

I set my output to the seq file and I'm getting only one record with values 0,0. I know i have more records, because in SQL developer it get all my rows (100). If some one can direct me how this stage works with PL/SQL.

Thanks in advance,
Oleg