2015-10-15 72 views
1
prompt ------------------------------------------------ 
prompt Executing...DDL/SCRIPT NAME.sql 
prompt ------------------------------------------------ 

SET SERVEROUTPUT ON; 
SET VERIFY OFF; 
    WHENEVER SQLERROR EXIT ; 
    WHENEVER OSERROR EXIT ; 

prompt DDL/JIRA-ID Checking columns UPDT_USERID, TIME_STAMP, LAST_ACTION for NULL values. 
DECLARE 
    v_error boolean := FALSE; 
     v_exit EXCEPTION; 
Begin 
--- Some Code 
END; 

雖然運行此代碼我收到錯誤的行甲骨文提示提供錯誤

prompt DDL/JIRA-ID Checking columns UPDT_USERID, TIME_STAMP, LAST_ACTION for NULL values. 

錯誤是如下。

DDL/FND-18918 Checking columns UPDT_USERID, TIME_STAMP, LAST_ACTION for NULL values. 
    prompt DDL/FND-18918 Checking columns HIST_USERID, HIST_TIME_STAMP, HIST_ACTION for NULL values. 
      * 

ORA-06550: 
PLS-00103: Encountered the symbol "DDL" when expecting one of the following: 
:= . (@ % ; 
The symbol ":=" was substituted for "DDL" to continue. 
ORA-06550: 
PLS-00103: Encountered the symbol "CHECKING" when expecting one of the 
following: 
* & = - + ; </> at in is mod remainder not rem 
<an exponent (**)> <> or != or ~= >= <= <> and or like like2 
like4 likec between || member submultiset 

我可以知道確切的根本原因。因爲我有很長的DDL腳本,我已經在每個DECLARE塊之前放置了提示語句。

回答

0
I have tried your code only. Just modified a bit and its working fine. 

     prompt ------------------------------------------------ 
prompt Executing...DDL/SCRIPT NAME.sql 
prompt ------------------------------------------------ 

SET SERVEROUTPUT ON; 
SET VERIFY OFF; 
WHENEVER SQLERROR EXIT ; 
WHENEVER OSERROR EXIT ; 
prompt DDL/JIRA-ID Checking columns UPDT_USERID, TIME_STAMP, LAST_ACTION for NULL values. 
DECLARE 
    v_error BOOLEAN := FALSE; 
    v_exit EXCEPTION; 
BEGIN 
    --- Some Code 
    NULL; 
END; 

------------------------------------------------ 
prompt Executing...DDL/SCRIPT NAME.sql 
------------------------------------------------ 
DDL/JIRA-ID Checking columns UPDT_USERID, TIME_STAMP, LAST_ACTION for NULL values. 
anonymous block completed 
0

也請注意結尾sqlplus命令 - 繼續下一行..

而且成功/未成功也取決於您的客戶端上。