簡體   English   中英

在多行中打破PL / SQL過程調用的正確語法是什么?

[英]What is the correct syntax to break a PL/SQL procedure call in multiple lines?

我正在調用這樣的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.

貌似我不能打破在中之間的通話, 如何以多行編寫此調用?

在SQLPlus中,您將破折號放在下一行繼續的行的末尾。

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

更新 :添加了文檔鏈接

EXECUTE,SQL *Plus®用戶指南和參考

還有另一種方法,如下所示:

begin
    util.verify(src_schema => '&username',
                    stab       => '&tab_name');
end;
/

execute xxxx; (或exec xxxx; )是寫作begin xxxx; end;的捷徑begin xxxx; end; begin xxxx; end;

它僅適用於一個襯墊。 因此,如果您有多行,則需要明確使用beginend

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM