Trigger with ORA-24344: success with compilation error

can someone tell me what I am doing wrong, here is the code.

DECLARE
FUNCTIE2 VARCHAR2 (40);

FOR EACH LINE
BEGIN
FUNCTIE2: = UPPER(:new.) FUNCTION);

IF FUNCTIE2 = 'MANAGER' THEN
Update of GEBRUIKER SET RECHTEN_ID = 3 WHERE GEBRUIKER. MEDEWERKERS_ID = OWNED. MEDEWERKER_ID;
END IF;

IF FUNCTIE2 = "JUNIOR LEGAL" THEN
Update of GEBRUIKER SET RECHTEN_ID = 1 WHERE GEBRUIKER. MEDEWERKERS_ID = OWNED. MEDEWERKER_ID;
END IF;

IF FUNCTIE2 = "SENIOR LEGAL" THEN
Update of GEBRUIKER SET RECHTEN_ID = 2 WHERE GEBRUIKER. MEDEWERKERS_ID = OWNED. MEDEWERKER_ID;
END IF;
END;

Jorik

Then it seems that guess Michaels was correct. I guess that ORDER. MEDEWERKER_ID's MEDEWERKER_ID column value in the insert statement that triggers, right? Then, you must use refrence to be inserted value: NEW variable binding:

CREATE
OR REPLACE TRIGGER MEDEWERKER_TRIGGER BEFORE INSERT ON MEDEWERKER FOR EACH ROW
BEGIN
IF UPPER(:NEW.FUNCTIE) = 'MANAGER' THEN
     UPDATE GEBRUIKER
SET RECHTEN_ID = 3
WHERE
     GEBRUIKER.MEDEWERKERS_ID = :NEW.MEDEWERKER_ID ;
END
IF ;
IF UPPER(:NEW.FUNCTIE) = 'JUNIOR MEDEWERKER' THEN
     UPDATE GEBRUIKER
SET RECHTEN_ID = 1
WHERE
     GEBRUIKER.MEDEWERKERS_ID = :NEW.MEDEWERKER_ID ;
END
IF ;
IF UPPER(:NEW.FUNCTIE) = 'SENIOR MEDEWERKER' THEN
     UPDATE GEBRUIKER
SET RECHTEN_ID = 2
WHERE
     GEBRUIKER.MEDEWERKERS_ID = :NEW.MEDEWERKER_ID ;
END
IF ;
END ;

SY.

Tags: Database

Similar Questions

  • Java, created with compilation errors

    Hi all

    I created below compiles and source of java, I get "Java created with compilation errors.

    I gave JAVAUSERPRIV to my user.

    Pls help to solve this problem. Thank you

    CREATE OR REPLACE AND COMPILE JAVA NAMED 'DirList' AS SOURCES

    import java. IO;

    import JAVA. SQL.*;

    public class DirList

    {

    public static getList (String directory) Sub throws SQLException

    {

    Path = new file (directory);

    String [] List = path. List();

    Element string;

    for (int i = 0; i < List.Length; i ++)

    {

    item = list [i];

    #sql {INSERT INTO dir_list (FILENAME) VALUES (: element)};

    }

    }

    }

    /

    ATTENTION: Java created with compilation errors.

    SQL > show errors
    Errors of JAVA SOURCE 'DirList ':

    LINE/COL ERROR
    -------- -----------------------------------------------------------------
    0/0 DirList:5: cannot find symbol
    4 0/0 errors
    0/0 location: DirList, class
    0/0 public static void GetList (String directory) throws SQLException
    0/0      ^
    0/0 DirList:7: cannot find symbol
    0/0 symbol: class file
    0/0 location: DirList, class
    The 0/0 file = new file (directory);
    0/0      ^
    0/0 DirList:7: cannot find symbol

    LINE/COL ERROR
    -------- -----------------------------------------------------------------
    0/0 symbol: class file
    0/0 location: DirList, class
    The 0/0 file = new file (directory);
    0/0      ^
    0/0 DirList:10: cannot find symbol
    0/0 symbol: variable length
    [0/0 location: class java.lang.String]
    0/0 for (int i = 0; i < List.Length; i ++)
    0/0      ^
    0/0 symbol: SQLException, class
    SQL > alter the compilation of java class 'DirList ';

    ATTENTION: Java modified with compilation errors.

    SQL > alter the compilation of java class 'DirList ';

    ATTENTION: Java modified with compilation errors.

    SQL > show errors
    Errors of JAVA 'DirList ': CLASS

    LINE/COL ERROR
    -------- -----------------------------------------------------------------
    0/0 ORA-29535: source requires recompilation
    SQL > alter the compilation of java class 'DirList ';

    ATTENTION: Java modified with compilation errors.

    SQL > show errors
    Errors of JAVA 'DirList ': CLASS

    LINE/COL ERROR
    -------- -----------------------------------------------------------------
    0/0 ORA-29535: source requires recompilation

    You really seem to have a problem with spelling and case sensitivity.

    Look at the definition of the function:

    create or replace procedure get_dir_list (p_dir in varchar2) as language java name 'DirList.getList (java.long.string);

    It should be:

    java.lang.String

  • CAUTION: Procedure created with compilation errors.

    HI, I created a table:

    CREATE TABLE:

    create table customer (name varchar2 (10), varchar (40) of the address, Contact number);

    CREATE THE PROCEDURE TO INSERT:

    CREATE OR REPLACE PROCEDURE SP_CUSTOMER)

    p_name customer. Name% TYPE,

    customer p_address. Address TYPE %,

    customer p_contact. Contact TYPE %)

    IS

    BEGIN

    INSERT INTO customer ('name', 'Address', 'Contact')

    VALUES (p_name, p_address, p_contact);

    COMMIT;

    END;

    /

    ERROR:

    IT SHOWS: WARNING: procedure created with compilation errors.

    CREATE THE PROCEDURE TO SELECT:


    CREATE OR REPLACE PROCEDURE SP_SELECT_CUSTOMER)

    p_name customer. Name% TYPE,

    customer p_address. Address TYPE %,

    customer p_contact. Contact TYPE %)

    IS

    BEGIN

    SELECT name, address, Contact WITH THE customer;

    END;

    /

    ERROR:

    IT SHOWS: WARNING: procedure created with compilation errors.

    What is the problem. ? How to solve it. ?

    CREATE OR REPLACE PROCEDURE SP_CUSTOMER (
    p_name customer.Name%TYPE,
    p_address customer.Address%TYPE,
    p_contact customer.Contact%TYPE)
    IS
    BEGIN
    INSERT INTO customer (Name, Address, Contact)
    VALUES (p_name, p_address, p_contact);
    COMMIT;
    END;
    /

    CREATE OR REPLACE PROCEDURE SP_SELECT_CUSTOMER (
    p_cust_details OUT SYS_REFCURSOR)
    IS
    BEGIN
    OPEN p_cust_details for SELECT Name, Address, Contact FROM customer;
    END;
    /

  • WARNING: Type created with compilation errors. SQL: oracle 11 g 2

    I am creating a client of agent service and subtype-supertype and supervisor, so that they can the intrinsic values, however when I try to run it in oracle sql: a message appears

    Warning: Type created with compilation errors.

    What is the problem 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 creation TYPE you need to end with a backslash (/) semi colon does not work.

    Try like this

    create or replace type customer_s_type as an 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))

    /

  • Procedure created with compilation errors

    Here is the procedure I created when I run im getting 'Procedure created with compilation errors' I do not understand where I have error in code in the procedure below, someone help me conclude to an error in the code.


    create or replace PROCEDURE newprocedur (inMerid IN VARCHAR2, outCount OUT NUMBER) AS
    CURSOR c1 IS
    Select CLIENT_COUNT in the OP_TMER_CONF_PARENT where MER_ID = inMerid for an updated VERSION OF the CLIENT_COUNT;
    BEGIN
    Open c1
    loop
    Fetch c1 in outCount;
    When exit c1% NOTFOUND;
    outCount: = outCount + 1;
    Update OP_TMER_CONF_PARENT set CLIENT_COUNT = outCount the location being the c1;
    end loop;
    Close c1;
    END;

    Hello

    you're missing the semicolon after c1 open:

      BEGIN
       Open c1     <==== ; extra needed
       loop
       fetch c1 into outCount;
    

    Herald tiomela
    http://htendam.WordPress.com

  • Can I use the packages with compilation errors

    Hello

    I try to use procedures in a package that includes compilation errors. I wonder whether the remaining procedures within this package is usable or not?

    Or is there a way to only compile the correct procedure within this package?

    Thank you very much

    Murat

    user13795669 wrote:
    Not even Possible, I use execute commands as below

    run immediately "@/ var/mcp/loadUtlPkg.sql';" or with another way?

    No, you can not use as you wrote.
    @ - is a special, synonymous with start , sign command SQL * more.
    You cannot use it with the PL/SQL constructor.

    The only way that you can use the body to package not valid with valid package spec - compile another package, dependent on the subject. Not running - compile.

  • Code of the trigger with the error table mutation

    I have 2 tables, cc_call_lists and cc_call_issues. I have a trigger on the table of cc_call_issues so that when the priority is updated I can determine how to set Issue_Priority.

    Basically, the priority update for an Issue_Id I need to update the I want to watch Issue_ids of all the participating on the cc_call_lists table and determine how to update the Issue_Priority column.

    Issue_Priority must always be the first priority of the table cc_call_issues for Issue_id records in the cc_call_lists table. So when I need to watch all changes priority priority values for which the Participant has records in the cc_call_lists table and take the max value priority after the record is updated.

    Unfortunately, I get the following error message when the trigger is activated:

    ORA-04091: table TTMS. CC_CALL_ISSUES is changing, function of triggering/can not see
    ORA-06512: at «TTMS.» UPDATEISSUEPRIORITY', line 30
    ORA-04088: error during execution of trigger ' TTMS. UPDATEISSUEPRIORITY'

    Is there a work around which is not too complicated? Any help would be greatly appreciated.


    Table: cc_call_lists
    Name
    -----------------
    PARTICIPANT_TYPE
    PARTICIPANT_ID
    LAST_ACCESS_DT
    LAST_ACCESS_BY
    CREATE_DT
    CREATE_BY
    MODIFY_DT
    MODIFY_BY
    CALL_STATUS
    CALL_PRIORITY


    Table: cc_call_issues
    Name
    -----------------
    ISSUE_ID
    ISSUE_DESCR
    DEACTIVATION_DT
    PRIORITY
    CREATE_DT
    CREATE_BY
    MODIFY_DT
    MODIFY_BY

    Trigger on cc_call_issues code:
    CREATE OR REPLACE TRIGGER TTMS.UpdateIssuePriority
    BEFORE UPDATE
    OF PRIORITY
    ON TTMS.CC_CALL_ISSUES 
    REFERENCING NEW AS New OLD AS Old
    FOR EACH ROW
    DECLARE
    tmpMaxPriority number:=0;
    
    -- Get list of all participants call queue records, existing priority who also have a participant issue record with this issue code
    cursor c1 is
    select a.participant_id, a.call_priority
    from cc_call_lists a, cc_participant_issues b
    where 
      a.participant_id = b.participant_id
      and b.issue_id = :new.issue_id
      and b.issue_status = '001'
      and a.call_status <> '003';  -- Not closed already
    
    BEGIN
        for thisone in c1 loop
                -- Get the existing highest priority
                select nvl(max(b.priority),0)
                into tmpMaxPriority
                from cc_participant_issues a, cc_call_issues b
                where
                  a.issue_id = b.issue_id and
                  a.participant_id = thisone.participant_id;
                  
                -- Update it if the new priority value is higher than the existing call queue record priority
                if :new.priority > tmpMaxPriority then
                        update cc_call_lists
                        set call_priority = :new.priority
                        where participant_id = thisone.participant_id; 
                elsif :new.priority < tmpMaxPriority then
                        update cc_call_lists
                        set call_priority = tmpMaxPriority
                        where participant_id = thisone.participant_id; 
                end if;
        end loop;
    END UpdateIssuePriority;
    /

    Move the level of LINE at the STATEMENT level triggers, see:
    http://www.Oracle-base.com/articles/9i/mutating-table-exceptions.php
    http://asktom.Oracle.com/pls/asktom/asktom.download_file?p_file=6551198119097816936

  • Procedure created with compilation error

    Hello

    I am troubleshooting the following procedure created using schema DBCC_CLG:

    CREATE OR REPLACE PROCEDURE p_CLGtrnCols_i_FStgByHoDbName)

    v_Database_Name IN NVARCHAR2 DEFAULT NULL,

    v_Hostname IN NVARCHAR2 DEFAULT NULL)

    -v_input1 IN NVARCHAR2 DEFAULT NULL)

    AS

    BEGIN

    DELETE FROM tt_tmp;

    UTILS. IDENTITY_RESET ('tt_tmp');

    -v_input1: = "tt_tmp";

    -UTILS. IDENTITY_RESET (v_input1);

    INSERT

    IN tt_tmp

    (SELECT DISTINCT S.Database_Name,

    S.PROCEDURE_NAME,

    S.Column_Name,

    S.Data_Type,

    S.Max_Length,

    S.Ordinal_Position,

    Max (S.DateProcColumnGenerated) DateProcColumnGenerated,

    S.ResultSet

    OF CLGReturnColumns_Stage S

    LEFT JOIN CLGReturnColumns C

    ON C.Database_Name = S.Database_Name

    AND C.PROCEDURE_NAME = S.PROCEDURE_NAME

    AND C.Column_Name = S.Column_Name

    AND C.Data_Type = S.Data_Type

    WHERE S.Database_Name = v_Database_Name

    AND S.Hostname = v_Hostname

    AND C.PROCEDURE_NAME IS NULL

    S.Database_Name GROUP,

    S.PROCEDURE_NAME,

    S.Column_Name,

    S.Data_Type,

    S.Max_Length,

    S.Ordinal_Position,

    S.ResultSet

    );

    -BEGIN

    BEGIN

    INSERT

    IN CLGReturnColumns

    (

    Database_name,

    PROCEDURE_NAME,

    Column_Name,

    Data_Type,

    Max_Length,

    Ordinal_Position,

    DateProcColumnGenerated,

    ResultSet

    )

    (SELECT DISTINCT S.Database_Name,

    S.PROCEDURE_NAME,

    S.Column_Name,

    S.Data_Type,

    S.Max_Length,

    S.Ordinal_Position,

    SYSDATE DateProcColumnGenerated,

    S.ResultSet

    OF tt_tmp S

    );

    END;

    -EXCEPTION

    -WHILE OTHERS THEN

    -END;

    -do nothing

    p_CLGRtrnCols_Stg_d_byHoDBName (v_Hostname, v_Database_Name);

    END;

    Here are the errors:

    8/3 PL/SQL: statement ignored

    8/3 PLS-00201: identifier ' UTILS. IDENTITY_RESET' must be declared

    67/3 PL/SQL: statement ignored

    67/3 PLS-00221: 'P_CLGRTRNCOLS_STG_D_BYHODBNAME' is not a procedure or

    is not defined

    DBCC_CLG has already received the privilege to Execute on Utils.

    SQL > select object_name, object_type, status, owner of dba_objects where object_name = "UTILS."

    UTILS PACKAGE VALID EMULATION

    EMULATION VALID UTILS PACKAGE BODY

    (This script was executed earlier, before the creation of the procedure)

    SQL > GRANT EXECUTE, DEBUG ON "EMULATION". "' UTILS ' TO 'DBCC_CLG' WITH THE OPTION GRANT.

    Grant succeeded.

    And P_CLGRTRNCOLS_STG_D_BYHODBNAME is exist for the schema DBCC_CLG.

    SQL > select object_name, object_type, status, owner of dba_objects where object_name = 'P_CLGRTRNCOLS_STG_D_BYHODBNAME' and owner = 'DBCC_CLG ';

    DBCC_CLG P_CLGRTRNCOLS_STG_D_BYHODBNAME VALID FUNCTION

    Your advice is much appreciated.

    Kind regards

    Ballanger

    You have granted access to the procedure but did not say your code where it is.

    Try emulation.utils.identity_reset.

    In addition, P_CLGRTRNCOLS_STG_D_BYHODBNAME is a function. you try to call it as a procedure.

    It returns a value if you need

    MyVar: = p_CLGRtrnCols_Stg_d_byHoDBName (v_Hostname, v_Database_Name);

  • "WARNING: compiled, but with compilation errors" when executing procedure.

    Hi all, I am so new plsql. This code has been compiled, but there was a warning. I guess that I'm missing a small question as semicolon but since im new I couldn't see what is the problem.

    CREATE or REPLACE procedure BAKIM.grantt_uguser as

    cursor synn is

    Select 'CREATE a PUBLIC SYNONYM' | object_name |' for '. owner: '. ' || object_name dba_objects TXT

    where owner = 'DS' and object_type in ('INDEX', 'PROCEDURE', 'TABLE', 'FUNCTION', 'SEE', 'TRIGGER', 'SEQUENCE', 'PACKAGE')

    and

    object_name not in (select table_name from dba_synonyms where owner = "FCY");

    Start

    for li in synn

    loop

    immediately run li. TXT;

    end loop;

    end;

    /

    Right.  When you use SQL, you privileges through roles are available.  When PL/SQL is running, your own roles aren't usually in fact, if we were to be granted directly to the owner of the stored procedure privileges on objects (there are few exceptions to this, but do not worry for this discussion).

  • DB trigger compile errors

    Hello

    I need AFTER THAT INSERT ON WH_I_ITEMS not null values between 2 inserted in WH_TRANSACTIONS

    CREATE OR REPLACE TRIGGER  TRANSACTIONS_INSERT
    AFTER INSERT ON WH_I_ITEMS
    REFERENCING NEW AS NEWS OLD AS OLDS
     
    FOR EACH ROW
    BEGIN
         INSERT INTO WH_TRANSACTIONS  VALUES (
      :NEWS.STORE_ID                        := :OLDS.STORE_ID  ,
      :NEWS.TRANSACTION_SERIAL      := :OLDS.TRANSACTION_SERIAL +1,
      :NEWS.TYPE_ID                          := 9 ,
      :NEWS.TRANSACT_NUMBER          = 1,
      :NEWS.TRANSACT_DATE              :=   SYSDATE );
    END;
    /
    WARNING: Trigger created with compilation errors.
    SQL> SHOW ERRORS
    Errors for TRIGGER TRANSACTIONS_INSERT:
     
    LINE/COL ERROR
    -------- ----------------------------------------------------------------
    2/6      PL/SQL: SQL Statement ignored
    3/33     PL/SQL: ORA-01745: invalid host/bind variable name
    4/3      PLS-00049: bad bind variable 'NEWS.TRANSACTION_SERIAL'
    4/36     PLS-00049: bad bind variable 'OLDS.TRANSACTION_SERIAL'
    5/3      PLS-00049: bad bind variable 'NEWS.TYPE_ID'
    6/3      PLS-00049: bad bind variable 'NEWS.TRANSACT_NUMBER'
    7/1      PLS-00049: bad bind variable 'NEWS.TRANSACT_DATE'
    Kind regards

    Abdetu...

    Your syntax in the manual is incorrect, it should be something like

    INSERT INTO WH_TRANSACTIONS VALUES (
      :OLDS.STORE_ID,
      col2,
      ..
    );
    
  • where to see the compile error

    Hello
    on 10 gR2, I created a trigger and received after WARNING:
    Warning: Trigger created with compilation errors.
    Where can I see the compile error?

    Thank you.

    Dear Sir

    Question displays the error message; SQL command more. You will get the error message.

    Kind regards
    Srikanth

  • Compile error: sys.v$ sess_time_model table or view does not exist

    If I create the following procedure with DB link to lnk database (Oracle 10.2.0.4, Solaris)

    create or replace procedure xxx
    is
         tmp number;
    begin
         select     max(value)
         into     tmp
         from     sys.v$sess_time_model@lnk
         where     stat_name = 'DB CPU';
    end;
    /
    the procedure compiles without error, and I can call the procedure.


    If I connect to the system 'lnk' with DB link user name, I can't create the procedure directly in the database:
    SQL> create or replace procedure xxx
      2  is
      3   tmp number;
      4  begin
      5   select max(value)
      6   into tmp
      7   from sys.v_$sess_time_model
      8   where stat_name = 'DB CPU';
      9  end;
     10  /
    
    warning: procedure created with compilation errors.
    
    SQL> 
    SQL> show err
    Fehler bei PROCEDURE XXX:
    
    LINE/COL ERROR
    -------- -----------------------------------------------------------------
    5/2      PL/SQL: SQL Statement ignored
    7/11     PL/SQL: ORA-00942: table or view does not exist
    
    The same error comes up if I change line 7 to
      7   from v_$sess_time_model
      7   from v$sess_time_model
      7   from sys.v$sess_time_model
      
      
      
    SQL> select count(*) from sys.v_$sess_time_model;
    
      COUNT(*)
    ----------
           418  
    Why can't I just create the procedure in the database target?

    It seems that you grant of role based on sys.v_$ sess_time_model. You can check it using 'The VALUE NONE ROLE' and then try to choose.
    The direct grant of privilege is required for Pl/SQL. For an illustration more Re: compile errors

  • Compile errors display problems

    I connect to an Oracle database version: 10.2.0.3.0 64bits
    Developer SQL version: 1.5.1
    SQL * Plus the version command line: 10.2.0.4.0 with driver ojdbc14.jar is

    When I compile in the command line, I see errors:
    SQL> alter package MY_SCHEMA.MY_COMPANY_PACKAGE compile body;
    
    Warning: Package Body altered with compilation errors.
    
    Elapsed: 00:00:00.76
    SQL> show error;
    Errors for PACKAGE BODY MY_SCHEMA.MY_COMPANY_PACKAGE:
    
    LINE/COL ERROR
    -------- -----------------------------------------------------------------
    1951/5   PL/SQL: SQL Statement ignored
    1955/27  PLS-00201: identifier 'T_SETUP_COMPLETE_DATE' must be declared
    1956/5   PL/SQL: ORA-00904: : invalid identifier
    2005/5   PL/SQL: SQL Statement ignored
    2013/52  PL/SQL: ORA-00984: column not allowed here
    2050/5   PL/SQL: SQL Statement ignored
    2052/27  PLS-00201: identifier 'T_DEFINITION_ISSUED_DATE' must be declared
    2053/5   PL/SQL: ORA-00904: : invalid identifier
    2078/5   PL/SQL: SQL Statement ignored
    2082/71  PL/SQL: ORA-00984: column not allowed here
    2265/9   PL/SQL: SQL Statement ignored
    2267/30  PLS-00201: identifier 'T_PARM_DESC' must be declared
    2268/9   PL/SQL: ORA-00904: : invalid identifier
    2306/13  PL/SQL: SQL Statement ignored
    2310/58  PL/SQL: ORA-00984: column not allowed here
    5132/9   PL/SQL: Statement ignored
    5132/39  PLS-00201: identifier 'ROOT' must be declared
    5152/9   PL/SQL: SQL Statement ignored
    5152/21  PL/SQL: ORA-00942: table or view does not exist
    5167/21  PL/SQL: ORA-00942: table or view does not exist
    However, in SQL Developer, I use the same database/login. View of connection, I drill down to the package, then the body, then modify and compile.
    All I see on the tab "Messages Messages - journal," is:
    MY_COMPANY_PACKAGE Body Compiled (with warnings)
    "Compiler Log - compile" tab displays a list of warnings, but none of the mistakes that I see in the command line. What bothers me more, is that my colleagues who use the same version of SQL Developer, connecting to the same database with the same login ID can see errors in the user interface.

    I would like to point out, when I connect first , I see a small red cross on the package body, but she disappears almost immediately once I do something like by clicking on "Edit" or "compile".

    The option settings of the default compiler in SQLDeveloper include a lot of warnings and there is a data limit of 20 messages, so if you have a lot of warnings, errors are not displayed. The default value in the database (and so in sql * more) does include not all warnings.

    To change the compiler options in SQLDeveloper, go to tools | Preferences | The database PL/SQL compiler options. There are various options for what type of messages to display. You can assign performance to turn OFF and the other ERROR for example.

    The red x indicates that the procedure is not valid.

  • DBMS_REDEFINITION package leads to a PLS00201 compilation error

    I try to put a logic of redefining online within a packet but direct issues, in particular the package doesn't seem to know DBMS_REDEFINITION. I can run DBMS_REDEFINITION, only not go in a package or a program named.

    Here is a minimal example that fails:

    -- Executed by the same user
    -- This works just fine:
    BEGIN
      DBMS_OUTPUT.PUT_LINE(SYS.DBMS_REDEFINITION.CONS_USE_ROWID);
    END;
    
    
    -- This generates PLS-00201 error on SYS.DBMS_REDEFINITION:
    CREATE OR REPLACE PACKAGE testpkg
      AUTHID CURRENT_USER
    AS
      gc_int PLS_INTEGER := SYS.DBMS_REDEFINITION.CONS_USE_ROWID;
    END testpkg;
    
    
    -- This does not work because testpkg is invalid:
    BEGIN
      DBMS_OUTPUT.PUT_LINE(testpkg.gc_int);
    END;
    

    The problem is that I can run these instructions to the same user within the same session and I still get the error PLS. I even ran on my own system of sandbox (12 c VM) where I have system privileges, but it does not work. I fiddled with the AUTHID clause but that did not help.

    Related discussions:

    Any suggestions?

    How grant you permission to this user to use dbms_redefinition? It must be a direct subsidy without a role:

    Connected to:
    Oracle Database 11g Release 11.2.0.4.0 - 64bit Production                      
    
    SQL> CREATE OR REPLACE PACKAGE testpkg
      2    AUTHID CURRENT_USER
      3  AS
      4    gc_int PLS_INTEGER := SYS.DBMS_REDEFINITION.CONS_USE_ROWID;
      5  END testpkg;
      6  /                                                                         
    
    Warning: Package created with compilation errors.                              
    
    SQL> drop package testpkg;                                                     
    
    Package dropped.                                                               
    
    SQL> conn / as sysdba
    Connected.                                                                     
    
    SQL> grant all on dbms_redefinition to hr;                                     
    
    Grant succeeded.                                                               
    
    SQL> conn hr/hr
    Connected.
    SQL> CREATE OR REPLACE PACKAGE testpkg
      2    AUTHID CURRENT_USER
      3  AS
      4    gc_int PLS_INTEGER := SYS.DBMS_REDEFINITION.CONS_USE_ROWID;
      5  END testpkg;
      6  /                                                                         
    
    Package created.
    
  • Always get compile errors in scott.emp

    Hi Experts,
    I get compilation errors when I compile a package body:
    CREATE OR REPLACE PACKAGE TABLE_EXAMPLE AS
    TYPE TNAME IS RECORD(PARAMETER EMP%ROWTYPE,VALUE EMP%ROWTYPE);
    TYPE TABLET IS TABLE OF TNAME;
    TYPE EMP_TABLE IS TABLE OF EMP%ROWTYPE;
    PROCEDURE P1(ARG IN TABLE_EXAMPLE.TABLET);
    END;
    CREATE TABLE TAB_PAR
      (PARAMETER  VARCHAR2(100 ),
      PA_VALUE   VARCHAR2(100)
    );
    create or replace package body table_example as
    PROCEDURE P1(ARG IN TABLE_EXAMPLE.TABLET) as
    l_emp_tbl emp_table:=emp_table() ;
    cursor c is select * from emp;
    
    err_msg varchar2(1000);
    err_code number;
    
    
    begin
    
    
    
    
    for m in 1..arg.count loop
    
    
    insert into tab_par(parameter,pa_value) values (arg(m).parameter,arg(m).value);
    
    end loop;
    
    exception
    when others then 
    err_msg:=sqlerrm;
    err_code:=sqlcode;
    dbms_output.put_line(sqlerrm);
    end;
     
    end  table_example;
    
    Warning: Package Body created with compilation errors.
    
    LINE/COL ERROR
    -------- ---------------------------------------
    20/49    PLS-00382: expression is of wrong type
    20/66    PLS-00382: expression is of wrong type
    How to solve this?
    Thank you.

    Hello
    Why do you use

    TABLE_EXAMPLE.tablet
    

    In the world
    Just change it to TABLET and it should compile correctly.
    This is what I did and it works fine

    CREATE OR REPLACE PACKAGE TABLE_EXAMPLE2 AS
    TYPE TNAME IS RECORD(P_PARAMETER varchar2(100),P_VALUE varchar2(100));
    TYPE TABLET IS TABLE OF TNAME;
    PROCEDURE P1(ARG IN TABLET);
    END;
    
    create or replace package body table_example2 AS
    
    PROCEDURE P1(ARG IN TABLET) as
    begin
    for m in 1..arg.last loop
    
    insert into tab_par(parameter,pa_value) values (arg(m).p_parameter,arg(m).p_value);
    
    end loop;
    
    end;
    
    end  table_example2;
          
    

    See you soon!
    Bobin

Maybe you are looking for