Basic HTML version of Foils prepared 7 October 97

Foil 34 An Example of PL/SQL Stored Procedure - III

From untitled presentation ARL Database Tutorial -- February 98. by Gang Cheng, C.W. Ou, Geoffrey C. Fox


1 BEGIN
2 OPEN person_cur(name); -- open the cursor
3 LOOP -- Fetch each row matching
  • the query into variables repeatedly
4 FETCH person_cur INTO lname,fname,phone,ptype;
5 EXIT WHEN person_cur%NOTFOUND;
    • -- check end of result buffer
6 /* print out the query result */
7 htp.p('The '||ptype||' phone no. of' ||fname||' '||lname||': '||phone);
8 END LOOP;
9 CLOSE person_cur;-- close the cursor after it is done
10 END get_person_by_name;

in Table To:


© Northeast Parallel Architectures Center, Syracuse University, npac@npac.syr.edu

If you have any comments about this server, send e-mail to webmaster@npac.syr.edu.

Page produced by wwwfoil on Thu Feb 5 1998