spool p4.out
set echo on
set serveroutput on
set verify off
/* Procedure printj case: */
begin
   jpak.printj('&jnum');
   exception
      when jpak.no_jrec then
         dbms_output.put_line('*****************');
         dbms_output.put_line('jnum not in table');
         dbms_output.put_line('*****************');
end;
/
begin
   jpak.printj('&jnum');
   exception
      when jpak.no_jrec then
         dbms_output.put_line('*****************');
         dbms_output.put_line('jnum not in table');
         dbms_output.put_line('*****************');
end;
/
/* Function cursor case: */
declare
   x jpak.rec;
begin
   open jpak.xs('&snum','&pnum');
   loop
       fetch jpak.xs into x;
       exit when jpak.xs%notfound;
       dbms_output.put_line (x.j#||'  '||x.jname||'  '||x.jcity||'  '
       ||x.qtY);
   end loop;
   close jpak.xs;
end;
/
/* SQL*PLUS script to call insertj function using a bind variable*/
/* Successful case: INSERTJ  */
variable ret number;
execute :ret :=insertj('&jnum','&jname','&city');
print ret;
select * from j;
/**/
/* Failure case: insertj */
variable ret number;
execute :ret :=insertj('&jnum','&jname','&city');
print ret;
select * from j;
/**/
/* SQL*PLUS script to call updatej function using a bind variable*/
/**/
/* Successful case: UPDATEJ */
variable ret number;
execute :ret :=updatej('&jnum','&newcity');
print ret;
select * from j;
/**/
/* Failure case: UPDATEJ  */
variable ret number;
execute :ret :=updatej('&jnum','&newcity');
print ret;
select * from j;
/* SQL*PLUS script to call deletej function using a bind variable*/
/**/
/* Successful case: DELETEJ  */
variable ret number;
execute :ret :=deletej('&jnum');
print ret;
select * from j;
/**/
/* Failure case: DELETEJ */
variable ret number;
execute :ret :=deletej('&jnum');
print ret;
select * from j;
/  
spool ofF

