PLS-00103: Encountered the symbol "CREATE"

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.

你可能感兴趣的:(sql,cache,table,Integer,insert,compilation)