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: Cursor Question

Re: Cursor Question

From: Thomas Kyte <tkyte_at_us.oracle.com>
Date: Sun, 06 Jun 1999 13:04:11 GMT
Message-ID: <37617162.17688374@newshost.us.oracle.com>


A copy of this was sent to Manfred Woellner <manfred_woellner_sc_at_my-deja.com> (if that email address didn't require changing) On Sun, 06 Jun 1999 09:12:54 GMT, you wrote:

>Greetings,
>can anyone tell me why I get this Errormsg. (see Procedure on the
>bottom)
>PLS-00306 wrong number or types of arguments in call 'REPLACE'
>TIA
>Manfred
>

it is confusing your replace with the builtin replace function. Which replace should it call when you go:

SQL> exec replace

you would like it to call your procedure but it would like to call your function. it gets even more confusing when your procedure replace calls the function replace.

rename your procedure to something else to clear up the confusion.

>CREATE OR REPLACE
>PROCEDURE replace AS
>
>v_txt_ref CDI_TEXT2.txt_ref%TYPE;
>v_txt_text CDI_TEXT2.txt_text%TYPE;
>
>CURSOR v_cursor IS SELECT txt_ref, txt_text FROM CDI_TEXT2;
>BEGIN
> OPEN v_cursor;
> LOOP
> FETCH v_cursor INTO v_txt_ref, v_txt_text;
> EXIT WHEN v_cursor%NOTFOUND;
> REPLACE(v_txt_text, '#Marion#', '#M#');
> UPDATE CDI_TEXT2 SET txt_text = v_txt_text
> WHERE txt_ref = v_txt_ref;
> END LOOP;
> CLOSE v_cursor;
>END;
>
>
>Sent via Deja.com http://www.deja.com/
>Share what you know. Learn what you don't.

See http://www.oracle.com/ideveloper/ for my column 'Digging-in to Oracle8i'...  

Thomas Kyte
tkyte_at_us.oracle.com
Oracle Service Industries
Reston, VA USA

--
Opinions are mine and do not necessarily reflect those of Oracle Corporation Received on Sun Jun 06 1999 - 08:04:11 CDT

Original text of this message

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