Home » SQL & PL/SQL » SQL & PL/SQL » steps after sucessfully created the cursor
steps after sucessfully created the cursor [message #37493] Tue, 12 February 2002 01:13 Go to next message
ranjan kumar dash
Messages: 15
Registered: February 2002
Junior Member
My question was after open cursor then fetch data then close cursor
then in SQL prompt it will show cursor created sucessfully after the creation
what are the steps to execute it like for example after creation of store procedure in SQL prompt we used exec 'procedure name'
Re: steps after sucessfully created the cursor [message #37529 is a reply to message #37493] Wed, 13 February 2002 06:38 Go to previous message
farooq
Messages: 12
Registered: July 2001
Junior Member
Cursors are not used on sql prompt they are used in PL/SQL Blocks, Packages, Function,etc in following way.... (following example is a simple block)

declare
cursor c1 is select name from data_table;
begin

--Cursor For Loop I have Used

for cvar in c1 loop
dbms_output.put_line(name);
end loop;

end;
/

Above block will automatically open, fetch and close the cursor by using Cursor for loop. In for loop c1 is cursor and cvar is a variable containing the current value of c1.name which is incremented automatically
Previous Topic: How to calculating the difference between dates on different rows
Next Topic: ORA-00937: not a single-group group function
Goto Forum:
  


Current Time: Thu Mar 28 17:21:27 CDT 2024