1

我正在尝试在 SQLPlus 中运行以下代码:

exec lbacsys.sa_sysdba.create_policy(policy_name => 'ACCESS_LOCATIONS',
                                      column_name => 'OLS_COLUMN',
                                      default_options => 'READ_CONTROL,INSERT_CONTROL,UPDATE_CONTROL,DELETE_CONTROL,LABEL_DEFAULT,LABEL_UPDATE,CHECK_CONTROL,');

但是,我收到以下错误:

BEGIN lbacsys.sa_sysdba.create_policy(policy_name => 'ACCESS_LOCATIONS',; END;

                                                                        *
ERROR at line 1:
ORA-06550: line 1, column 78:
PLS-00103: Encountered the symbol ";" when expecting one of the following:
( - + case mod new not null <an identifier>
<a double-quoted delimited-identifier> <a bind variable>
continue avg count current exists max min prior sql stddev
sum variance execute forall merge time timestamp interval
date <a string literal with character set specification>
<a number> <a single-quoted SQL string> pipe
<an alternatively-quoted string literal with character set specification>
<an alternatively

在我看来,我在语法上做错了。我只是不确定它是什么。任何帮助,将不胜感激。谢谢 :)

4

1 回答 1

4

EXEC 语句采用一行代码并将其包装在 BEGIN/END 块中。在这种情况下,您希望将调用拆分为几行代码,因此您可能会发现自己添加 BEGIN/END 更容易:

BEGIN
  lbacsys.sa_sysdba.create_policy(policy_name => 'ACCESS_LOCATIONS',
                                  column_name => 'OLS_COLUMN',
                                  default_options =>
       'READ_CONTROL,INSERT_CONTROL,'
    || 'UPDATE_CONTROL,DELETE_CONTROL,'
    || 'LABEL_DEFAULT,LABEL_UPDATE,CHECK_CONTROL,');
END;
/
于 2009-08-20T13:09:08.633 回答