Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need code to learn from

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
Does anybody have any PL/SQL code that is used in real life they could send me? I'm trying to learn the language and am curious to see what the non-textbook code looks like.
My home address is granzow@home.com
Thanks, Mindy
 
One simple example using a cursor and loop:


--THIS WILL GIVE YOU THE FIRST FIVE RECORDS
--FROM COLUMN MGR IN TABLE EMPY.
declare
m_id number;
cursor par is select mgr from empy;
begin
open par;
fetch par into m_id;
while (par%rowcount <= 5)
loop
dbms_output.put_line('mgr = ' || m_id);
fetch par into m_id;
end loop;
end;
/
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top