-- -------------------------------------------------------
-- Roqet function to replace things in strings
-- roq_f_replace_strings sql script copyright 2005 roqet - http://www.roqet.org.
-- roq_f_replace_strings can be distributed and modified under the terms of the
-- GNU General Public License: http://www.gnu.org/copyleft/gpl.html
--   ~~~
--   'l'
--    -
-- -------------------------------------------------------

CREATE OR REPLACE FUNCTION ROQ_F_REPLACE_STRINGS( sString VARCHAR2 )
RETURN VARCHAR2
IS
  sResult VARCHAR2(2000);
  BEGIN
  sResult := REPLACE(sString,'''','''''');
  --sResult := REPLACE(sResult,'@','\e');
  sResult := REPLACE(sResult,'&','&'' || ''''); -- untested
  sResult := REPLACE(REPLACE(sResult,CHR(10),'''' || '|| CHR(10) ||' || ''''),CHR(13),'''' || '|| CHR(10) ||' || '''');
  RETURN sResult;
  END;
/
EXIT
