PLS-00103: Encountered the symbol "CREATE"
2012-05-18 10:14
393 查看
I wrote a SQL script as below, while executing it, encountered 'PLS-00103: Encountered the symbol "CREATE"' error.
logging.sql
----
DROP SEQUENCE pt_debug_sequence;
CREATE SEQUENCE pt_debug_sequence
START WITH 1
INCREMENT BY 1
NOMAXVALUE
NOCYCLE
CACHE 10;
DROP TABLE pt_debug_tab;
CREATE TABLE pt_debug_tab (seq INTEGER, text VARCHAR2(300), datetag VARCHAR2(30));
CREATE OR REPLACE
PROCEDURE pt_debug(inStr VARCHAR2) IS
PRAGMA AUTONOMOUS_TRANSACTION;
BEGIN
INSERT INTO pt_debug_tab VALUES(pt_debug_sequence.NEXTVAL, inStr, to_char(sysdate, 'MM/DD/YYYY HH24:MI:SS'));
COMMIT;
END;
/ -- There should be ended with '/'
CREATE OR REPLACE
PROCEDURE putline IS
--v_line varchar2(40);
--intime varchar2(40);
--outtime varchar2(40);
BEGIN
--select to_char(sysdate, 'MM/DD/YYYY HH:MI:SS') into intime from dual;
--dbms_output.put_line('Start Time:'||intime);
--dbms_output.put_line('Start Time:'||to_char(sysdate, ));
--v_line := 'hello world';
--dbms_output.put_line(v_line);
--dbms_lock.sleep(30);
--select to_char(sysdate, 'MM/DD/YYYY HH:MI:SS') into outtime from dual;
pt_debug('dbms_lock.sleep(30)');
--dbms_output.put_line('End Time:'||outtime);
END;
/
========
SQL> @logging.sql
Sequence dropped.
Sequence created
Table dropped.
Table created.
Warning: Procedure created with compilation errors.
SQL> show errors
Errors for PROCEDURE PT_DEBUG:
LINE/COL ERROR
-------- -----------------------------------------------------------------
9/1 PLS-00103: Encountered the symbol "CREATE"
SQL>
=============
The problem is forgetting to add '/' for the first procedure. When we encounter this kind of issue, usually, we miss adding something or the variable is reserved one etc.
logging.sql
----
DROP SEQUENCE pt_debug_sequence;
CREATE SEQUENCE pt_debug_sequence
START WITH 1
INCREMENT BY 1
NOMAXVALUE
NOCYCLE
CACHE 10;
DROP TABLE pt_debug_tab;
CREATE TABLE pt_debug_tab (seq INTEGER, text VARCHAR2(300), datetag VARCHAR2(30));
CREATE OR REPLACE
PROCEDURE pt_debug(inStr VARCHAR2) IS
PRAGMA AUTONOMOUS_TRANSACTION;
BEGIN
INSERT INTO pt_debug_tab VALUES(pt_debug_sequence.NEXTVAL, inStr, to_char(sysdate, 'MM/DD/YYYY HH24:MI:SS'));
COMMIT;
END;
/ -- There should be ended with '/'
CREATE OR REPLACE
PROCEDURE putline IS
--v_line varchar2(40);
--intime varchar2(40);
--outtime varchar2(40);
BEGIN
--select to_char(sysdate, 'MM/DD/YYYY HH:MI:SS') into intime from dual;
--dbms_output.put_line('Start Time:'||intime);
--dbms_output.put_line('Start Time:'||to_char(sysdate, ));
--v_line := 'hello world';
--dbms_output.put_line(v_line);
--dbms_lock.sleep(30);
--select to_char(sysdate, 'MM/DD/YYYY HH:MI:SS') into outtime from dual;
pt_debug('dbms_lock.sleep(30)');
--dbms_output.put_line('End Time:'||outtime);
END;
/
========
SQL> @logging.sql
Sequence dropped.
Sequence created
Table dropped.
Table created.
Warning: Procedure created with compilation errors.
SQL> show errors
Errors for PROCEDURE PT_DEBUG:
LINE/COL ERROR
-------- -----------------------------------------------------------------
9/1 PLS-00103: Encountered the symbol "CREATE"
SQL>
=============
The problem is forgetting to add '/' for the first procedure. When we encounter this kind of issue, usually, we miss adding something or the variable is reserved one etc.
相关文章推荐
- PLS-00103: Encountered the symbol "CREATE"
- 存储过程 编译错误:PLS-00103: Encountered the symbol "TABLE" when expecting one of the following:
- PLS-00103: Encountered the symbol "" when expecting one of the following
- PLS-00103:Encountered the symbol "EXIT" when expecting one of the following:.( ,%
- Error: PLS-00103: 出现符号 "CREATE"在需要下列之一时:
- Error: PLS-00103: 出现符号 "CREATE"在需要下列之一时:
- exception PLS-00103: Encountered the symbol "(" when expecting one of the following:
- 当打开Oracle Jdevelopler 11g时出现"Unable to create an instace of the jave virtual Machine Located at path"错时解决办法
- eclipse启动时弹出"Failed to create the Java Virtual Machine"解决办法
- VM安装失败 “Failed to create the requested registry key Key:installer Error:1021"
- 打开Eclipse时出现"Failed to create the Java Virtual Machine"怎么办
- 打开Eclipse时出现"Failed to create the Java Virtual Machine"解决办法
- VC中The symbol "xxx" is undefined解决办法
- 打开Eclipse时出现"Failed to create the Java Virtual Machine"怎么办?
- VMware安装失败 “Failed to create the requested registry key Key:installer Error:1021"
- VMware安装失败 “Failed to create the requested registry key Key:installer Error:1021"
- 打开Eclipse时出现 "Failed to create the Java Virtual Machine
- PCC-S-02201, Encountered the symbol "DB_USER_OPER_COUNT"
- Failed to create the Java Virtual Machine" 解决方案
- Tips002 - Eclipse "Could not create the view" 问题解决方案