简体   繁体   English

oracle 19C 中 SQL_MACRO 的编译错误

[英]Compilation error for SQL_MACRO in oracle 19C

create or replace function f_get_ids(p_user in nvarchar2)
return nvarchar2 sql_macro(table)
as
begin
  return q'[select id from table1 where user=p_user]';
end;

while executing the above code in oracle 19.0.0.0.0 version getting the below error.在 oracle 19.0.0.0.0 版本中执行上述代码时出现以下错误。

Error(1,27): PLS-00103: Encountered the symbol "(" when expecting one of the following: ; is default authid as cluster order using external deterministic parallel_enable pipelined aggregate result_cache accessible rewrite错误(1,27):PLS-00103:遇到以下符号之一时遇到符号“(”:;是使用外部确定性parallel_enable流水线聚合result_cache可访问重写的默认authid作为集群顺序

Simple fix once you get to the right patch level on 19c.一旦您在 19c 上达到正确的补丁级别,就可以轻松修复。

Because there is only ONE type of macro in 19c, you don't need to quantify which type, eg因为19c中只有一种类型的宏,所以不需要量化是哪种类型,eg

SQL> create or replace function f_get_ids(p_user in nvarchar2)
  2  return nvarchar2 sql_macro(table)
  3  as
  4  begin
  5    return q'[select id from table1 where user=p_user]';
  6  end;
  7  /

Warning: Function created with compilation errors.

SQL>
SQL>
SQL> create or replace function f_get_ids(p_user in nvarchar2)
  2  return nvarchar2 sql_macro     
  3  as
  4  begin
  5    return q'[select id from table1 where user=p_user]';
  6  end;
  7  /

Function created.

Same as when you asked here as well:-)和你在这里问的一样:-)

https://asktom.oracle.com/pls/apex/asktom.search?tag=error-while-executing-sql-macro-in-19c https://asktom.oracle.com/pls/apex/asktom.search?tag=error-while-executing-sql-macro-in-19c

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM