SQL ... varray / object types

use 8i
I have a problem with VARRAYS.
With the following script there is an error when creating the VArray ->
TypVa_STUDENT .
"Type created with compilation errors" (Oracle SQLPlus)
I can't explain why.
Could it be that with the Type Typ_STUDENT the attribute COURSE already is a
type
which doesn't allow the VArray TypVa_STUDENT to be created
B.B.
Matthias
create type Typ_COURSE as object
MARK varchar2(200) ,
SECTION varchar2(200) ,
COURSENAME varchar2(200)
create type TypVa_COURSE as
varray(10) of Typ_COURSE ;
create type Typ_STUDENT as object
FNAME varchar2(200) ,
LNAME varchar2(200) ,
COURSE TypVa_COURSE
create type TypVa_STUDENT as
varray(10) of Typ_STUDENT ;
create table tblREPORTCARD
STUDENT TypVa_STUDENT
null

You can not include another varray in varray type. It will generate an error
<BLOCKQUOTE><font size="1" face="Verdana, Arial, Helvetica">quote:</font><HR>Originally posted by Matthias ([email protected]):
use 8i
I have a problem with VARRAYS.
With the following script there is an error when creating the VArray ->
TypVa_STUDENT .
"Type created with compilation errors" (Oracle SQLPlus)
I can't explain why.
Could it be that with the Type Typ_STUDENT the attribute COURSE already is a
type
which doesn't allow the VArray TypVa_STUDENT to be created
B.B.
Matthias
create type Typ_COURSE as object
MARK varchar2(200) ,
SECTION varchar2(200) ,
COURSENAME varchar2(200)
create type TypVa_COURSE as
varray(10) of Typ_COURSE ;
create type Typ_STUDENT as object
FNAME varchar2(200) ,
LNAME varchar2(200) ,
COURSE TypVa_COURSE
create type TypVa_STUDENT as
varray(10) of Typ_STUDENT ;
create table tblREPORTCARD
STUDENT TypVa_STUDENT
<HR></BLOCKQUOTE>
null

Similar Messages

  • Can a PL/SQL table Object Type be used in a VO?

    Hi,
    Is it possible to use a PL/SQL table object type to provide data to a View Object? In short, I would like to be able to do something like this:
    1. Create record object:
    CREATE OR REPLACE TYPE xx_rec_type AS OBJECT
    (xxid NUMBER,
    xxdesc varchar2(10),
    xxcost number...);
    2. Create table object:
    CREATE OR REPLACE TYPE xx_tbl_type AS TABLE OF xx_rec_type;
    3. Declare and populate the object in PL/SQL package:
    xx_tbl xx_tbl_type;
    xx_tbl(i).xxid := 1;
    xx_tbl(i).xxdesc := 'XXX';
    xx_tbl(i).xxcost := 10.00;
    4. Create a View Object as:
    SELECT * FROM xx_tbl
    Is it even possible to access xx_tbl from View Object? If anyone has done something like this, please do share.
    TIA
    Alka

    A PL/SQL procedure can exist in Oracle DB, in TimesTen, or in both. You control that by where you create the procedure. Procedures that exist in Oracle can really only be called in Oracle and can only access data in Oracle. Procedures that exist in TimesTen can only be called in TimesTen and can only access data in TimesTen. There is a limited capability, using the TimesTen PassThrough capability to call PL/SQL procedures located in Oracle, from Timesten, and for Timesten PL/SQL procedures to access data in Oracle. Using PassThrough does have some overhead.
    Chris

  • Null Pointer when fetching VARRAY / OBJECT TYPE

    Hi,
    i'm trying to fetch a VARRAY, containing an Obeject Type consisiting of two NUMBERS (see scripts below). Now i used JDeveloper to generate corresponding Java Klasses. What i'm trying to do is this:
    String SQL = "select quantityprice from ts_transaction_q_history where hist_id = 125608";
    Map map = null;
    Class obj = null;
    Connection tmpCon = null;
    PreparedStatement tmpStmt = null;
    ResultSet tmpRS = null;
    VaQuantitypriceQ100 tmpQP100 = null;
    OtQuantityprice tmpQP = null;
    OtQuantityprice[] tmpQPArr = null;
    ARRAY tmpQP100ARR = null;
    try {
    tmpCon = getConnection();
    map= tmpCon.getTypeMap();
    obj = Class.forName("ch.egl.emis.persistence.wrapper.VaQuantitypriceQ100");
    map.put(VaQuantitypriceQ100._SQL_NAME, obj);
    tmpCon.setTypeMap(map);
    tmpStmt = tmpCon.prepareStatement(SQL);
    tmpRS = tmpStmt.executeQuery();
    while (tmpRS.next()) {
    tmpQP100ARR = (ARRAY) tmpRS.getObject(1);
    System.out.println(tmpQP100ARR.toString());
    ORADataFactory factory = VaQuantitypriceQ100.getORADataFactory();
    tmpQP100 = (VaQuantitypriceQ100) factory.create(tmpQP100ARR, OracleTypes.ARRAY);
    Long quan = tmpQP.getQuantity().longValue();
    Long price = tmpQP.getPrice().longValue();
    Well, everything works fine, as far as i can see. I get a Quantity (quan), but when i try to get the price, i get a null pointer.
    I am sure, that there is data on the DB and the value for price is nut null. i an using JBoss 3.2.7 and Oracle 9i. Connection is "thin" (may that be the Ptoblem)?
    Anybody there who had similar problems or has a solution for this?
    Many thanks
    Sven
    ********************** VA_QUANTITYPRICE_Q_100 *********************************
    CREATE OR REPLACE TYPE VA_QUANTITYPRICE_Q_100 AS VARRAY(100) OF OT_QUANTITYPRICE
    ********************** OT_QUANTITYPRICE *********************************
    CREATE OR REPLACE TYPE "OT_QUANTITYPRICE" as object (
    quantity number,
    price number
    )

    Hi,
    i'm trying to fetch a VARRAY, containing an Obeject Type consisiting of two NUMBERS (see scripts below). Now i used JDeveloper to generate corresponding Java Klasses. What i'm trying to do is this:
    String SQL = "select quantityprice from ts_transaction_q_history where hist_id = 125608";
    Map map = null;
    Class obj = null;
    Connection tmpCon = null;
    PreparedStatement tmpStmt = null;
    ResultSet tmpRS = null;
    VaQuantitypriceQ100 tmpQP100 = null;
    OtQuantityprice tmpQP = null;
    OtQuantityprice[] tmpQPArr = null;
    ARRAY tmpQP100ARR = null;
    try {
    tmpCon = getConnection();
    map= tmpCon.getTypeMap();
    obj = Class.forName("ch.egl.emis.persistence.wrapper.VaQuantitypriceQ100");
    map.put(VaQuantitypriceQ100._SQL_NAME, obj);
    tmpCon.setTypeMap(map);
    tmpStmt = tmpCon.prepareStatement(SQL);
    tmpRS = tmpStmt.executeQuery();
    while (tmpRS.next()) {
    tmpQP100ARR = (ARRAY) tmpRS.getObject(1);
    System.out.println(tmpQP100ARR.toString());
    ORADataFactory factory = VaQuantitypriceQ100.getORADataFactory();
    tmpQP100 = (VaQuantitypriceQ100) factory.create(tmpQP100ARR, OracleTypes.ARRAY);
    Long quan = tmpQP.getQuantity().longValue();
    Long price = tmpQP.getPrice().longValue();
    Well, everything works fine, as far as i can see. I get a Quantity (quan), but when i try to get the price, i get a null pointer.
    I am sure, that there is data on the DB and the value for price is nut null. i an using JBoss 3.2.7 and Oracle 9i. Connection is "thin" (may that be the Ptoblem)?
    Anybody there who had similar problems or has a solution for this?
    Many thanks
    Sven
    ********************** VA_QUANTITYPRICE_Q_100 *********************************
    CREATE OR REPLACE TYPE VA_QUANTITYPRICE_Q_100 AS VARRAY(100) OF OT_QUANTITYPRICE
    ********************** OT_QUANTITYPRICE *********************************
    CREATE OR REPLACE TYPE "OT_QUANTITYPRICE" as object (
    quantity number,
    price number
    )

  • Error at debug PL/SQL with object types

    Hi, can someone help me.
    My context is:
    Database: Oracle 9.2.0.5.
    O.S. Solaris 9
    SQL Developer: 1.2.1 build 3213
    I am trying to debug a package and I am getting this error:
    Connecting to the database ADMINEW_SERVICIOS.
    Executing PL/SQL: ALTER SESSION SET PLSQL_DEBUG=TRUE
    Executing PL/SQL: ALTER SESSION SET PLSQL_COMPILER_FLAGS=INTERPRETED
    Executing PL/SQL: CALL DBMS_DEBUG_JDWP.CONNECT_TCP( '10.70.10.69', '3673' )
    Debugger accepted connection from database on port 3673.
    Processing 56 classes that have already been prepared...
    Finished processing prepared classes.
    ORA-00600: internal error code, arguments: [15419], [severe error during PL/SQL execution], [], [], [], [], [], []
    ORA-06544: PL/SQL: internal error, arguments: [2603], [], [], [], [], [], [], []
    ORA-06553: PLS-707: unsupported construct or internal error [2603]
    Process exited.
    Disconnecting from the database ADMINEW_SERVICIOS.
    Debugger disconnected from database.
    When I call the debugger the parameters were:
    DECLARE
    P_SERIE VARCHAR2(200);
    P_SUSI NUMBER;
    P_EMPSUSI NUMBER;
    P_TX NUMBER;
    P_TIPO VARCHAR2(200);
    P_GRUPO NUMBER;
    P_CARGA SERVICIOS.TP_CONT;
    P_SERVICIOS SERVICIOS.TP_SERVICIOS;
    P_NUM NUMBER;
    v_Return VARCHAR2(200);
    BEGIN
    P_SERIE := 'M7';
    P_SUSI := 305;
    P_EMPSUSI := 1;
    P_TX := 153;
    P_TIPO := 'UNIFICADO';
    P_GRUPO := 48;
    -- Modify the code to initialize the variable
    P_CARGA := TP_CONT('M7', '4049', 'LLENO', '20', '15', '1500');
    -- Modify the code to initialize the variable
    P_SERVICIOS := TP_SERVICIOS(
    TP_SERVICIO('PAQUETE', 'SUSI', 'CREDITO', 'NACIONAL', NULL, '13423', '1', '89', '48', 'SI')
    P_NUM := 1;
    v_Return := PKG_TOOLS_SERVICIO_WEB.FN_ACTUALIZA_SUSI(
    P_SERIE => P_SERIE,
    P_SUSI => P_SUSI,
    P_EMPSUSI => P_EMPSUSI,
    P_TX => P_TX,
    P_TIPO => P_TIPO,
    P_GRUPO => P_GRUPO,
    P_CARGA => P_CARGA,
    P_SERVICIOS => P_SERVICIOS,
    P_NUM => P_NUM
    DBMS_OUTPUT.PUT_LINE('v_Return = ' || v_Return);
    END;
    The type definition is:
    create or replace TYPE TP_SERVICIOS AS
    VARRAY(20) OF TP_SERVICIO;
    create or replace
    TYPE TP_SERVICIO AS OBJECT(
    /* TODO enter attribute and method declarations here */
    TIPOSERV VARCHAR2(20),
    TIPOFACT VARCHAR2(15),
    FORMAPAGO VARCHAR2(10),
    MONEDA VARCHAR2(10),
    REFERENCIA VARCHAR2(15),
    CLIENTE VARCHAR2(6),
    EMPRESA VARCHAR2(2),
    ZSECLAVE VARCHAR2(5),
    GSRCLAVE VARCHAR2(3),
    CODIFICA VARCHAR2(2),
    MEMBER FUNCTION GET_TIPOSERV RETURN VARCHAR2,
    MEMBER FUNCTION GET_TIPOFACT RETURN VARCHAR2,
    MEMBER FUNCTION GET_FORMAPAGO RETURN VARCHAR2,
    MEMBER FUNCTION GET_MONEDA RETURN VARCHAR2,
    MEMBER FUNCTION GET_REFERENCIA RETURN VARCHAR2,
    MEMBER FUNCTION GET_CLIENTE RETURN VARCHAR2,
    MEMBER FUNCTION GET_EMPRESA RETURN VARCHAR2,
    MEMBER FUNCTION GET_ZSECLAVE RETURN VARCHAR2,
    MEMBER FUNCTION GET_GSRCLAVE RETURN VARCHAR2,
    MEMBER FUNCTION GET_CODIFICA RETURN VARCHAR2
    create or replace TYPE TP_CONT AS
    OBJECT(
    /* TODO enter attribute and method declarations here */
    SERIE VARCHAR2(2),
    CLAVE VARCHAR2(10),
    ESTADO VARCHAR2(5),
    DIM VARCHAR2(2),
    CANT VARCHAR2(8),
    PESO VARCHAR2(12)
    );

    This doesnt look good. You've got an ora600 in your trace which means your database has become unstable somehow. You really need to talk with the db support folks to figure out what the problem is.
    Barry

  • Fetch into object type

    Oracle 10.2.0.5.0
    Using Pl/SQL Developer
    Hi I'm new to collections, object types etc, so I aologize for any poor wording and missed concepts...
    I need to output a ref cursor from my package (for a summary report in SQL Server Reporting Services 2005). The summary report has two fields that come from the database table and 5 calculated fields. My idea for creating the ref cursor is as follows:
    1. Define an object type at the schema level
    2. Define a table (collection) type at the schema level
    3. Define a ref cursor at the package level
    4. Using dynamic SQL create a sql statement creating virtual columns for the 5 calculated fields
    5. Fetch cursor with dynamic sql into object type one record at a time
    6. Calculate the other five field values and update the object for each record processed
    7. Add the object 'record' to the table (collection) after each record is processed
    8. After the fetch is complete, convert the table to a ref cursor for returning to my application
    Here is what I have so far. I have cut out several of the calculated fields for simplicities sake. It is not complete and I don't know how to fetch the database row into the object, nor convert the collection to a ref cursor.
    Any help would be greatly appreciated.
    create or replace type dlyout.srvCtr_sum_rec_type as object (
                               zoneNo number,
                               zonetx varchar2(15),
                               distNo varchar2(4),
                               distTx varchar2(30),
                               numOccr number,
                               MEError varchar2(1));
    create or replace type dlyout.srvCtr_sum_tbl_of_recs is table of srvCtr_sum_rec_type;
    CREATE OR REPLACE PACKAGE DLYOUT.REPORTS_PKG is
      TYPE CUR IS REF CURSOR; 
    PROCEDURE testABC(startDate IN date,
                           endDate IN date,
                           startTime IN varchar2,
                           endTime IN varchar2,
                           zoneNo IN dlyout.loc.zone_no%type,
                           distNo IN dlyout.loc.dist_cd%type,
                           CUROUT OUT CUR);
    END;
    CREATE OR REPLACE PACKAGE BODY DLYOUT.REPORTS_PKG IS
      PROCEDURE testABC(startDate IN date,
                           endDate IN date,
                           startTime IN varchar2,
                           endTime IN varchar2,
                           zoneNo IN dlyout.loc.zone_no%type,
                           distNo IN dlyout.loc.dist_cd%type,
                           CUROUT OUT CUR) as
      startDateTimeStr varchar2(10) := to_Char(startDate, 'MM/DD/YYYY') ;     
      endDateTimeStr varchar2(10) := to_Char(endDate, 'MM/DD/YYYY');   
      startDateTime date := to_date(startDateTimeStr || ' ' || startTime, 'MM/DD/YYYY HH24:MI:SS');
      endDateTime date := to_date(endDateTimeStr|| ' ' || endTime, 'MM/DD/YYYY HH24:MI:SS');
      distClause varchar2(1000);
      sqls varchar2(2000);
      zoneClause varchar2(1000) :='';
      idx number :=0;
      curSrvCtr cur;
      srvCtrRec srvCtr_sum_rec_type;
      srvCtrTbl srvCtr_sum_tbl_of_recs :=srvCtr_sum_tbl_of_recs();
      BEGIN
        if zoneNo <> 9999 then
            zoneClause := ' and zone_no member of dlyout.reports_common_stuff_pkg.convert_to_collection(zoneNo)';
        end if;
        if distNo <> '9999' then
            distClause := ' and dist_cd member of dlyout.reports_common_stuff_pkg.convert_to_collection(distNo) ';
        end if;
        sqls := 'select distinct l.zone_no zoneNo, l.zone_tx zoneTx,
                l.dist_cd distCd , l.dist_tx distTx, 0 numOccr, '''' MEError       
                from dlyout.loc l
                where l.ts between  :startts and :endts ' ||
                zoneClause ||
                distClause ||
                ' order by l.zone_no, l.dist_tx ';
        open curSrvCtr for sqls using  startDateTime, endDateTime;
        LOOP
          FETCH curSrvCtr INTO srvCtrRec;      --ORA:00932 inconsistent datatype expected - got -
          EXIT WHEN curSrvCtr%NOTFOUND;
            --call other functions to get calculated fields
            srvCtrRec.numOccr := dlyout.reports_common_stuff_pkg.Num_Loc_Exc_Mom(startDateTimeStr, endDateTimeStr, starttime, endTime, srvctrRec.distno);
            srvCtrRec.MEError := dlyout.reports_common_stuff_pkg.ME_Error(startDateTimeStr, endDateTimeStr, starttime, endTime, srvCtrRec.distNo, null);
            dbms_output.put_line(srvCtrRec.distTx || ' ' || srvCtrRec.numoccr|| ' ' || srvCtrRec.MEError);
         end loop;
    end testABC;
    END;
      Then I need to add the object to the table. Something like this?
           -- add object 'record' to table
           srvCtrTbl.extend;
           srvCtrTbl.last := srvCtrRec;
    Then I am not sure how to do the cast to get the table to a ref cursor. Something like this?
    open curout for SELECT *
    FROM TABLE (CAST (srvCtrTbl AS srvCtr_sum_tbl_of_recs))
    ORDER BY zoneNo, distTx;

    Ok, so after more research if seems that in 10.2 you cannot assign an object (SQL) type to a ref cursor (PLSQL). SO i changed my direction and used a global temp table - created at the schema level.
    Create global temporary table dlyout.srvCtr_summary (
                               zoneNo number,
                               zonetx varchar2(15),
                               distNo varchar2(4),
                               distTx varchar2(30),
                               numOccr number,
                               MEError varchar2(1)
    ) on commit delete rows;Here is what the procedure looks like now.
    PROCEDURE testABC(startDate IN date,
                           endDate IN date,
                           startTime IN varchar2,
                           endTime IN varchar2,
                           zoneNo IN dlyout.location.zone_no%type,
                           distNo IN dlyout.location.dist_cd%type,
                           CUROUT OUT CUR) as
      startDateTimeStr varchar2(10) := to_Char(startDate, 'MM/DD/YYYY') ;     
      endDateTimeStr varchar2(10) := to_Char(endDate, 'MM/DD/YYYY');   
      startDateTime date := to_date(startDateTimeStr || ' ' || startTime, 'MM/DD/YYYY HH24:MI:SS');
      endDateTime date := to_date(endDateTimeStr|| ' ' || endTime, 'MM/DD/YYYY HH24:MI:SS');
      distClause varchar2(1000);
      sqls varchar2(2000);
      zoneClause varchar2(1000) :='';
      curSrvCtr cur;
    --Still need the PLSQL record type to put in the cursor for the dynamic SQL
    type srvCtr_sum_rec_type is record (zoneNo dlyout.location.zone_no%type,
                               zonetx dlyout.location.zone_tx%type,
                               distNo dlyout.location.dist_cd%type,
                               distTx dlyout.location.dist_tx%type,
                               numOccr number,
                               MEError varchar2(1));
      srvCtrRec srvCtr_sum_rec_type;
      BEGIN
        --create clauses for dynamic sql by calling other functions
        if zoneNo <> 9999 then
            zoneClause := ' and zone_no member of dlyout.reports_common_stuff_pkg.convert_to_collection(zoneNo)';
        end if;
        if distNo <> '9999' then
            distClause := ' and dist_cd member of dlyout.reports_common_stuff_pkg.convert_to_collection(distNo) ';
        end if;
        --here is the dynamic sql
        sqls := 'select distinct l.zone_no, l.zone_tx,
                l.dist_cd , l.dist_tx, 0, 0,
                0, 0, ''''       
                from dlyout.location l
                where l.enrgz_ts between  :startts and :endts ' ||
                zoneClause ||
                distClause ||
                ' order by l.zone_no, l.dist_tx ';
       open curSrvCtr for sqls using  startDateTime, endDateTime;
        LOOP
          --fetch in part of the record
          FETCH curSrvCtr INTO srvCtrRec;
          EXIT WHEN curSrvCtr%NOTFOUND;
          --do the calculations to get the other field values
            srvCtrRec.numOccr := dlyout.reports_common_stuff_pkg.Num_Loc_Exc_Mom(startDateTimeStr, endDateTimeStr, starttime, endTime, srvctrRec.distno);
             srvCtrRec.MEError := dlyout.reports_common_stuff_pkg.MEC_Error(startDateTimeStr, endDateTimeStr, starttime, endTime, srvCtrRec.distNo, null);
            dbms_output.put_line(srvCtrRec.distTx || ' ' || srvCtrRec.numoccr|| ' ' || srvCtrRec.MEError);
            --add record to GTT
            insert into dlyout.srvCtr_summary(zoneNo, zoneTx, distNo, distTX, numOccr, MEError )
            values(srvCtrRec.zoneNo, srvCtrRec.zoneTx, srvCtrRec.distNo, srvCtrRec.distTX, srvCtrRec.numOccr, srvCtrRec.MEError);
        end loop;
       --open GTT and return ref cursor to app
       open curout for SELECT *
           FROM srvCtr_summary
           ORDER BY zoneNo, distTx;
      end testABC;

  • How to index a varray of object type?

    Hello,
    Is it possible to index a varray/Table type, which is of type of an object, like the way the scalar types are.
    say, CREATE OR REPLACE
    TYPE SAMPLE_TABLE AS TABLE OF Date index by binary_integer
    But if I have to change the table type from Date to an object
    lets say
    create or replace TYPE SAMPLE_TYPE AS OBJECT (
    id NUMBER(12),
    value varchar2(12)
    Will I be able to do
    CREATE OR REPLACE
    TYPE SAMPLE_TABLE AS TABLE OF SAMPLE_TYPE index by id
    If not, is there a way it can be done, or is it a limitaion that it cant be done. Any pointers to this is highly appreciated.
    Thanks

    One way to do this...
    SQL> drop type profile_options_object_array
      2  /
    SQL> drop type profile_options_object
      2  /
    SQL> drop table t
      2  /
    SQL>
    SQL> CREATE OR REPLACE TYPE profile_options_object AS OBJECT(
      2  option_name VARCHAR2(100),
      3  option_value VARCHAR(200)
      4  );
      5  /
    SQL> CREATE OR REPLACE TYPE profile_options_object_array AS VARRAY(32000) OF profile_options_object;
      2  /
    SQL>
    SQL> create table t
      2  (x varchar2(10)
      3  ,y varchar2(10)
      4  );
    SQL> insert into t values ('name1', 'value1');
    SQL> insert into t values ('name2', 'value2');
    SQL> commit;
    SQL>
    SQL> select profile_options_object (x, y)
      2    from t
      3  /
    PROFILE_OPTIONS_OBJECT(X,Y)(OPTION_NAME, OPTION_VALUE)
    PROFILE_OPTIONS_OBJECT('name1', 'value1')
    PROFILE_OPTIONS_OBJECT('name2', 'value2')
    SQL> declare
      2     profile_options  profile_options_object_array;
      3     idx pls_integer;
      4  begin
      5     select profile_options_object (x, y)
      6       bulk collect
      7       into profile_options
      8       from t
      9     ;
    10    idx := profile_options.first;
    11    while idx is not null
    12    loop
    13      dbms_output.put_line (profile_options(idx).option_name); 
    14      dbms_output.put_line (profile_options(idx).option_value);
    15      idx := profile_options.next(idx);
    16    end loop;
    17  end;
    18  /
    name1
    value1
    name2
    value2
    SQL>

  • Problem in fetching varray of Object type

    Below are the code,
    where am calling an procedure which returns me Varray of object type test_obj(id number, name varchar2);
    Am facing an problem in get the object(test_obj) from ARRAY object
    the exception is java.lang.ClassCastException: java.lang.Object
    at line number No 12..
    Can anyone suggest me How handle this...
    1. STRUCT test_objStruct ;
    2. ARRAY test_arr;
    3. OracleCallableStatement cs = (OracleCallableStatement)
    4. con.prepareCall("{call test_data(?)}");
    5. cs.registerOutParameter(1,oracle.jdbc.driver.OracleTypes.ARRAY,"TEST_ARR");
    6. cs.execute();
    7. test_arr = (ARRAY)cs.getObject(1);
    8.System.out.println("array varible "+test_arr.getBaseTypeName());
    9. System.out.println("length "+test_arr.length());
    10. Map map = (Map)con.getTypeMap();
    11. map.put("TEST_OBJ", Class.forName("oracle.sql.STRUCT"));
    12. test_objStruct = (STRUCT)test_arr.getArray(1,1);
    13.Object country_attrs[] = test_objStruct.getAttributes();
    14.System.out.println ("ID: " country_attrs[0]);
    15.System.out.println ("Name: " +country_attrs[1]);
    the output is..
    array varible TEST_OBJ
    length 106
    Error java.lang.ClassCastException: java.lang.Object

    Hi,
    The error occurs on line 12, the first time through the loop, when you try to execute:
    vClient(iCounter).ename_obj:=i.ename;
    At that point, vClient (1) is not an Employee object; it's NULL.
    Try this:
    DECLARE
        TYPE tvrEmploy IS VARRAY(10) OF Employee;
        vClient    tvrEmploy;
        iCounter   integer := 1;
        CURSOR client_cursor IS
            SELECT  ename, sal
            ,       empno                                                 -- ADDED
       FROM    scott.emp
       WHERE   rownum < 11;
    BEGIN
        vClient := tvrEmploy (null,null,null,null,null,null,null,null,null,null) ;  
        FOR i IN client_cursor LOOP
            vClient (iCounter) := Employee (i.ename, i.empno, i.sal);     -- CHANGED
            iCounter := iCounter + 1;
       END LOOP;
    FOR I IN REVERSE 1..10 LOOP
           dbms_output.put_line(to_char(I) ||' '|| vClient(I).ename_obj ||' '|| vClient(I).empno_obj ||' '||
          vClient(I).sal_obj);
       END LOOP;
    END ;

  • Varray of Object Type

    Hello,
    I am still very new at PL/SQL so please bare with me if you can. I am trying to learn how to store data from an object in a single varray of objects. My code below is attempting to declare an object type with 3 instance attributes and 3 instance methods of getter and setter method.
    Then i want to create a varray type to store an array of "Employee" object types.
    From here i am trying to use a loop to retrieve the first 10 ename, empno, and sal records from the emp table and store them in the variable array of 10 elements.
    Finally, I tried to use another loop to output the ename, empno, and sal in reverse order.
    My object and my object body was created successfully with no errors.
    The problem starts when I begin the anonymous block that creates the varray, this is where i get an error message at the end.
    At the end of my code is the error message i get. Can anyone suggest to me what I am doing wrong, and/or what I can do to achieve this task.
    SET SERVEROUTPUT ON
    --create object
    CREATE OR REPLACE TYPE Employee AS OBJECT(
      ename_obj VARCHAR2(10),
      empno_obj NUMBER(4),
      sal_obj NUMBER(7,2),
      MEMBER FUNCTION getename RETURN VARCHAR2,
      MEMBER FUNCTION getempno RETURN NUMBER,
      MEMBER FUNCTION getsal RETURN NUMBER);
    --create object body
    CREATE OR REPLACE TYPE BODY Employee AS
      MEMBER FUNCTION getename RETURN VARCHAR2 IS
      BEGIN
       RETURN ename_obj;
      END;
      MEMBER FUNCTION getempno RETURN VARCHAR2 IS
      BEGIN
       RETURN empno_obj;
      END;
      MEMBER FUNCTION getsal RETURN VARCHAR2 IS
      BEGIN
       RETURN sal_obj;
      END;
    END;
    --create varray of object and begin line 1 of ERROR Message--
    1> DECLARE
    2> TYPE tvrEmploy IS VARRAY(10) OF Employee;
    3>  vClient    tvrEmploy;
    4>    iCounter   integer:=1;
    5>   CURSOR client_cursor IS
    6>   SELECT ename, sal
    7>    FROM emp
    8>    WHERE rownum < 11;
    9>  BEGIN
    10>    vClient:=tvrEmploy(null,null,null,null,null,null,null,null,null,null) ;
    11>    FOR i IN client_cursor LOOP
    12>       vClient(iCounter).ename_obj:=i.ename;
    13>      vClient(iCounter).empno_obj:=i.empno;
    14>       vClient(iCounter).sal_obj:=i.sal;
    15>       iCounter:=iCounter+1;
    16>    END LOOP;
    17>    FOR I IN REVERSE 1..10 LOOP
    18>        dbms_output.put_line(to_char(I) ||' '|| vClient(I).ename_obj ||' '|| vClient(I).empno_obj ||' '||
              vClient(I).sal_obj);
    19>    END LOOP;
    20> END ;
    21> /
    --ERROR message below--
    DECLARE
    ERROR at line 1:
    ORA-06530: Reference to uninitialized composite
    ORA-06512: at line 12
    Thank you again for your time and patience.
    -Todd

    Hi,
    The error occurs on line 12, the first time through the loop, when you try to execute:
    vClient(iCounter).ename_obj:=i.ename;
    At that point, vClient (1) is not an Employee object; it's NULL.
    Try this:
    DECLARE
        TYPE tvrEmploy IS VARRAY(10) OF Employee;
        vClient    tvrEmploy;
        iCounter   integer := 1;
        CURSOR client_cursor IS
            SELECT  ename, sal
            ,       empno                                                 -- ADDED
       FROM    scott.emp
       WHERE   rownum < 11;
    BEGIN
        vClient := tvrEmploy (null,null,null,null,null,null,null,null,null,null) ;  
        FOR i IN client_cursor LOOP
            vClient (iCounter) := Employee (i.ename, i.empno, i.sal);     -- CHANGED
            iCounter := iCounter + 1;
       END LOOP;
    FOR I IN REVERSE 1..10 LOOP
           dbms_output.put_line(to_char(I) ||' '|| vClient(I).ename_obj ||' '|| vClient(I).empno_obj ||' '||
          vClient(I).sal_obj);
       END LOOP;
    END ;

  • Varray, Nested Table and Object types in OWB r2

    Requirement:
    Flat file with repeating groups of nested content need to move into Object Relational ORACLE table (using varray or nested tables - no preference). The data will be loaded, then mapped/transformed into a richer O-R output to directly produce XML outputs.
    Problem:
    Generated PL/SQL "seems" to do the correct thing, but deployment errors show failures on mapping of collections (varrays, NTs or OTs) and in sqlplus recompiling the PKB still gives the errors. Is this a PL/SQL generator error, or is there a more meaningful example of using CONSTRUCT OBJECT operator than the embedded odcumentation - it is a simple type (single instance) and not a variable repeating group of nested data.
    Anyone had any success with these, or know of any collateral to assist in the process. Thanks.

    The process we are following is very simple. We are talking 10 columns from a source flat file table and wish to map this into a Varray/Nested table, with one column of Varchar2(10).
    When you create your map in OWB, select the construct object, you have to choose an object type - it does not allow you to select a VARAAY or NESTED table.
    I have then created an object defined in the same structure as the VARRAY/NESTED table - I have then made the VARRAY/NESTED table of this TYPE.
    Example:
    CREATE OR REPLACE TYPE "O_REL_PUB_INDEX" AS OBJECT (
    X_REL_PUB_INDEX_1 VARCHAR2(10))
    CREATE OR REPLACE TYPE "V_REL_PUB_INDEX" AS VARRAY(15) OF O_REL_PUB_INDEX
    In OWB you can then select O_REL_PUB_INDEX when creating the 'Contruct Object'.
    The problem I have is that when I map to my target column of type V_REL_PUB_INDEX and DEPLOY my map I get the following errors taken from OWB control centre
    Name
    Action
    Status
    Log
    TEST
    Create
    Warning
    ORA-06550: line 2931, column 9:
    PL/SQL: SQL Statement ignored
    TEST
    Create
    Warning
    ORA-06550: line 3174, column 11:
    PL/SQL: ORA-00932: inconsistent datatypes: expected OWB_USER.O_REL_PUB_INDEX got OWB_USER.V_REL_PUB_INDEX
    TEST
    Create
    Warning
    ORA-06550: line 401, column 7:
    PL/SQL: SQL Statement ignored
    TEST
    Create
    Warning
    ORA-06550: line 643, column 13:
    PL/SQL: ORA-00932: inconsistent datatypes: expected OWB_USER.O_REL_PUB_INDEX got OWB_USER.V_REL_PUB_INDEX
    TEST
    Create
    Warning
    ORA-06550: line 7221, column 9:
    PL/SQL: SQL Statement ignored
    TEST
    Create
    Warning
    ORA-06550: line 7464, column 11:
    PL/SQL: ORA-00932: inconsistent datatypes: expected OWB_USER.O_REL_PUB_INDEX got OWB_USER.V_REL_PUB_INDEX
    Any ideas? anyone succesfully mapped to either a VARRAY or an NESTED TABLE target column?

  • Cannot query varray of object types-please help

    I am attempting to query the "diminfo" field of the view "MDSYS.all_sdo_geom_metadata". The field is "described" as MDSYS.SDO_DIM_ARRAY, which I believe is a varray of MDSYS.SDO_DIM_ELEMENT.
    I have run OTT to generate the class files, but nothing is generated for the MDSYS.SDO_DIM_ARRAY "type" (maybe because it's not really a type?). A class is generated for the SDO_DIM_ELEMENT objects.
    Anyway, I have tried to query the field using both "VALUE(diminfo)" and "REF(diminfo)":
    select VALUE(diminfo) from all_sdo_geom_metadata;
    - or -
    select REF(diminfo) from all_sdo_geom_metadata;
    and I get back an ORA-904 "invalid identifier". When I remove the "VALUE" or "REF" from the query, the error goes away, and is replaced by an ORA-32162 "Read/Write method not registered" further down in the code when I try to retreive the value from the recordset:
    myDimInfo = rSet->getObject(1);
    Since the field type (MDSYS.SDO_DIM_ARRAY) isn't really an object type, I can see why the "Read/Write method not registered" occurs-there are no methods to register.
    Can someone provide a code snippet of how to perform this query?
    Thanks in advance

    Hi,
    I am using OTT generated objects to pass them to my PL/SQL procedures as OUT parameters. When I call the registerOutParam() function, I get this error ORA-32162: Read/Write SQL method not registered.
    I am calling my mapping function after creating environment and before creating my stateless connection pool. But still I am getting this exception at runtime while calling registerOutParam().
    Environment* env;
    env = Environment::createEnvironment(Environment::OBJECT);
    MessageTOMapping(env); // Calling the mapping function here.
    // Creating the stateless connection pool.
    StatelessConnectionPool* scp;
    scp = env->createStatelessConnectionPool("naveen",
    "naveen",
    "//10.105.153.11:1521/pls",
    10,
    5,
    2,
    StatelessConnectionPool::HOMOGENEOUS);
    // Fetch a connection from the stateless connection pool
    conn = scp->getConnection();
    // After this, I create my Statement and call the registerOutParam() which
    // causes ORA-32162 exception.
    Please note that I do not get this error when I don't use any connection-pooling mechanism. That is, if I create an environment in OBJECT mode, call the mapping function with its pointer and create a normal Connection object (without any pooling etc), my application runs perfectly fine. E.g. if I replace the above piece of code with the code below, my application runs fine.
    Environment* env;
    env = Environment::createEnvironment(Environment::OBJECT);
    MessageTOMapping(env); // Calling the mapping function here.
    conn = env->createConnection("naveen", "naveen", "//10.105.153.11:1521/pls");
    // After this, I create my Statement and call the registerOutParam() which
    // does not give problem now and my application runs pefectly fine.
    Can anyone let me know what I am doing wrong while using the stateless connection pooling mechanism? I definitely need to use Stateless Connection Pooling and must not get connections directly from env->createConnection().
    Any help will be greatly appreciated.
    Thanks and Regards,
    Naveen

  • Implementing First In First Out Behaviour Using PL/SQL object types

    Hi Friends,
    I have a Integer Array of type Varray, I want to implement first in first out behaviour using Pl/SQL object type.Please provide me some idea that i can proceed. If you can provide me any sample code or any documentation,i will be very much thankful to you.Eagerly waiting for your reply.
    Thanks

    basically i have to implement a queue using pl/sql object types to traverse a tree as we can implement stack (LIFO).
    I can give an example of Stack implementation...
    CREATE or replace TYPE IntArray AS VARRAY(50) OF INTEGER;
    CREATE or replace TYPE IntStack_O AS OBJECT (
    maximalSize INTEGER
    ,top INTEGER
    ,position IntArray
    ,MEMBER PROCEDURE initialize
    ,MEMBER FUNCTION full RETURN BOOLEAN
    ,MEMBER FUNCTION empty RETURN BOOLEAN
    ,MEMBER FUNCTION getAnzahl RETURN INTEGER
    ,MEMBER PROCEDURE push (n IN INTEGER)
    ,MEMBER PROCEDURE pop (n OUT INTEGER)
    CREATE or replace TYPE body IntStack_O AS
    MEMBER PROCEDURE initialize IS
    BEGIN
    top := 0;
    -- Call Constructor und set element 1 to NULL
    position := IntArray(NULL);
    maximalSize := position.LIMIT; -- Get Varray Size
    position.EXTEND(maximalSize -1, 1); -- copy elements 1 in 2..50
    END initialize;
    MEMBER FUNCTION full RETURN BOOLEAN IS
    BEGIN
    RETURN (top = maximalSize); — Return TRUE when Stack is full
    END full;
    MEMBER FUNCTION empty RETURN BOOLEAN IS
    BEGIN
    RETURN (top = 0); — Return TRUE when Stack is empty
    END empty;
    MEMBER FUNCTION getAnzahl RETURN integer IS
    BEGIN
    RETURN top;
    END;
    MEMBER PROCEDURE push (n IN INTEGER) IS
    BEGIN
    IF NOT full
    THEN
    top := top + 1; — Push Integer onto the stack
    position(top) := n;
    ELSE
    –Stack ist voll!
    RAISE_APPLICATION_ERROR(-20101, ‘Error! Stack overflow. ‘
    ||’limit for stacksize reached.’);
    END IF;
    END push;
    MEMBER PROCEDURE pop (n OUT INTEGER) IS
    BEGIN
    IF NOT empty
    THEN
    n := position(top);
    top := top -1; — take top element from stack
    ELSE
    –Stack ist leer!
    RAISE_APPLICATION_ERROR(-20102, ‘Error! Stack underflow. ‘
    ||’stack is empty.’);
    END IF;
    END pop;
    END;
    Now if i run this..i will be getting the following output...
    DECLARE
    stack intstack_o := intstack_o(NULL,NULL,NULL);
    a INTEGER;
    BEGIN
    stack.initialize;
    dbms_output.put_line('Anzahl: ' || stack.getAnzahl);
    stack.push(1111);
    dbms_output.put_line('Anzahl: ' || stack.getAnzahl);
    stack.push(1112);
    dbms_output.put_line('Anzahl: ' || stack.getAnzahl);
    stack.push(1113);
    dbms_output.put_line('Anzahl: ' || stack.getAnzahl);
    stack.pop(a);
    dbms_output.put_line('Anzahl: ' || stack.getAnzahl);
    dbms_output.put_line(a);
    stack.pop(a);
    dbms_output.put_line('Anzahl: ' || stack.getAnzahl);
    dbms_output.put_line(a);
    stack.pop(a);
    dbms_output.put_line('Anzahl: ' || stack.getAnzahl);
    dbms_output.put_line(a);
    stack.pop(a);
    dbms_output.put_line('Anzahl: ' || stack.getAnzahl);
    dbms_output.put_line(a);
    END;
    Output...
    Anzahl: 0
    Anzahl: 1
    Anzahl: 2
    Anzahl: 3
    Anzahl: 2
    1113
    Anzahl: 1
    1112
    Anzahl: 0
    1111
    Above is the Stack (Last In First Out) Implementations of integer array.Now my Requirement is Queue(First In First Out) Implementation of Integer array.

  • PL/SQL Object Type - Java oracle.jbo.domain

    PL/SQL Object Type <-> Java oracle.jbo.domain
    can anybody help me, getting my domains to work?
    Following scenario:
    in pl/sql we have an object type called MULTI_LANGUAGE. This type is used for storing multilingual texts as nested table in one(!) column.
    So the object MULTI_LANGUAGE contains a member variable LANGUAGE_COLLECTION of type LANGUAGE_TABLE, which itself is a nested table of objects
    of the type LANGUAGE_FIELD (this again is only a language id and the corresponding content)
    Also the methods setContent(langID, langContent) and getContent(langId) are defined on Object MULTI_LANGUAGE.
    For example: Table having primary key, 2 other columns and one column of object type MULTI_LANGAGE (=nested table of objects)
    |ID|Column1|Column2|  multilingual Column  |
    |--|---------------------------------------|
    |  |       |       |  -------------------  |
    |  |       |       | | 1 | hello         | |
    |  |       |       |  -------------------  |
    |1 | foo   | bar   | | 2 | hallo         | |   <- Row Nr 1
    |  |       |       |  -------------------  |
    |  |       |       | | 3 | ola           | |
    |  |       |       |  -------------------  |
    |--|-------|-------|-----------------------|
    |  |       |       |  -------------------  |
    |  |       |       | | 1 | world         | |
    |  |       |       |  -------------------  |
    |2 | abc   | def   | | 2 | welt          | |   <- Row Nr 2
    |  |       |       |  -------------------  |
    |  |       |       | | 3 | ???  ;-)      | |
    |  |       |       |  -------------------  |
    |--|-------|-------|-----------------------|Now i've tried to modell this structure as an oracle.jbo.domain.
    class MultiLanguage extends Struct having this StructureDef:
    attrs[(0)] = new DomainAttributeDef("LanguageColl", "LANGUAGE_COLL", 0, oracle.jbo.domain.Array.class, 2003, "ARRAY", -127, 0, false, "campusonlinepkg.common.LanguageField");
    and
    class LanguageField extends Struct having this StructureDef:
    attrs[(0)] = new DomainAttributeDef("Id", "ID", 0, oracle.jbo.domain.Number.class, 2, "NUMERIC", -127, 0, false);
    attrs[(1)] = new DomainAttributeDef("Content", "CONTENT", 1, java.lang.String.class, 12, "VARCHAR", -127, 4000, false);
    Is there anything wrong with this StructureDef?
    When running the BC-Browser with -Djbo.debugoutput=console -Djbo.jdbc.driver.verbose=true parameters I get suspect warnings when browsing the records
    [196] Executing FAULT-IN...SELECT NR, NAME FROM B_THESAURI BThesauri WHERE NR=:1
    [197] SQLException: SQLState(null) vendor code(17074)
    [198] java.sql.SQLException: Ungültiges Namensmuster: XMLTEST.null
    ...snip: detail of stack...
    [240] SQLException: SQLState(null) vendor code(17060)
    [241] java.sql.SQLException: Deskriptor konnte nicht erstellt werden: Unable to resolve type "null"
    ...snip: detail of stack...
    [280] Warning:No element type set on this array. Assuming java.lang.Object.
    (XMLTEST is the name of the schema)
    Seems as if the framework can't read the TypeDescriptor or does not know which descriptor to read (XMLTEST.null??)
    Do I have to implement my own JboTypeMap?
    Please help, I'm stuck.
    Thanks in advance, Christian

    Thanks for your suggestion, but it seems to me as if there is one level missing.
    in pl/sql I have following structure:
    Struct MULTI_LANGUAGE (Object type) - outermost
      Array LANGUAGE_TABLE (nested table type)
        Struct LANGUAGE_FIELD (Object type simple) - innermostthe reason why i had to wrap another struct around the array was because it is not possible to define methods on a nested table. this is only possible on objects.
    on the outermost object type (which holds the array of language fields) I needed to define following 2 methods for direct access:
    getContent (langId in number) returns varchar2
    setContent (langId in number, langContent in varchar2)
    I would like to rebuild the same structure in java, because newly written java code should live in perfect harmony with legacy pl/sql code ;-)
    Both applications (Java and pl/sql) have to access the same data as long as migration to java goes on.
    Is this nested structure too much for a Domain?
    Any other suggestions?
    Thanks again, Christian

  • Creating PL/SQL web services from object types

    Hello
    Jdeveloper, pl/sql web-services working successfully with object types.If we want to send the web-services to the client, do we need to send the entire folder that is created in the web-services folder of the external oc4j..?
    Creating the client process:
    we are using the wsdl file that is generated in the web-services and adding to the partner link to Invoke the operations of web-services. Is there any other way to invoke the webservices?Could any one please suggest me?
    Thanking you
    Malathi

    Hello
    Accessing the pl/sql webservices from the application server:
    I have created pl/sql webservice using the nested tables. This will insert the object data into database tables.after deplying the webservice into external oc4j, when I test the webservice locally with url: http://localmachine:8888/PL_SQL_WS-Nest_Obj_Webservice-context-root/ObjWebserviceSoapHttpPort
    The above web-services working and I am able to insert into the database tables.
    Same when I want to access through the application server, I have changed the wsdl file soap address as
    <soap:address location="http://10.91.20.7:8888/PL_SQL_WS-Nest_Obj_Webservice-context-root/ObjWebserviceSoapHttpPort"/>
    When I access this url, I am able to give the input data
    http://10.91.20.7:8888/PL_SQL_WS-Nest_Obj_Webservice-context-root/ObjWebserviceSoapHttpPort
    but the out from the web-service is:
    <env:Envelope
    xmlns:env="http://schemas.xmlsoap.org/soap/envelope/">
    <env:Header/>
    <env:Body>
    <env:Fault
    xmlns:env="http://schemas.xmlsoap.org/soap/envelope/">
    <faultcode>env:Server</faultcode>
    <faultstring>Error creating target: DBConnImpMftest.ObjWebserviceUser</faultstring>
    <faultactor/>
    </env:Fault>
    </env:Body>
    </env:Envelope>
    Err from the OC4j log:<PAYLOAD>
    <MSG_TEXT>An error occurred for port: {http://dbconnimpmftest/Nested_Webserv.wsdl}Nested_WebservSoapHttpPort: javax.xml.rpc.JAXRPCException: Error creating target: dbconnimpmftest.Nested_WebservUser.</MSG_TEXT>
    </PAYLOAD>
    Could any one help me to solve the above issue?
    Kind regards
    Malathi

  • Calling a PL/SQL from VB with IN argument of object type

    I need to call a PL/SQL function in Oracle 8.1.6 from VB. One of the IN arguments is an object type (TYPE). How would I instantiate the variable of Oracle object type on VB side so that it can be passed to the Oracle?
    Thank you

    You have some flaws in your code.
    First - don't use same identifier for pl sql variables ( including parameters) and column names. In your case oracle will evaluate the where clause as where column_name=column_name which is probably not what you want. The next one - you should ensure that select into yields one row , not more, not less, otherwise you 'll run into exception.
    To actually print the desired values, you have to use dbms_output aware client ( sqlplus is such one) and for sqlplus in particular you have to issue set serveroutput on
    Here is a very basic example how can you get it to work:
    SQL> SELECT * FROM V$VERSION;
    BANNER
    Oracle Database 10g Express Edition Release 10.2.0.1.0 - Product
    PL/SQL Release 10.2.0.1.0 - Production
    CORE    10.2.0.1.0      Production
    TNS for Linux: Version 10.2.0.1.0 - Production
    NLSRTL Version 10.2.0.1.0 - Production
    SQL> CREATE OR REPLACE PROCEDURE FIND_EMPLOYEES
      2  (p_first_name IN VARCHAR2)
      3  IS
      4  LAST varchar2(10);
      5  BEGIN
      6          SELECT LAST_NAME INTO LAST FROM EMPLOYEES WHERE FIRST_NAME = p_first_name;
      7          dbms_output.put_line(LAST);
      8  EXCEPTION
      9    WHEN no_data_found THEN
    10    dbms_output.put_line('There is no one employee with such first name!');
    11    WHEN too_many_rows THEN
    12    dbms_output.put_line('There are many employees with such first name, try with another one!');
    13  END FIND_EMPLOYEES;
    14  /
    Procedure created.
    SQL> SET SERVEROUTPUT ON
    SQL> EXEC FIND_EMPLOYEES('Julia')
    There are many employees with such first name, try with another one!
    PL/SQL procedure successfully completed.
    SQL> EXEC FIND_EMPLOYEES('Eugenia')
    There is no one employee with such first name!
    PL/SQL procedure successfully completed.
    SQL> EXEC FIND_EMPLOYEES('Adam')
    Fripp
    PL/SQL procedure successfully completed.Best regards
    Maxim

  • Can you reference package variables in a pl/sql object type

    I'm trying to create an object type and I would like to use a type from a pacakge definition as one of the parameters for a method in the object. I read that types defined inside a PL/SQL package cannot be used as parameter. Does anyone have a workaround for this?

    You could move the type definition out from the package to a schema level object type. Then you should be able to use the schema level object type in both your package and the new object you wish to create.
    Below is a short example of what I mean:
    -- The way I interpreted your question
    CREATE OR REPLACE PACKAGE foo_pkg
    AS
    TYPE foo_obj IS RECORD (
    f1 NUMBER
    ,f2 VARCHAR2 (10)
    in_pkg_foo_obj foo_obj;
    END foo_pkg;
    SHOW errors
    CREATE OR REPLACE TYPE newFooObj IS OBJECT (
    f1 NUMBER
    ,f2 VARCHAR2 (3)
    ,f3 DATE
    ,MEMBER FUNCTION getAllFoos (inFoo IN foo_pkg.foo_obj)
    RETURN NUMBER
    SHOW errors
    CREATE OR REPLACE TYPE BODY newFooObj
    AS
    MEMBER FUNCTION getAllFoos (inFoo IN foo_pkg.foo_obj)
    RETURN NUMBER
    IS
    BEGIN
    RETURN 1;
    END;
    END;
    SHOW errors
    -- Clean up
    DROP PACKAGE foo_pkg;
    DROP TYPE newFooObj;
    -- Now try it with a schema level object type
    CREATE OR REPLACE TYPE foo_obj IS OBJECT (
    f1 NUMBER
    ,f2 VARCHAR2 (10)
    CREATE OR REPLACE PACKAGE foo_pkg
    AS
    in_pkg_foo_obj foo_obj;
    END foo_pkg;
    SHOW errors
    CREATE OR REPLACE TYPE newFooObj IS OBJECT (
    f1 NUMBER
    ,f2 VARCHAR2 (3)
    ,f3 DATE
    ,MEMBER FUNCTION getAllFoos (inFoo IN foo_obj)
    RETURN NUMBER
    SHOW errors
    CREATE OR REPLACE TYPE BODY newFooObj
    AS
    MEMBER FUNCTION getAllFoos (inFoo IN foo_obj)
    RETURN NUMBER
    IS
    BEGIN
    RETURN 1;
    END;
    END;
    SHOW errors
    DROP PACKAGE foo_pkg;
    DROP TYPE newFooObj;
    Bob

Maybe you are looking for

  • Installing Adobe Flash Player 10.0.42 Plugin for Firefox 3.5.7

    I currently have Firefox 3.5.7 installed and am trying to access a site that requires the current version of Adobe Flash Player (10.0.42). When I download and install it, the website still doesn't recognize flash player being installed. I go to Adobe

  • Blank adobe form displayed in  web dynpro application

    Hi,              I have created an Interactive Adobe form using web dynpro Java. When I run the form (in IE), a blank page is displayed. If I keep the Adobe reader open and run the form on IE, the form is opened in reader and it's working. When I acc

  • RoboHelp 9 editing on the network

    I remember back when we were using RoboHelp 5 that we were warned against working on RoboHelp projects on the network. It was advised to always copy the project folder to your desktop. We are using RoboHelp 9 now, and it was asked why we are not work

  • I am studying abroad in Chile, and my hardware is failing on me.

    Specifically, there are red lines across the screen. I know it's either the logic board or graphics card because I just had my logic board and other parts replaced last November 2013 when this same thing happened. I have no idea what to do seeing as

  • Volume bar and progression bar WILL NOT display durring music

    For some odd reason when I turn music on all I get is five little dots, and they don't even fill up or empty as I turn the wheel. I can turn volume up and fastforward music and such, but it won't display either bars. Only these five circles. I've had