我是靠谱客的博主 清秀鸵鸟,最近开发中收集的这篇文章主要介绍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.

最后

以上就是清秀鸵鸟为你收集整理的PLS-00103: Encountered the symbol "CREATE"的全部内容,希望文章能够帮你解决PLS-00103: Encountered the symbol "CREATE"所遇到的程序开发问题。

如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(46)

评论列表共有 0 条评论

立即
投稿
返回
顶部