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 -> Re: pl/sql programming help

Re: pl/sql programming help

From: Daniel Morgan <damorgan_at_x.washington.edu>
Date: Thu, 07 Oct 2004 08:06:39 -0700
Message-ID: <1097161683.431632@yasure>


Sali wrote:

> 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;
> /

Yes school is back in session.

I think you are confused about the difference between implicit and explicit cursors. You can not test an implicit cursor to see if it is open. Please clarify your intent and reask your question.

-- 
Daniel A. Morgan
University of Washington
damorgan_at_x.washington.edu
(replace 'x' with 'u' to respond)
Received on Thu Oct 07 2004 - 10:06:39 CDT

Original text of this message

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