Index | Home | Forums
Oracle PL/SQL Example 2-31 Using the Function REPLACE

Example 2-31 Using the Function REPLACE

DECLARE
   string_type VARCHAR2(60);
   old_string string_type%TYPE := 'Apples and oranges';
   v_string  string_type%TYPE := 'more apples';
-- NULL is a valid argument to REPLACE, but does not match
-- anything so no replacement is done.
   new_string string_type%TYPE := REPLACE(old_string, NULL, v_string);
BEGIN
   DBMS_OUTPUT.PUT_LINE('Old string = ' || old_string);
   DBMS_OUTPUT.PUT_LINE('New string = ' || new_string);
END;
/


This page was created by oracleabc.com on Feb 23,2008 00:09:02
General comments and questions regarding this document should be sent by email to info@oracleabc.com or post your comments here