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

Home -> Community -> Usenet -> c.d.o.misc -> pl/sql programming help

pl/sql programming help

From: Sali <skhan_at_mdsp.org>
Date: Wed, 6 Oct 2004 13:49:36 -0400
Message-ID: <sfW8d.4$ze6.2424@news.abs.net>


Hello,

    Im very new to the world of pl/sql and i'm sorta stuck on the following problem. I partially have part of the code to implement my solution but I am having problems understanding implicit cursors. Any help would be greatly appreciated. Thanks in advance.

Here's the problem: Modify the code and make use of cursor attributes to test whether cursor is open or closed, whether update is successful, if yes, commit the update and output how many records updated, if not, output an message saying update is not successful. Hints:   a.. Modify where clause, using deptno 20 (with records) and 40 (without record) when you test your code.
  b.. Use DBMS_OUPUT built-in to output your results.   c.. SQL can be used as Implicit cursor name in front of cursor attributes, like SQL%FOUND.
Here's the code I have so far:
declare

    v_dept dept%rowtype;
begin
--When executed, implicit cursor is created(or opened) for update statement
--and closed after it is executed.

 update emp
 set sal = sal + 20
 where deptno = 10;

 exception
   when others then
     DBMS_OUTPUT.PUT_LINE('error occurs.'); end;
/ Received on Wed Oct 06 2004 - 12:49:36 CDT

Original text of this message

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