Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: pl/sql programming help
"Sali" <skhan_at_mdsp.org> wrote in message
news:sfW8d.4$ze6.2424_at_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;
> /
>
>
>
What PL/SQL book is your instructor using? Most books explain it. What don't you understand about implicit cursors? Received on Wed Oct 06 2004 - 14:56:34 CDT