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))

/

Tags: Database

Similar Questions

  • 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;
    /

  • 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

  • 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

  • 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);

  • 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.

  • "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).

  • ORA-01658 unable to create transitional extended error in oracle 8.1.7.0.0

    IAM on the oracle 8.1.7.0.0 version

    Asked me to reduce the scope for a (table) segment in a tablespace.

    I tried with the option

    ALTER table < table name > move;

    but I get the error as

    ORA-01658: cannot create as INITIAL segment in tablespace SBDAT01

    I tried to merge the tablespace and also there is enough free space to contain the segment in tablespace

    Please tell me how to avoid the mistake and to reduce the number of extensions for the specified segment table?


    Thank you
    Aram

    PL don't post duplicates - reduce extensions - to continue the discussion in your original thread

  • 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.

  • 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.
    
  • 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

  • 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

  • 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,
      ..
    );
    
  • problem with Java mail for oracle 9i

    Hi all
    I want to send messages from the oracle 9i server to my mail server (mail.example.com).
    Please see this link * [http://www.akadia.com/services/java_mail_plsql.htmlbold] * and I try to follow their guidelines.
    Everything is running successfully. The part where it's written on this document "Install Java Code to send emails with attachments. When try to run this code as scott/tiger schema, then I got an error which is in the below:

    ATTENTION: Java created with compilation errors.

    After the words when I ran to see what the problem with the execution of this order "display errors java source 'SendMail'" it's generating error information below:

    error starting
    JAVA SOURCE SendMail errors:

    LINE/COL ERROR
    -----------------------------------------------------------------
    0/0 SendMail:25: class Session not found.
    0/0 SendMail:25: class Session not found.
    0/0 SendMail:25: name of variable or class not defined: Session
    SendMail:29 0/0: MimeMessage class not found.
    SendMail:29 0/0: MimeMessage class not found.
    SendMail:34 0/0: InternetAddress class not found.
    SendMail:34 0/0: InternetAddress class not found.
    SendMail:34 0/0: Undefined variable or class name: InternetAddress
    SendMail:41 0/0: InternetAddress class not found.
    SendMail:41 0/0: InternetAddress class not found.
    SendMail:41 0/0: Undefined variable or class name: InternetAddress

    LINE/COL ERROR
    -----------------------------------------------------------------
    SendMail:48 0/0: InternetAddress class not found.
    SendMail:48 0/0: InternetAddress class not found.
    SendMail:48 0/0: Undefined variable or class name: InternetAddress
    SendMail:55 0/0: InternetAddress class not found.
    SendMail:55 0/0: InternetAddress class not found.
    SendMail:55 0/0: Undefined variable or class name: InternetAddress
    SendMail:60 0/0: msg Variable may not have been initialized.
    SendMail:63 0/0: Multipart class not found.
    0/0 SendMail:63: class not found MimeMultipart.
    SendMail:67 0/0: MimeBodyPart class not found.
    SendMail:67 0/0: MimeBodyPart class not found.

    LINE/COL ERROR
    -----------------------------------------------------------------
    SendMail:79 0/0: MimeBodyPart class not found.
    SendMail:79 0/0: MimeBodyPart class not found.
    SendMail:80 0/0: Class FileDataSource not found.
    SendMail:81 0/0: Class FileDataSource not found.
    SendMail:90 0/0: MimeBodyPart class not found.
    SendMail:90 0/0: MimeBodyPart class not found.
    SendMail:91 0/0: Class FileDataSource not found.
    SendMail:91 0/0: Class FileDataSource not found.
    SendMail:99 0/0: msg Variable may not have been initialized.
    0/0 SendMail:105: name of variable or class not defined: Transport
    SendMail:106 0/0: MessagingException class not found.

    LINE/COL ERROR
    -----------------------------------------------------------------
    0/0 info: 33 errors
    end error

    Even if I try to compile the source file java Oracle database 9i «schema-> Scott-> Source types-> Java Sources»
    But could not compile. There show "status as invalid.

    Please help me

    Published by: André on June 4, 2010 20:21

    Published by: André on June 4, 2010 20:22

    Published by: André on June 4, 2010 20:23

    is there a reason why you need to use JAVA for this? Oracle email can be easily done using UTL_SMTP - I've been using this package for years with great success http://www.oracle.com/technology/sample_code/tech/pl_sql/htdocs/maildemo_sql.txt - running like a charm 9.2

  • 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

  • How to fix the General glitchiness of Firefox?

    In the last two days, Firefox has been pretty glitchy. For example, when passing between the tabs using the command + #, it switches the display on the tab, but indicators of the tab at the top do not change. When this happens, the scrolling is very

  • LapDock 100 impact and update fails?

    I wanted to just confirmation as agglomerates users of photons which are affected by the update has failed can use Lapdock 100 again (as one of the things said in the update has taken over Lapock). I figure that we are still able to use the dock beca

  • Windows no longer starts 7, error Code Stop: 0x0000007B

    Hello Recently, I have rebuilt my computer and now my OS does not start.  I use windows 7.  Windows starts too boot, then fails. I get this error code.  STOP: 0X0000007B I think my hard drives are on the right type of SATA, so I don't know what to do

  • Windows install for Windows 7 Ultimate

    the windows installer does not work for my os! can someone explain how to solve or at least how to edit?

  • bios update Pavilion a1340n

    I have a HP Pavilion a1340n with XP, I want to use Windows 7 but I can't because I need to update the bios, I am looking for the update but I can't find, then, where I can download the bios update? If you have a solution please send me a message to m