您的位置:首页 > 其它

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.
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐