gpt4 book ai didi

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

转载 作者:行者123 更新时间:2023-12-04 22:31:19 25 4
gpt4 key购买 nike

我想知道调用 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, 'FNAME', 'Lilly');

关于oracle - 无法在 PLSQL 中使用 REPLACE 函数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23325661/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com