Re: Cursor Question

From: Prasad Pelala <ppel_at_gwl.com>
Date: Mon, 07 Jun 1999 11:27:51 -0600
Message-ID: <375C0117.2196A3B_at_gwl.com>


REPLACE is a function and by definition a function returns a value. use REPLACE as a function to get a return value of char datatype.

You can, instead of ,
> REPLACE(v_txt_text, '#Marion#', '#M#');
> UPDATE CDI_TEXT2 SET txt_text = v_txt_text
> WHERE txt_ref = v_txt_ref;
UPDATE CDI_TEXT2
SET txt_text = replace ( txt_text, '<whatever>', '<Whatever>' ) ...
I dont think you need a cursor here.

Hope this works.

Prasad.

Manfred Woellner 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
>
> 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.
Received on Mon Jun 07 1999 - 19:27:51 CEST

Original text of this message