5

我正在调用这样的 PL/SQL 过程:

execute util.verify(src_schema => '&username',
                    stab       => '&tab_name');

我得到这些错误:

SQL> execute util.verify(src_schema => '&username',
BEGIN util.verify(src_schema => 'u1',; END;

                                     *
ERROR at line 1:
ORA-06550: line 1, column 57: 
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


SQL>                   stab       => '&tab_name',
SP2-0734: unknown command beginning "stab      ..." - rest of line ignored.

看起来我不能只是在,. 如何在多行中编写此调用?

4

3 回答 3

12

在 SQLPlus 中,您在下一行继续的行的末尾放置一个破折号。

execute util.verify(src_schema => '&username', -
                    stab       => '&tab_name');

更新:添加了文档链接

执行、SQL*Plus® 用户指南和参考

于 2010-12-25T10:11:17.943 回答
8

还有一种替代方法,如下所示:

begin
    util.verify(src_schema => '&username',
                    stab       => '&tab_name');
end;
/
于 2010-12-25T07:56:27.683 回答
5

execute xxxx;(or exec xxxx;) 是写作的捷径begin xxxx; end;

它只适用于一个衬垫。因此,如果您有多行,则需要显式使用beginand end

于 2010-12-25T09:35:55.380 回答