I am writing a PL/SQL stored procedure using Toad in Eclipse. I have it working just fine and the procedure is below:
CREATE OR REPLACE PROCEDURE crl_sync
IS
unit_separator CONSTANT char:= CHR(31);
record_separator CONSTANT char:= CHR(30);
CURSOR c_bc is
SELECT m.barcode, s.id, s.tracking_tags
FROM model m, sample s
WHERE m.id = s.id;
r_bc c_bc%ROWTYPE;
BEGIN
DBMS_OUTPUT.ENABLE(1000000);
DBMS_OUTPUT.PUT_LINE('--CRL_SYNC--');
OPEN c_bc;
LOOP
FETCH c_bc into r_bc;
EXIT WHEN c_bc%NOTFOUND;
DBMS_OUTPUT.PUT_LINE('barcode = '||r_bc.barcode);
END LOOP;
CLOSE c_bc;
END;
/
It compiles and executes just fine; note the DBMS_OUTPUT.ENABLE line and the put_line at the start to rule out a problem with the query but still nothing in the toad window in Eclipse. Can someone please provide a pointer as to what I'm doing wrong here?
Thanks.