How to find out PLSQL Compilation errors

前端 未结 2 820
悲&欢浪女
悲&欢浪女 2021-01-22 02:16
create or replace procedure address_insert 
as

CREATE type colorarray is varray(10) of varchar2(10);
CREATE type cities is varray(6) of varchar2(20);
CREATE type states         


        
相关标签:
2条回答
  • 2021-01-22 02:49

    If you're in SQL*Plus, do a 'SHOW ERRORS'. This also works in SQL Developer's SQL Worksheet.

    If you're in a proper IDE - you'll see the errors at compile time.

    0 讨论(0)
  • 2021-01-22 02:50

    You can get compilation errors from the DBA_ERRORS or USER_ERRORS views. In your case, try something like

    SELECT *
      FROM USER_ERRORS
      WHERE NAME = 'ADDRESS_INSERT'
    

    Remember that in Oracle table, view, procedure, package, etc names are UPPER_CASE by default, even if they're shown in lower_case in your source code.

    Right off the top I can see that CREATE TYPE is not valid in a procedure. You probably want something like

    TYPE COLORARRAY IS VARRAY(10) OF VARCHAR2(10)
    

    See the PL/SQL Reference Manual section on defining collection types. for further information.

    Best of luck.

    0 讨论(0)
提交回复
热议问题