Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Referring to cursor values with dot notation

Re: Referring to cursor values with dot notation

From: Ricardo Rocha <rrocha_at_usagate.net>
Date: 1997/03/02
Message-ID: <01bc2726$9197daa0$6464c7d0@rrocha>#1/1

A PL/SQL cursor must be explicitely FETCHed into program variable(s) for its values to become available to the PL/SQL block. Extending your example, the "complete"PL/SQL block would look like:

DECLARE

	LOOP
		-- Fetch required to retrieve values
		FETCH c INTO my_row;
		-- Exit if cursor exhaust
		EXIT WHEN c%NOTFOUND;

		-- Now we can insert...
		INSERT INTO table2(field1, field2)
		VALUES(my_row.field1, my_row.field2); -- Note field references
	END LOOP;


-- Done, clean up
CLOSE c;

END; Received on Sun Mar 02 1997 - 00:00:00 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US