【发布时间】:2021-11-18 16:12:32
【问题描述】:
使用 Oracle SQL Developer,我正在尝试使这个 web (link) 示例工作:
CREATE OR REPLACE FUNCTION concat_self(str VARCHAR2, cnt PLS_INTEGER)
RETURN VARCHAR2 SQL_MACRO(SCALAR)
IS BEGIN RETURN 'rpad(str, cnt * length(str), str)';
END;
/
但我得到了那些我不明白的错误:
Function CONCAT_SELF compiled
LINE/COL ERROR
--------- -------------------------------------------------------------
2/37 PLS-00103: Encountered the symbol "SQL_MACRO" when expecting one of the following: . @ % ; is authid as cluster order using external character deterministic parallel_enable pipelined aggregate result_cache accessible
3/4 PLS-00103: Encountered the symbol "BEGIN" when expecting one of the following: not null of nan infinite dangling a empty
5/0 PLS-00103: Encountered the symbol "end-of-file" when expecting one of the following: end not pragma final instantiable order overriding static member constructor map
Errors: check compiler log
【问题讨论】:
-
您的数据库是什么 Oracle 版本?该链接适用于 Oracle 21 中的新功能,因此如果您使用的是早期版本,那么它将无法使用。
-
你是对的。来自其他语言,我认为宏不可能是一个新概念......
标签: macros oracle-sqldeveloper