gpt4 book ai didi

带有换行符的 Oracle SQL VARCHAR 列

转载 作者:行者123 更新时间:2023-12-01 11:56:36 28 4
gpt4 key购买 nike

我试过了:

update MESSAGE set TEXT = 'The following ' || CHAR(13) || CHAR(10) || 'has been disapproved'
where TITLE = 'REQUEST_DISAPPROVED';commit;

还有:

DECLARE
msg VARCHAR2 := 'The following ' || CHAR(13) || CHAR(10) || 'has been disapproved';
BEGIN
update MESSAGE set TEXT = :msg
where TITLE = 'REQUEST_DISAPPROVED';
END;

还有:

var this_is_a_variable varchar2(3000); 

exec :this_is_a_variable := 'The following ' || CHAR(13) || CHAR(10) || 'has been disapproved';
update MESSAGE set TEXT = :this_is_a_variable where TITLE = 'REQUEST_DISAPPROVED';

每个都给出了各种各样的错误,我相信这只是一个语法问题。最终目标是当从此邮件生成纯文本电子邮件时,将适当放置换行符。

这可能吗?

最佳答案

您需要使用 CHR 功能,换行符会产生所需的结果。

UPDATE MESSAGE
SET TEXT = 'The following '
|| CHR(10)
|| CHR(10)
|| 'has been disapproved'
WHERE TITLE = 'REQUEST_DISAPPROVED';
COMMIT;

关于带有换行符的 Oracle SQL VARCHAR 列,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25212018/

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