[英]Problems running Sample SQL
錯誤:
ORA-06550: line1, column 22: PLS-00103 Encountered the symbol "end-of-file" when expecting one of the following: * & = - + .......
PL / SQL塊:
DECLARE v_c number :=0;
BEGIN
SELECT COUNT(*) into v_c from all_sequences where sequence_name='TEST_SEQ' and sequence_owner='test';
IF v_c = 1 THEN
execute immediate 'DROP SEQUENCE test.TEST_SEQ';
END IF;
END;
/
我從您的帖子中復制了代碼,並在SQLDeveloper和SQLPlus中運行了它們,都沒有問題:
已連接到:Oracle Database 11g版本11.2.0.3.0-生產
prompt> DECLARE v_c number :=0;
2 BEGIN
3 SELECT COUNT(*) into v_c from all_sequences where sequence_name='TEST_SEQ' and sequence_owner='test';
4 IF v_c = 1 THEN
5 execute immediate 'DROP SEQUENCE test.TEST_SEQ';
6 END IF;
7 END;
8 /
PL/SQL procedure successfully completed.
您正在使用什么工具? 我最好的建議是在SQLPlus中嘗試一下,如果仍然有錯誤,請向我們顯示會話的全文。
您只執行第一行,而不執行整個PL / SQL塊。
DECLARE v_c number :=0
/
導致:
DECLARE v_c number :=0
*
ERROR at line 1:
ORA-06550: line 1, column 22:
PLS-00103: Encountered the symbol "end-of-file" when expecting one of the
following:
* & = - + ; < / > at in is mod remainder not rem
就像其他人建議的那樣,請在SQLPlus中嘗試此操作。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.