oracle – 无法在PLSQL中使用REPLACE函数

前端之家收集整理的这篇文章主要介绍了oracle – 无法在PLSQL中使用REPLACE函数前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我想知道调用 REPLACE function described here的适当方法是什么,因为我已经创建了下面的语句来测试它,但是我收到了一个错误

DECLARE
 templateMessage3 VARCHAR2(50);
BEGIN
 templateMessage3 := 'Dear Mr./Madam FNAME';
  replace(templateMessage3,'FNAME','Lilly');
  DBMS_OUTPUT.PUT_LINE(templateMessage3);
END;
/

错误

PLS-00221: 'REPLACE' is not a procedure or is undefined

我正在使用Oracle 11g Web界面.

解决方法

REPLACE是一个函数,而不是一个过程,因此请使用以下语法:

templateMessage3 := replace(templateMessage3,'Lilly');

猜你在找的Oracle相关文章