Why procedure created with compilation errors?

CREATE or REPLACE PROCEDURE AddStudent(
p_stuID number,
p_lname varchar2(30),
p_fname varchar2(20),
p_major varchar2(5) check(major IN
('ACCT','ECT','EET','BIS','BSIT','CIS','TCOM')),
P_standing varchar2(10) check(standing IN
('FRESHMAN','SOPHOMORE','JUNIOR','SENIOR')),
P_gpa number(3,2) IS
BEGIN
INSERT INTO STUDENT (P_STUID, P_LNAME, P_FNAME, P_MAJOR,
P_STANDING, P_GPA, P_ADVISOR) VALUES
(STUDENT_SEQ.NEXTVAL, 'SMITH', 'HEATHER', 'CIS', 'JUNIOR', 3.8,
2);
INSERT INTO STUDENT (P_STUID, P_LNAME, P_FNAME, P_MAJOR,
P_STANDING, P_GPA, P_ADVISOR) VALUES
(STUDENT_SEQ.NEXTVAL, 'ELLIOTT', 'DAVE', 'CIS', 'JUNIOR', 3.65,
2);
COMMIT;
END;
SQL> /
Warning: Procedure created with compilation errors.
any help would be appreciated

I would guess it's because you can't use CHECK like that (at
least not in Oracle 8i). If you want to check the validity of
procedural parameters you'll have to code this sort of thing:
BEGIN
IF major NOT IN ('whatever', 'etc') THEN
RAISE_APPLICATION_ERROR(-22200, 'Invlaid value for MAJOR');
ELSIF ....
For future reference you can use the SQL*Plus command SHOW ERR
to see what went wrong - it gives you line numbers and error
messages.
HTH, APC

Similar Messages

  • Warning: Procedure created with compilation errors.

    I am trying to upload a pdf file into a blob column of a table. I get this error with these three ways of doing that:Warning: Procedure created with compilation errors.
    Any ideas why?
    -- THE STORAGE TABLE FOR THE IMAGE FILE
    ALTER TABLE PDM
    DROP PRIMARY KEY CASCADE;
    DROP TABLE PDM CASCADE CONSTRAINTS;
    CREATE TABLE PDM (
    DNAME VARCHAR2(30), -- DIRECTORY NAME
    SNAME VARCHAR2(30), -- SUBDIRECTORY NAME
    FNAME VARCHAR2(30), -- FILE NAME
    IBLOB BLOB); -- IMAGE FILE
    -- CREATE THE PROCEDURE TO LOAD THE FILE
    CREATE OR REPLACE PROCEDURE LOAD_FILE (
    PDNAME VARCHAR2,
    PSNAME VARCHAR2,
    PFNAME VARCHAR2) IS
    SRC_FILE BFILE;
    DST_FILE BLOB;
    LGH_FILE BINARY_INTEGER;
    BEGIN
    SRC_FILE := BFILENAME('PDF_DIR', '266-5210.pdf');
    -- INSERT A NULL RECORD TO LOCK
    INSERT INTO PDM
    (DNAME, SNAME, FNAME, IBLOB)
    VALUES
    (PDNAME, PSNAME, PFNAME, EMPTY_BLOB())
    RETURNING IBLOB INTO DST_FILE;
    -- LOCK RECORD
    SELECT IBLOB
    INTO DST_FILE
    FROM PDM
    WHERE DNAME = PDNAME
    AND SNAME = PSNAME
    AND FNAME = PFNAME
    FOR UPDATE;
    -- OPEN THE FILE
    DBMS_LOB.FILEOPEN(SRC_FILE, DBMS_LOB.FILE_READONLY);
    DBMS_LOB.OPEN(DST_FILE, DBMS_LOB.LOB_READWRITE);
    -- DETERMINE LENGTH
    LGH_FILE := DBMS_LOB.GETLENGTH(SRC_FILE);
    -- READ THE FILE
    DBMS_LOB.LOADFROMFILE(DST_FILE, SRC_FILE, LGH_FILE);
    -- UPDATE THE BLOB FIELD
    UPDATE PDM
    SET IBLOB = DST_FILE
    WHERE DNAME = PDNAME
    AND SNAME = PSNAME
    AND FNAME = PFNAME;
    -- CLOSE FILE
    DBMS_LOB.FILECLOSE(SRC_FILE);
    END LOAD_FILE;
    -- THE STORAGE TABLE FOR THE IMAGE FILE
    ALTER TABLE PDM
    DROP PRIMARY KEY CASCADE;
    DROP TABLE PDM CASCADE CONSTRAINTS;
    CREATE TABLE PDM
    FNAME VARCHAR2(1000)
    ,IBLOB BLOB
    -- CREATE THE PROCEDURE TO LOAD THE FILE
    CREATE OR REPLACE PROCEDURE LOAD_FILE AS (
    SRC_FILE BFILE := BFILENAME('PDF_DIR', '262-2827.pdf');
    DST_FILE BLOB;
    BEGIN
    -- INSERT A NULL RECORD TO LOCK
    INSERT INTO PDM
    (FNAME, IBLOB)
    VALUES
    ('262-2827.pdf', EMPTY_BLOB())
    RETURNING IBLOB INTO DST_FILE;
    -- OPEN THE FILE
    DBMS_LOB.FILEOPEN(SRC_FILE, DBMS_LOB.FILE_READONLY);
    DBMS_LOB.OPEN(DST_FILE, DBMS_LOB.LOB_READWRITE);
    -- READ THE FILE
    DBMS_LOB.LOADFROMFILE( SRC_FILE, DST_FILE);
    -- UPDATE THE BLOB FIELD
    UPDATE PDM
    SET FNAME = SRC_FILE,
    IBLOB = DST_FILE;
    -- CLOSE FILE
    DBMS_LOB.CLOSE(DST_FILE);
    DBMS_LOB.FILECLOSE(SRC_FILE);
    COMMIT;
    END LOAD_FILE;
    ALTER TABLE IMAGE_TABLE
    DROP PRIMARY KEY CASCADE;
    DROP TABLE IMAGE_TABLE CASCADE CONSTRAINTS;
    CREATE TABLE IMAGE_TABLE (
    ID NUMBER PRIMARY KEY,
    IMAGE ORDSYS.ORDIMAGE);
    CREATE OR REPLACE DIRECTORY IMAGEDIR AS 'C:\cards\';
    GRANT READ ON DIRECTORY IMAGEDIR TO PUBLIC;
    GRANT READ ON DIRECTORY MY_FILES TO twilliam;
    GRANT READ ON DIRECTORY MY_FILES TO tmwillia;
    CREATE OR REPLACE PROCEDURE IMAGE_IMPORT(DEST_ID NUMBER,
    FILENAME VARCHAR2)
    IS
    IMG ORDSYS.ORDIMAGE;
    CTX RAW(64) := NULL;
    BEGIN
    DELETE FROM IMAGE_TABLE
    WHERE ID = DEST_ID;
    INSERT INTO IMAGE_TABLE (ID, IMAGE)
    VALUES (DEST_ID, ORDSYS.ORDIMAGE.INIT())
    RETURNING IMAGE INTO IMG;
    IMG.IMPORTFROM(CTX, 'FILE', 'IMAGEDIR', FILENAME);
    UPDATE IMAGE_TABLE SET IMAGE=IMG WHERE ID=DEST_ID;
    END
    CALL IMAGE_IMPORT(7142,'125-0502.pdf');
    CALL IMAGE_IMPORT(7143,'125-0503.pdf');
    SELECT ID,
    T.IMAGE.GETHEIGHT(),
    T.IMAGE.GETWIDTH()
    FROM IMAGE_TABLE T;
    SELECT ID,
    T.IMAGE.GETFILEFORMAT(),
    T.IMAGE.GETCOMPRESSIONFORMAT()
    FROM IMAGE_TABLE T;
    SELECT ID,
    T.IMAGE.GETCONTENTFORMAT(),
    T.IMAGE.GETCONTENTLENGTH()
    FROM IMAGE_TABLE T;

    In the second load_file procedure you should probably change the update command
    -- UPDATE THE BLOB FIELD
    UPDATE PDM
    SET FNAME = SRC_FILE,
    IBLOB = DST_FILE;into this
    -- UPDATE THE BLOB FIELD
    UPDATE PDM
    SET IBLOB = DST_FILE
    WHERE  FNAME = '262-2827.pdf';but I'm not sure how to explain the eof error message. Usually this happens when you forget an "END;" or "END LOOP;" command.
    Ok I rechecked and the declaration of the second procedure seems wrong
    -- CREATE THE PROCEDURE TO LOAD THE FILE
    CREATE OR REPLACE PROCEDURE LOAD_FILE AS (
    SRC_FILE BFILE := BFILENAME('PDF_DIR', '262-2827.pdf');
    DST_FILE BLOB;
    BEGINshould be rewritten as
    -- CREATE THE PROCEDURE TO LOAD THE FILE
    CREATE OR REPLACE PROCEDURE LOAD_FILE
      AS
      SRC_FILE BFILE := BFILENAME('PDF_DIR', '262-2827.pdf');
      DST_FILE BLOB;
    BEGIN
    ...I removed one parenthesis which was not closed.
    And for the image_import procedure there is a semikolon missing after the final END.
    END*;*
    Edited by: Sven W. on Nov 24, 2008 5:54 PM.
    Edited by: Sven W. on Nov 24, 2008 5:56 PM
    Edited by: Sven W. on Nov 24, 2008 5:59 PM

  • Procedure created with compilation errors. help?

    SQL> create or replace procedure p_update_audit_log
    2 ( p_audit_id audit_log.audit_id%type
    3 p_grade_update audit_log.grade_update%type
    4 p_grade audit_log.grade%type
    5 sys_date
    6 p_user_id audit_log.user_id%type
    7 is
    8 BEGIN
    9 insert into audit_log (user_id, audit_id, grade, grade_update,
    10 sys_date)
    11 values (p_user_id, p_audit_id, p_grade, p_grade_update, sys_date);
    12 END p_update_audit_log;
    13
    14
    15
    16
    17
    18 /
    Warning: Procedure created with compilation errors.
    SQL> show errors
    Errors for PROCEDURE P_UPDATE_AUDIT_LOG:
    LINE/COL ERROR
    3/1 PLS-00103: Encountered the symbol "P_GRADE_UPDATE" when expecting
    one of the following:
    := ) , default character
    The symbol "," was substituted for "P_GRADE_UPDATE" to continue.
    4/1 PLS-00103: Encountered the symbol "P_GRADE" when expecting one of
    the following:
    := ) , default character
    The symbol "," was substituted for "P_GRADE" to continue.
    5/1 PLS-00103: Encountered the symbol "SYS_DATE" when expecting one
    LINE/COL ERROR
    of the following:
    := ) , default character
    The symbol ", was inserted before "SYS_DATE" to continue.
    7/1 PLS-00103: Encountered the symbol "IS" when expecting one of the
    following:
    := ) , default character
    The symbol ")" was substituted for "IS" to continue.
    Could anyone help me with this problem?

    These are syntax errors:
    Try this
    create or replace procedure p_update_audit_log
    ( p_audit_id audit_log.audit_id%type,
    p_grade_update audit_log.grade_update%type,
    p_grade audit_log.grade%type,
    sys_date DATE,
    p_user_id audit_log.user_id%type)
    is
    BEGIN
    insert into audit_log (user_id, audit_id, grade, grade_update,
    sys_date)
    values (p_user_id, p_audit_id, p_grade, p_grade_update, sys_date);
    END p_update_audit_log;

  • Procedure created with compilation errors

    I created a procedure and that when I run it in SQLPlus I get this message:
    Warning: Procedure created with compilation errors.
    Where can I go to see what the errors are?

    I tried adding 'show errors' to the end of the procedure but it didn't display any errors. I'm using this script that is for MS SQL and I wanted to see what I would need to change in order for it to work in Oracle:
    Can you tell me where I should put the 'show errors' statmement?
    DROP PROCEDURE      scp_mig_jobs_copy;
    CREATE PROCEDURE scp_mig_jobs_copy
    AS
    ** File Name:
    ** scp_mig_jobs_copy.sql
    ** Procedure Name:
    ** scp_mig_jobs_copy
    ** Description:
    ** This procedure is used to move data from the limited staging table,
    **          scp_mig_jobs, to the full migration table scp_mig_jobs2
    **          It first trunacates the migration table, then copies the data
    ** Saba Version:
    ** SE2005 May release + August patch.
    ** Input Parameter(s):
    **          None
    ** Output Parameter(s):
    ** None
    ** Return Codes:
    **          None.
    ** Error Codes:
    ** None.
    ** Calling Procedure(s):
    ** Procedures Called:
    **          None.
    ** Database Table(s) Accessed:
    **          sct_mig_jobs
    **          sct_mig_jobs2
    ** Database View(s) Accessed:
    **          None.
    ** Cursor(s):
    **          None.
    ** Misc:
    BEGIN
    DECLARE @xerror     NUMBER;
    PRINT '**************************************************';
    PRINT 'Begin Copying data from the staging table, sct_mig_jobs, to the migration table, sct_mig_jobs2';
    PRINT getDate();
    PRINT ' '
    BEGIN TRAN
    TRUNCATE TABLE sct_mig_jobs2
    INSERT INTO sct_mig_jobs2 (
    name, description, custom0, custom1, --These are the only fields that the staging table has
    id, CI_Name
    created_by, created_on,
    updated_by, updated_on,
    split,
    custom2, custom3, custom4, custom5, custom6, custom7, custom8, custom9,
    process_ind, process_date, valid_rec_ind, rec_status, err_num, err_msg
    SELECT name, description, custom0, custom1, --These are the only fields that the staging table has
    NULL id,
         NULL CI_Name,
    NULL created_by, NULL created_on,
    NULL updated_by, NULL updated_on,
    NULL split,
    NULL custom2, NULL custom3, NULL custom4, NULL custom5, NULL custom6, NULL custom7, NULL custom8, NULL custom9,
    NULL process_ind, NULL process_date, NULL valid_rec_ind, NULL rec_status, NULL err_num, NULL err_msg
    FROM sct_mig_jobs
    SET @xerror = @@error;
    IF(@xerror<>0)
    BEGIN
    ROLLBACK TRAN;
    PRINT 'Error:: ' + STR(@xerror);
    PRINT '--Unable to copy data from the staging table to the migration table';
    END
    ELSE
    BEGIN
    COMMIT TRAN;
    PRINT 'Data successfully copied from the staging table to the migration table';
    END
    PRINT ' ';
    PRINT ' ';
    END
    /

  • Warning: Type created with compilation errors. sql : oracle 11gr2

    I'm trying to create a supertype customer service and subtype agent and supervisor, so they can inherent values however when I try to run this in oracle sql: a message comes up
    Warning: Type created with compilation errors.
    What is wrong with the code below?
    Create or replace type customer_s_type as object ( csID number, csName varchar(15), csType number ) NOT FINAL;  Create or replace type supervisor_type UNDER customer_s_type ( title varchar (10) );  Create or replace type agent_type UNDER customer_s_type (title varchar (10));  Create table supervisor of supervisor_type ( CONSTRAINT supervisor_PK PRIMARY KEY (csID));  Create table agent of agent_type (CONSTRAINT agent_PK PRIMARY KEY (csID));  create table customer_service( csID number(10), csType number(10), constraint supervisor_pk primary key(csID) );

    Wile creating TYPE you need to terminate with a back slash (/) semi colon does not work.
    Try like this
    create or replace type customer_s_type as object ( csid number, csname varchar(15), cstype number ) not final
    create or replace type supervisor_type under customer_s_type ( title varchar (10) )
    create or replace type agent_type under customer_s_type (title varchar (10))

  • Warning: Function created with compilation errors. ???

    I created a function with a warning:
    Warning: Function created with compilation errors.
    I'd like to know more detailed information about this warning, how to find them?
    If only with this warning, I don't know how to correct the definition of the function.
    BTW, because it is a warning, I just try to run the sql stmt which will call this function:
    SQL> select strdiff(ename, 'FOR') from emp;
    select strdiff(ename, 'FOR') from emp
    ERROR at line 1:
    ORA-06575: Package or function STRDIFF is in an invalid state.
    /* strdiff is the name of function */
    Thanks in advance!

    Hi,
    I think that your posting may be more suited to the PL/SQL forum.
    after the function is created with errors you should try the command:
    show err
    or
    show errors
    this should at least give you some idea of what is wrong.
    regards Michael

  • Simple Java created with compilation errors.

    Hi,
    While I am using Oracle for many years (currently 9.2.0.6.0) I am completely new to Java in the database.
    I found a very simple example to get started (please see SQL*Plus dump below) ... but I get a compilation error. Can anyone tell what I am doing wrong?
    SQL> CREATE OR REPLACE AND COMPILE JAVA SOURCE NAMED Fibonacci AS
    2 public class Fibonacci
    3 {
    4 public static int fib (int n)
    5 {
    6 if (n == 1 || n == 2)
    7 return 1;
    8 else
    9 return fib(n - 1) + fib(n - 2);
    10 }
    11 }
    12 /
    Warning: Java created with compilation errors.
    SQL> show errors java source Fibonacci
    No errors.
    SQL>
    (It must be a simple thing, the example I found seems correct, but what about grants, settings etc.)
    Thanks in advance,
    Stefan

    Stefan,
    I cannot see anything in your code that would cause a compilation error. However, according to the example in the "Oracle 9i SQL Reference", it looks like you need to enclose the name in double quotes, as in:
    CREATE OR REPLACE AND COMPILE JAVA SOURCE NAMED "Fibonacci" AS ...Alternatively (and this is the way I do it), you could compile the class outside of the database, and load the compiled class file. Just create a file called "Fibonacci.java" (that contains your java code), compile it, and then use the "loadjava" tool to load the "Fibonacci.class" file into the database. Please refer to the Oracle 9i Java Developer's Guide for more details.
    Good Luck,
    Avi.

  • Warning: Library created with compilation errors.

    I am trying to run the following in SQLPlus logged in as
    Portal30_SSO on the portal database server:
    create or replace library auth_ext as 'C:\oracle\ora81
    \bin\ssoxldap.dll';
    commit;
    When I run this it gives me the error:
    Warning: Library created with compilation errors.
    I am following the instructions from "Configuring Oracle9iAS
    Portal for LDAP Authentication". I am running Oracle 8.1.7 and
    OID on one W2K server and 9iAS on another W2K server. Any
    suggestions on how to resolve this problem?

    Is there any solution about how to compile XDB.DBMS_XDBUTIL_INT package?
    My XDB.DBMS_XDBUTIL_INT package gives the following error when compiled:
    How can I recreate "XDB.DBMS_XDBUTIL_INT". Currently it does not compile, giving error :
    LINE/COL ERROR
    33/7 PL/SQL: SQL Statement ignored
    34/14 PL/SQL: ORA-00942: table or view does not exist

  • First package - created with compilation errors

    I'm working my way through Learning Oracle PL/SQL, the O'Reilly book, the 2002 edition, page 92. These procedures work fine stand-alone but when one calls the other, when mxb_add_books calls mxb_add_book_copy, in a package I get compilation errors:
    Create or replace package mxb_book
    As
    procedure mxb_add_book_copy (isbn_in in varchar2, barcode_ID_in in varchar2);
    procedure mxb_add_books (isbn_in in varchar2, barcode_ID_in in varchar2, title_in in varchar2,
    author_in in varchar2, page_count_in in number, summary_in in varchar2 default null, date_published_in in date default null);
    end mxb_book;
    create or replace package body mxb_book
    as
    /* private procedure for use only in this package body */
    Procedure assert_notnull (tested_variable in varchar2)
    Is begin
    If tested_variable is null
    Then
    Raise value_error;
    End if;
    End assert_notnull;
    procedure mxb_add_book_copy (isbn_in in varchar2, barcode_ID_in in varchar2)
    is
    begin
    assert_notnull(isbn_in);
    assert_notnull(barcode_id_in);
    insert into MXB_book_copies_TEMP(isbn,barcode_id)
    values (isbn_in, barcode_id_in);
    exception
    when dup_val_on_index
    then
    null;
    end mxb_add_book_copy;
    End;
    procedure mxb_add_books (isbn_in in varchar2, barcode_ID_in in varchar2, title_in in varchar2,
    author_in in varchar2, page_count_in in number, summary_in in varchar2 default null, date_published_in in date default null)
    as
    begin
    /* check for reasonable inputs */
    if isbn_in is null then
    raise value_error;
    end if;
    /* put a record in the "books" table */
    insert into MXB_books_TEMP(isbn, title, summary, author, date_published, page_count)
    values (isbn_in,title_in, summary_in, author_in, date_published_in, page_count_in);
    /* if supplied, put a record in the "book_copies" table */
    if barcode_id_in is not null
    then
    mxb_add_book_copy (isbn_in, barcode_ID_in)
    end if;
    end mxb_add_books;
    end mxb_book;

    welcome to the forum.
    please read this to improve your posts:
    SQL and PL/SQL FAQ
    *[edit]*
    --you're missing a ; before your last end if and <tt>END mxb_book; </tt> in the last line should be <tt>END mxb_book_body;</tt>.--
    There is an additional <tt>end;</tt> after <tt> END mxb_add_book_copy;</tt> and the missing ; before your last end if .
    bye
    TPD
    Edited by: T.PD on 14.12.2011 18:13

  • Why does plsql give compilation error for select statement?

    When I run following plsql program, it gives compilation error. Could somebody please point me out what could be wrong here? I am running it from system user.
    create or replace procedure drop_user_proc (iname in varchar2) is
    uname varchar2(100);
    begin
    select username into uname from dba_users where username = upper(iname);
    end drop_user_proc;
    select username from dba_users where username = upper('newuser');
    When I run it, I get following error. dba_users is there that is the reason it works outside plsql block, but it doesn't from inside block.
    SQL> @t4
    Warning: Procedure created with compilation errors.
    USERNAME
    NEWUSER
    SQL> show err
    Errors for PROCEDURE DROP_USER_PROC:
    LINE/COL ERROR
    4/3 PL/SQL: SQL Statement ignored
    4/35 PL/SQL: ORA-00942: table or view does not exist

    Role based grants are not available within the stored procedures.
    Only explicit grants are recognized when compiling stored code.
    You need to grant select on that table to the user where you are creating this procedure.

  • ILM First Time Installation Fails with compilation errors

    I am using database version 10.1.0.4.2, and Apex version 3.0.0.00.20,
    These both are on the same machine.
    I login with sqlplus as sysdba and run
    @ilma_install apex sysaux none
    Following happens after running it:
    - It runs for a while creating different objects
    - then gives warning : view created with compilation error
    - then gives warning : view created with compilation error
    - then gives warning : view created with compilation error
    - then runs for a while
    - then gives error Package body created with compilation errors
    Errors for package body ILM_SYS_TOOLKIT
    Line/col Error
    1646/3 PLSQL: SQL Statement Ignored
    1647/22 PLS-009050 : Object ILM_Toolkit.ILM_Schedular_Steps is invalid
    Then the installation terminates.
    Please help.
    regards

    I am sorry to hear that you are still having difficulties with the installation. I set up a system that is as close to your configuration as I could replicate, with a 10gR1 database and Apex 3.0, and did not have any issue installing the ILM Assistant.
    It is possible that your install kit may have been corrupted during the modifications. I could build a new kit with the proper changes for your setup and send this directly to you if you would like.
    Alternatively, the problem may be with your Application Express installation. Try to verify that this was installed properly, and that the underlying schema account (FLOWS_030000) is unlocked and that you are using its proper password when installing ILM.
    Thanks,
    Adam

  • ORA-24344: success with compilation error While creating workspace

    Hi,
    We had an instance with db 9.2.0.5 and HTML DB 1.56.
    First we upgraded database to to 10.1.0.4.Then we upgraded HTML DB to 1.6.1(Upgraded html db 1.5 to 1.6, Then applied patch 1.6.1 patch - 4173133)
    Logged to the HTML DB as an administrator for creating application developer's workspace. I have got the error "ORA-24344: success with compilation error" while creating the workspace.
    We are able to create the workspace successfully on HTML DB 1.5.
    Any help is highly appreciated.
    Thanks, Venkanna

    Venkanna - Do you think the workspace creation was at least partly successful? I mean, can you login to it, can you see anything about it in the admin app, etc.? It would be useful to get a list of invalid objects in the new workspace's schema. If there are none, then get a list of invalid objects in FLOWS_010600.
    Scott

  • "success with compilation error" ?

    Hopefully someone can shed light on this. Here is the sample code...
    SQL> create or replace procedure pr_TEST
    2 as
    3 begin
    4 execute immediate 'create or replace trigger tr_test after insert or update or delete on test
    for each row declare v_row test%rowtype; v_col1 varchar(32); v_col2 varchar(32); v_work varchar(32)
    ; begin insert into test values (v_col1, v_col2) ;end; /';
    5
    6 end;
    7 /
    Procedure created.
    SQL> exec pr_test;
    ERROR:
    ORA-24344: success with compilation error
    ORA-06512: at "ROOT.PR_TEST", line 4
    ORA-06512: at line 1
    Have you ever heard of an ORA-24344 ? Any suggestions on what to correct ?
    thx in advance,
    RP.

    You don't want the slash at the end of the string:
    sql>create or replace procedure pr_test
      2  as
      3  begin
      4   execute immediate 'create or replace trigger tr_test after insert or update or delete on test
      5  for each row declare v_row test%rowtype; v_col1 varchar(32); v_col2 varchar(32); v_work varchar
    (32);
      6   begin insert into test values (v_col1, v_col2) ;end;';  -- no slash here at end
      7  end;
      8  /
    Procedure created.

  • ORA-24344: Success with compilation error.

    Hi, i got the following error notification mail when the DB job [runs only once in a day at 1 AM] tries to execute the following procedure.
    The mail reads like this ----
    "Condition Raised in: toll_partitions.recompile_invalid_objects
    Short Desc: ORA-24344
    Long Desc: ORA-24344: Success with compilation error.
    Cause: Trigger creation did not successfully complete.
    Solution: Check trigger status for all triggers created in this schema and find out which error caused the failure by querying the user_errors table for the named trigger and Trigger type.
    --- end of mail ----
    === This is the procedure =====
    PROCEDURE recompile_invalid_objects IS
    -- Declare variables
    v_ins_str VARCHAR2(2000);
    cursor_handle NUMBER;
    execute_feedback NUMBER;
    v_unix_str VARCHAR2(200);
         v_object_cnt NUMBER := 0;
         -- Declare cursor objects
         CURSOR curs_obj IS
    SELECT decode( OBJECT_TYPE, 'PACKAGE BODY',
    'ALTER PACKAGE ' || OWNER||'.'||OBJECT_NAME || ' COMPILE BODY',
    'ALTER ' || OBJECT_TYPE || ' ' || OWNER||'.'||OBJECT_NAME || ' COMPILE' )
                   "COMP_OBJECT"
    FROM dba_objects
    WHERE STATUS = 'INVALID'
    AND OBJECT_TYPE IN ( 'PACKAGE BODY', 'PACKAGE', 'FUNCTION', 'PROCEDURE',
              'TRIGGER', 'VIEW' )
    AND OWNER = USER
              AND OBJECT_NAME NOT LIKE 'TOAD_PROFILER'
    ORDER BY OWNER, OBJECT_TYPE, OBJECT_NAME;
    BEGIN
         -- Set Package/Procedure Name for email notification.
         vFacility := cProcName || '.recompile_invalid_objects';
    -- Select invalid object count
    BEGIN
         SELECT count(*)
              INTO v_object_cnt
              FROM dba_objects
    WHERE STATUS = 'INVALID'
    AND OBJECT_TYPE IN ( 'PACKAGE BODY', 'PACKAGE', 'FUNCTION', 'PROCEDURE',
              'TRIGGER', 'VIEW' )
    AND OWNER = USER
                   AND OBJECT_NAME NOT LIKE 'TOAD_PROFILER'
    ORDER BY OWNER, OBJECT_TYPE, OBJECT_NAME;
              -- Recompile invalid objects
              IF v_object_cnt > 0 THEN
              FOR i in curs_obj
                   LOOP
                   v_ins_str := i.COMP_OBJECT;
                        cursor_handle := DBMS_SQL.OPEN_CURSOR;
    DBMS_SQL.PARSE(cursor_handle,
         v_ins_str,
                   DBMS_SQL.V7);
    execute_feedback := DBMS_SQL.EXECUTE(cursor_handle);          
    DBMS_SQL.CLOSE_CURSOR(cursor_handle);
    COMMIT;
                   END LOOP;
              END IF;
    END;
    EXCEPTION
         WHEN OTHERS THEN
         -- Log error condition and generate email notification if needed.
    toll_handle.error_condition(vFacility, toll_handle.get_ora_desc(sqlerrm),vErrorID);
         END recompile_invalid_objects;
    ==== end of procedure ====
    I got '0' count when I ran the invalid object count to see the invalid objects. I ran the following code ..and it gave me 0 value.
    SELECT count(*)
              FROM dba_objects
    WHERE STATUS = 'INVALID'
    AND OBJECT_TYPE IN ( 'PACKAGE BODY', 'PACKAGE', 'FUNCTION', 'PROCEDURE',
              'TRIGGER', 'VIEW' )
    AND OWNER = USER
                   AND OBJECT_NAME NOT LIKE 'TOAD_PROFILER'
    ORDER BY OWNER, OBJECT_TYPE, OBJECT_NAME;
    --- end of query ---
    The count 0 means, there are no invalid objects. But it throws daily the same error notification mail at 1 AM[the time job runs]. I compiled the procedure and it reports no errors. I checked the status of the triggers and all are valid and enabled. Please suggest me. Any help in this regard will be of great help to me. Thanks in advance...

    Just some hints. I'm not sure if they help solving your problem.
    1) Don't COMMIT inside a cursor.
    2) Instead of DBMS_SQL you could use DBMS_DDL.ALTER_COMPILE, also see here: http://download.oracle.com/docs/cd/B10501_01/appdev.920/a96612/d_ddl2.htm#1000604
    3) Check if there are other jobs running during the recompile. Maybe you run into some conflicts.
    4) Output the statement that creates the error. It looks like you could try to put this into your exception handler: toll_handle.error_condition(vFacility, v_ins_str,vErrorID);

  • "ORA-24344: success with compilation error" in beginDDL

    Hello,
    I'm facing a really strange problem. When i try to use dbms_wm.beginDDL in one of my versioned tables, i get the error:
    ORA-24344: success with compilation error
    ORA-06512: "WMSYS.LT", line 12178
    ORA-06512: line 2
    I just get the error if i run the procedure from SQLPlus.
    Using PLSQL Developer, for example, I get a normal execution but the LTS table it's not created and the state of the table stays 'VERSIONED'.
    I used this procedure other times in the past and there were no problems.
    Trying to identify the cause of the error, i've tried:
    (1) - run dbms_wm.beginDDL for all the other tables - No Problem
    (2) - verifiy if there were invalid objects - All valid
    (3) - verify the error tables for more details (user_, dba_, user_wm_vt_) - No entries
    (4) - generate a trace file, to search for abnormal executions - Apparently nothing really strange (but obviously I don't know what was supposed to happen)
    Any possible reasons for this to happen?
    Any ideas?
    Some help would be welcome.
    Best regards,
    Pedro Lourenço

    Hi Noel,
    I just found the problem...
    I have a trigger defined on the table that uses a synonym for another user table.
    That synomym was dropped, so the trigger was invalid.
    I didn't notice the problem because the trigger was disabled, so the WM$ procedure wasn't being generated, and there were no "visible errors".
    Recreating the synomyn, the problem was solved.
    Thanks for your help!
    Regards,
    Pedro Lourenço

Maybe you are looking for