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 ;

Similar Messages

  • 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

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

  • Problem With Cutom Configuration with Object Type

    Dear Guru's
    I am working WebUI, I am facing a problem with Custom Configuration.
    1. The initial requirement to control the visibility for a dropdown event in ERP Quotation.
    2. To this i copied the default configuration to custom configuration with custom Object type and Subtype.
           CONFIG KEY: ZPJQTN
           OBJECT TYPE: ZOTYP_CONFIG
           OBJECT SUB TYPE:  ZSTYPE_CONFIG1
    3. I have created customm fields in enhancement.
    4. Now i chosen my new configuration (ZPJQTN,ZOTYP_CONFIG,ZSTYP_CONFIG1), when i click Show available fields, the custom fields are not showing. Instead the created fields are available at other configuration.
    5. I am able to control the visibility for the standard available fields.But i am not getting the custom created fields
    (Note:  I have created the Object type and Object sub type as follows: SPRO->CRM->UI Framework->Define Object Types
    Object type: ZOTYP_CONFIG Callback class: ZCL_CONFIG_CALLBACK
    Redifned the method: IF_BSP_DLC_OBJ_TYPE_CALLBACK~GET_OBJECT_SUB_TYPES
    Coded as below:
      data: lv_subtype type bsp_dlc_object_sub_type.
      lv_subtype = 'ZSTYP_CONFIG1'.
      append lv_subtype to result.
      lv_subtype = 'ZSTYP_CONFIG2'.
      APPEND lv_subtype to result.
    Now Please suggest me how to achieve this.
    Also please let me know, whether i am following the correct procedure for controlling the visibility.
    Thanks in Advance,
    S.Meganadhan.

    Hi Harshit,
    I added custom fields using AET only.
    I am able to see the field got added in the structure. I am able to access GET and SET methods of the field.
    But the problem is, it is not getting saved. Am i missed any configuration step?
    Please suggest me.
    Thanks in advance,
    Regards,
    S.Meganadhan.

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

  • XDB Native Web Services - Collection of object types

    Hello,
    my DB 11g (11.1.0.6.0) is enabled to use XDB Native Web Services, everything works as it should. I already use it successfully to publish a web service with object types as OUT parameter. They are created as complex types in the XML response as described here: [http://download.oracle.com/docs/cd/B28359_01/appdev.111/b28369/xdb_web_services.htm#CHDGBFID]
    But what I need is a collection of these object types, e.g.
    I have a type FLIGHT with some information elements (departure, arrival, date, time, price) and I have a web service function GET_AVAILABILITY with parameters departure, arrival and date. What I want is to return a collection of FLIGHT objects, it could be none, one or many flights for a request.
    For the moment I create another object type which contains a fix number of FLIGHT objects to work around the collection issue:
    create flight_tab_typ as object (
    fl1 flight_typ
    ,fl2 flight_typ
    ,fl3 flight_typ
    I tried to build a PL/SQL table of object type and also a VARRAY of object type but for both the WSDL of the web service cannot be build up correctly in the web browser. For me it seems that this is not supported by the Native Web Services.
    I know I can build up my own XMLTYPE with XML structure as OUT parameter but to use object types is much easier and it builds up the XML structure automatically.
    Does anybody know how to use collections (VARRAY or PL/SQL Tables) with the Native XML DB Web Services?
    Thanks,
    Andreas

    Hi flea,
    I use complex types with XDB native webservices. Here is an example. Using people/groups objects. I haven't compiled this so there may be some typos etc, but it should give you the idea.
    Beware!I have had problems with the created WSDL file in that it doesn't always include the namespace from all types. In many client packages ( JDevloper , SOAPUI etc) this causes a wsdl import failure.
    You can add the missing namespace by hand a load the WSDL file locally and then it should work. I haven't raised an SR with Oracle about this yet.
    Assume you create the following under SCoTT schema on machine host.com on port 8080.
    The webservice[WSDL] will be available from
    http://host.com:8080/orawsv/SCOTT/WEBSERVCIES/GET_GROUP[?wsdl]
    For other peoples sanity it took me a little while to realise the WSDL url is case specific. E.g. the schema, package and functions have to be UPPER case.
    create table people_groups_tab (group_name varchar2(40 char),first_name varchar2(40 char),last_name varchar2(40 char))
    insert into people_groups_tab values ('FINANCE','Joe','Bloggs')
    insert into people_groups_tab values ('FINANCE','Bob','Jones')
    insert into people_groups_tab values ('IT','Alan','Andrews')
    create or replace type person_obj
    as object
         first_name people_groups_tab.first_name%type
         ,last_name people_groups_tab.last_name%type
    create or replace type people_obj
    as table of person_obj
    create or replace type people_groups_obj
    as object
    group_name varchar2(40 char)
    people people_obj
    create or replace package webservices
    as
              function get_group
         p_group_name varchar2
              ) return people_groups_obj;
    end;
    create or replace package body webservices
    as
              function get_group
         p_group_name varchar2
              ) return people_groups_obj
    as
    l_group people_groups_obj;
              l_people people_obj;
    begin
              select person_obj
                        first_name
                        ,last_name
              bulk collect into l_people
              from people_groups_tab
              where group_name p_group_name;
              l_group := people_groups_obj(p_group_name,l_people);
              return l_group;
    end;
    end;
    /

  • Error in creation of Object Type from XML passed

    Hi,
    I am facing a problem creating a appropriate a object type for a XML.
    Below are the details:
    XML Passed
    <mer_offer_action_data>
    <form_id>
    134039588
    </form_id>
    <action_cd>
    OA
    </action_cd>
    <offer_decline_reason_cd>
    </offer_decline_reason_cd>
    <start_dt>
    </start_dt>
    <candidate>
    <ds_prs_id>
    109315
    </ds_prs_id>
    <ds_prs_id>
    110534
    </ds_prs_id>
    <ds_prs_id>
    110059
    </ds_prs_id>
    </candidate>
    </mer_offer_action_data>
    Types Declaration
    +CREATE OR REPLACE type MER_OFF_CANDIDATE
    AS
    OBJECT
    DS_PRS_ID NUMBER
    CREATE OR REPLACE TYPE MER_OFF_CANDIDATE_t
    AS
    TABLE OF MER_OFF_CANDIDATE;
    CREATE OR REPLACE type MER_OFFER_ACT_DATA
    AS
    OBJECT
    FORM_ID NUMBER,
    ACTION_CD VARCHAR2(6),
    OFFER_DECLINE_REASON_CD VARCHAR2(6),
    START_DT VARCHAR2(11),
    CANDIDATE MER_OFF_CANDIDATE_t
    CREATE OR REPLACE TYPE MER_OFFER_ACT_DATA_t
    AS
    TABLE OF MER_OFFER_ACT_DATA;
    CREATE OR REPLACE type MER_OFFER_ACTION_DATA
    AS
    OBJECT
    MER_OFF_ACT_DATA MER_OFFER_ACT_DATA_t
    /+
    My Declaration
    +merOffActDataXML      xmltype;
    merOffActData     MER_OFFER_ACTION_DATA := MER_OFFER_ACTION_DATA(MER_OFFER_ACT_DATA_t());+
    Inside Pl/SQL block
    +-- Converts XML data into user defined type for further processing of data
    xmltype.toobject(merOffActDataXML,merOffActData);+
    when I run the Pl/Sql block it gives me error
    ORA-19031: XML element or attribute FORM_ID does not match any in type ORADBA.MER_OFFER_ACTION_DATA
    which means the object type mapping is wrong
    I would like to know whether the object type I had created is correct or not.
    Thanks for your help
    Beda

    Bedabrata Patel wrote:
    Below are the details:The details except for a description of the problem
    I am facing a problem creating a appropriate a object type for a XML.And which error you are getting
    Error in creation of Object Type http://download.oracle.com/docs/cd/E11882_01/server.112/e10880/toc.htm
    And which version of Oracle you are getting the unknown error creating the unknown problem.

  • Error in creation of Object Type

    Hi,
    I am facing a problem creating a appropriate a object type for a XML.
    Below are the details:
    XML Passed
    <mer_offer_action_data>
         <form_id>
              134039588
         </form_id>
         <action_cd>
              OA
         </action_cd>
         <offer_decline_reason_cd>
         </offer_decline_reason_cd>
         <start_dt>
         </start_dt>
         <candidate>
              <ds_prs_id>
                   109315
              </ds_prs_id>
              <ds_prs_id>
                   110534
              </ds_prs_id>
              <ds_prs_id>
                   110059
              </ds_prs_id>
         </candidate>
    </mer_offer_action_data>
    Types Declaration
    +CREATE OR REPLACE type MER_OFF_CANDIDATE
    AS
    OBJECT
    DS_PRS_ID NUMBER
    CREATE OR REPLACE TYPE MER_OFF_CANDIDATE_t
    AS
    TABLE OF MER_OFF_CANDIDATE;
    CREATE OR REPLACE type MER_OFFER_ACT_DATA
    AS
    OBJECT
    FORM_ID NUMBER,
    ACTION_CD VARCHAR2(6),
    OFFER_DECLINE_REASON_CD VARCHAR2(6),
    START_DT VARCHAR2(11),
    CANDIDATE MER_OFF_CANDIDATE_t
    CREATE OR REPLACE TYPE MER_OFFER_ACT_DATA_t
    AS
    TABLE OF MER_OFFER_ACT_DATA;
    CREATE OR REPLACE type MER_OFFER_ACTION_DATA
    AS
    OBJECT
    MER_OFF_ACT_DATA MER_OFFER_ACT_DATA_t
    /+
    My Declaration
         +merOffActDataXML          xmltype;
         merOffActData          MER_OFFER_ACTION_DATA := MER_OFFER_ACTION_DATA(MER_OFFER_ACT_DATA_t());+
    Inside Pl/SQL block
         +-- Converts XML data into user defined type for further processing of data
         xmltype.toobject(merOffActDataXML,merOffActData);+
    Thanks for your help
    Beda
    Edited by: Bedabrata Patel on Jul 12, 2010 5:51 AM

    Bedabrata Patel wrote:
    Below are the details:The details except for a description of the problem
    I am facing a problem creating a appropriate a object type for a XML.And which error you are getting
    Error in creation of Object Type http://download.oracle.com/docs/cd/E11882_01/server.112/e10880/toc.htm
    And which version of Oracle you are getting the unknown error creating the unknown problem.

  • Object Type 10 donu00B4t showed in CFL

    Hi all,
    I have a problem with cfl over OCRG (object type 10)
    My code in .srf file is the following:
    <userdatasources>
    <action type="add">
        <datasource uid="udsCliente" type="9" size="254"></datasource>
        <datasource uid="udsCadena" type="1"></datasource>
    </action>
    </userdatasources>
    <item uid="txCliente" ....>
        <AutoManagedAttribute></AutoManagedAttribute>
        <specific TabOrder="0" ChooseFromListUID="cflOCRD" 
                                      ChooseFromListAlias="CardName">
             <databind databound="1" table="" alias="udsCliente"></databind>
         </specific>
    </item>
    <item uid="txCadena" type="16" ....>
        <AutoManagedAttribute></AutoManagedAttribute>
        <specific TabOrder="1" ChooseFromListUID="cflOCRG"  
                                          ChooseFromListAlias="GroupCode">
            <databind databound="1" table="" alias="udsCadena"></databind>
        </specific>
    </item>
    <ChooseFromListCollection><action type="add">
          <ChooseFromList UniqueID="cflOCRD" ObjectType="2" MultiSelection="0" IsSystem="0"></ChooseFromList>
          <ChooseFromList UniqueID="cflOCRG" ObjectType="10" MultiSelection="0" IsSystem="0"></ChooseFromList>
    </action>
    </ChooseFromListCollection>
    Note: In txcliente a cfl works fine (over bussinessPartners), however in txCadena (over BussinesPartner Groups not showed)
    What I´m wrong? (It´s seems a type of udsCadena... i´m trying with several types but still wrong)
    Thanks in advanced and Kinds Regards

    Hi Alejandro,
    I have tried to give it a try and cannot make it work.
    As this object is new maybe there is something missing on it that blocks the CFL from working.
    Please create a message for support asking for it. And if you can share your findings in here.
    Best Regards
    Trinidad.

  • TYPE OR TABLE DEPENDENCY OF OBJECT TYPE (ORA-2303)

    제품 : SQL*PLUS
    작성날짜 : 2004-05-20
    ==================================================
    TYPE OR TABLE DEPENDENCY OF OBJECT TYPE (ORA-2303)
    ==================================================
    PURPOSE
    Type이나 table의 dependency가 있는 type을 drop하거나 replace하고자
    하면 ORA-02303 error가 난다. 이 error의 원인을 알아보도록 한다.
    Explanation
    Object의 attribute나 method를 수정하기 위해서는 object type을 drop하고 재생성
    해야 한다. Type이나 table의 dependency가 있는 type을 drop하거나 replace하고자
    하면 ORA-02303 error가 난다. Object type은 type (nested table 또는 VARRAY)
    또는 object table로써 구체적으로 표현된다. 만약 data의 보존이 필요하다면
    temporary table에 manual하게 옮겨놓아야 한다.
    SQL Reference guide에 의하면 DROP TYPE FORCE 옵션은 recommend하지 않는다.
    왜냐하면 이 옵션을 쓰게 되면 복구가 불가능하고 dependency가 있던 table들은
    access하지 못하는 결과를 초래한다.
    Example
    아래의 query 1, 2, 3은 dependency을 확인하는 query문이다.
    1. Find nested tables
    select owner, parent_table_name, parent_table_column
    from dba_nested_tables
    where (table_type_owner, table_type_name) in
    (select owner, type_name
    from dba_coll_types
    where elem_type_owner = '<typeOwner>'
    and elem_type_name = '<typeName>');
    2. Find VARRAYs
    select owner, parent_table_name, parent_table_column
    from dba_varrays
    where (type_owner, type_name) in
    (select owner, type_name
    from dba_coll_types
    where elem_type_owner = '<typeOwner>'
    and elem_type_name = '<typeName');
    3. Find object tables
    select owner, table_name
    from dba_object_tables
    where table_type_owner = '<typeOwner>'
    and table_type = '<typeName>'
    and nested = 'NO';
    Example ) Logon as Scott
    /* Create an user defined object type */
    SQL> create type object_type as object (
    col1 number,
    col2 varchar2(20))
    Type created.
    /* Create nested table type */
    SQL> create type object_ntable as table of object_type
    Type created.
    /* Create varray type*/
    SQL> create type object_varray as varray(5) of object_type
    Type created.
    /* Create parent table with nested table and varray */
    SQL> create table master (
    col1 number primary key,
    col2_list object_ntable,
    col3_list object_varray)
    nested table col2_list store as master_col2
    Table created.
    /* Create object table */
    SQL> create table object_table of object_type (col1 primary key)
    object id primary key;
    Table created.
    ORA-2303 results if attempt to drop type with dependencies
    SQL> drop type object_type;
    drop type object_type
    ERROR at line 1:
    ORA-02303: cannot drop or replace a type with type or table dependents
    위의 queery 1,2,3을 이용하여 object type dependency을 확인한다.
    -- Find nested tables utilizing object type
    SQL> select owner, parent_table_name, parent_table_column
    from dba_nested_tables
    where (table_type_owner, table_type_name) in
    (select owner, type_name
    from dba_coll_types
    where elem_type_owner = 'SCOTT'
    and elem_type_name = 'OBJECT_TYPE');
    OWNER PARENT_TABLE_NAME PARENT_TABLE_COLUMN
    SCOTT MASTER COL2_LIST
    -- Find VARRAYs utilizing object type
    SQL> select owner, parent_table_name, parent_table_column
    from dba_varrays
    where (type_owner, type_name) in
    (select owner, type_name
    from dba_coll_types
    where elem_type_owner = 'SCOTT'
    and elem_type_name = 'OBJECT_TYPE');
    OWNER PARENT_TABLE_NAME PARENT_TABLE_COLUMN
    SCOTT MASTER COL3_LIST
    -- Find object tables
    SQL> select owner, table_name
    from dba_object_tables
    where table_type_owner = 'SCOTT'
    and table_type = 'OBJECT_TYPE'
    and nested = 'NO';
    OWNER TABLE_NAME
    SCOTT OBJECT_TABLE
    참고)
    bulletin : 11576 처럼 utility을 이용하는 방법이 있다.
    우리는 여기서 주의하여야 할 것은 script $ORACLE_HOME/rdbms/admin/utldtree.sql
    을 내가 보고자 하는 user에서 돌려야 한다는 것이다.
    $sqlplus scott/tiger
    SQL> @$ORACLE_HOME/rdbms/admin/utldtree.sql
    SQL> exec deptree_fill('TYPE','SCOTT','OBJECT_TYPE');
    PL/SQL procedure successfully completed.
    SQL> select * from ideptree;
    DEPENDENCIES
    TYPE SCOTT.OBJECT_TYPE
    TYPE SCOTT.OBJECT_NTABLE
    TABLE SCOTT.MASTER
    TYPE SCOTT.OBJECT_VARRAY
    TABLE SCOTT.MASTER
    TABLE SCOTT.MASTER_COL2
    TABLE SCOTT.OBJECT_TABLE
    Reference Documents
    Korean bulletin : 11576
    <Note:69661.1>

    Hi Carsten,
    Thanks for the sharp hint. It works.
    However, when I create a table using the schema, it gives me this error:
    varray DOC."LISTOFASSIGNEDNUMBER"."ASSIGNEDNUMBER"
    ERROR at line 14:
    ORA-02337: not an object type column
    Here is the script:
    CREATE TABLE CUSTOMMANIFEST (
    ID NUMBER PRIMARY KEY,
    DOC sys.XMLTYPE
    xmltype column doc
    XMLSCHEMA "http://www.abc.com/cm.xsd"
    element "CustomManifest"
    varray DOC."LISTOFMANIFESTPORTINFO"."MANIFESTPORTINFO"
    store as table MANIFESTPORTINFO_TABLE
    (primary key (NESTED_TABLE_ID, ARRAY_INDEX))
    organization index overflow
    varray DOC."LISTOFASSIGNEDNUMBER"."ASSIGNEDNUMBER"
    store as table ASSIGNEDNUMBER_TABLE
    (primary key (NESTED_TABLE_ID, ARRAY_INDEX))
    organization index overflow
    LISTOFASSIGNEDNUMBER itself is complexType and not sure where is the error....
    You may note there are more than two hierachy/levels...
    Thanks.

  • Invoking stored procedure that returns array(oracle object type) as output

    Hi,
    We have stored procedures which returns arrays(oracle type) as an output, can anyone shed some light on how to map those arrays using JPA annotations? I tried using jdbcTypeName but i was getting wrong type or argument error, your help is very much appreciated. Below is the code snippet.
    JPA Class:
    import java.io.Serializable;
    import java.sql.Array;
    import java.util.List;
    import javax.persistence.Entity;
    import javax.persistence.Id;
    import org.eclipse.persistence.annotations.Direction;
    import org.eclipse.persistence.annotations.NamedStoredProcedureQuery;
    import org.eclipse.persistence.annotations.StoredProcedureParameter;
    * The persistent class for the MessagePublish database table.
    @Entity
    @NamedStoredProcedureQuery(name="GetTeamMembersDetails",
         procedureName="team_emp_maintenance_pkg.get_user_team_roles",
         resultClass=TeamMembersDetails.class,
         returnsResultSet=true,
         parameters={  
         @StoredProcedureParameter(queryParameter="userId",name="I_USER_ID",direction=Direction.IN,type=Long.class),
         @StoredProcedureParameter(queryParameter="employeeId",name="I_EMPLOYEEID",direction=Direction.IN,type=Long.class),
         @StoredProcedureParameter(queryParameter="TEAMMEMBERSDETAILSOT",name="O_TEAM_ROLES",direction=Direction.OUT,jdbcTypeName="OBJ_TEAM_ROLES"),
         @StoredProcedureParameter(queryParameter="debugMode",name="I_DEBUGMODE",direction=Direction.IN,type=Long.class)
    public class TeamMembersDetails implements Serializable {
         private static final long serialVersionUID = 1L;
    @Id
         private long userId;
         private List<TeamMembersDetailsOT> teamMembersDetailsOT;
         public void setTeamMembersDetailsOT(List<TeamMembersDetailsOT> teamMembersDetailsOT) {
              this.teamMembersDetailsOT = teamMembersDetailsOT;
         public List<TeamMembersDetailsOT> getTeamMembersDetailsOT() {
              return teamMembersDetailsOT;
    Procedure
    PROCEDURE get_user_team_roles (
    i_user_id IN ue_user.user_id%TYPE
    , o_team_roles OUT OBJ_TEAM_ROLES_ARRAY
    , i_debugmode IN NUMBER :=0)
    AS
    OBJ_TEAM_ROLES_ARRAY contains create or replace TYPE OBJ_TEAM_ROLES_ARRAY AS TABLE OF OBJ_TEAM_ROLES;
    TeamMembersDetailsOT contains the same attributes defined in the OBJ_TEAM_ROLES.

    A few things.
    You are not using a JDBC Array type in your procedure, you are using a PLSQL TABLE type. An Array type would be a VARRAY in Oracle. EclipseLink supports both VARRAY and TABLE types, but TABLE types are more complex as Oracle JDBC does not support them, they must be wrapped in a corresponding VARRAY type. I assume your OBJ_TEAM_ROLES is also not an OBJECT TYPE but a PLSQL RECORD type, this has the same issue.
    Your procedure does not return a result set, so "returnsResultSet=true" should be "returnsResultSet=false".
    In general I would recommend you change your stored procedure to just return a select from a table using an OUT CURSOR, that is the easiest way to return data from an Oracle stored procedure.
    If you must use the PLSQL types, then you will need to create wrapper VARRAY and OBJECT TYPEs. In EclipseLink you must use a PLSQLStoredProcedureCall to access these using the code API, there is not annotation support. Or you could create your own wrapper stored procedure that converts the PLSQL types to OBJECT TYPEs, and call the wrapper stored procedure.
    To map to Oracle VARRAY and OBJECT TYPEs the JDBC Array and Struct types are used, these are supported using EclipseLink ObjectRelationalDataTypeDescriptor and mappings. These must be defined through the code API, as there is currently no annotation support.
    I could not find any good examples or doc on this, your best source of example is the EclipseLink test cases in SVN,
    http://dev.eclipse.org/svnroot/rt/org.eclipse.persistence/trunk/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/plsql/
    http://dev.eclipse.org/svnroot/rt/org.eclipse.persistence/trunk/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/customsqlstoredprocedures/
    James : http://www.eclipselink.org

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

  • 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

  • S/A bridge problem: No object type found for the message

    Hi all,
    I've been spending days looking into the following problem. I have a RFCXIFile scenario. The R3 system sends data via an RFC to XI and XI post the data as a flat file on a certain server using FTP.
    This scenario worked just fine for 1 exception. I could only run this scenario once. The second time I got timeouts when checking the data sent to my RFC destination using SM58. When I reactivated my RFC communcation channel I could again send 1 RFC to the system. All subsequent tries would fail.
    I guess this is due to the fact that I use a synchonous call (RFC) to an asynchronous one. Thus the adapter is still waiting for the response from the XI system and will not accept any further new calls from R3.
    So I figure let's use this pattern called the S/A bridge. So I designed everything according to guides and examples and I'm quite certain everything is configured right but when I run the scenario I get the following message:
    <i> <!--  Call Adapter
      -->
    - <SAP:Error xmlns:SAP="http://sap.com/xi/XI/Message/30" xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/" SOAP:mustUnderstand="">
      <SAP:Category>XIAdapter</SAP:Category>
      <SAP:Code area="BPE_ADAPTER">UNKNOWN_MESSAGE</SAP:Code>
      <SAP:P1 />
      <SAP:P2 />
      <SAP:P3 />
      <SAP:P4 />
      <SAP:AdditionalText />
      <SAP:ApplicationFaultMessage namespace="" />
      <SAP:Stack>No object type found for the message. Check that the corresponding process is activated</SAP:Stack>
      <SAP:Retry>M</SAP:Retry>
      </SAP:Error></i>
    It seems that the adapter cannot find any integration process to send the message into!?
    I've looked at numerous threads on sdn and tried all kinds of stuff (looked at the cache==> code 0 = OK , tried to reactivate my integration process, checked the interface determination,...), but to no avail. Does anybody has an idea what could be wrong ?
    Any help would be greatly appreciated for I'm all out of clues....
    Bob

    First of all, Thank you for trying to help me out here.
    Some answer to your suggestions/questions:
    The IP has return code 0 in SXI_CACHE. so that doesn't seem to be the problem.
    I've checked the BPM for syntax errors. I doesn't have any.
    I've reimported the BPM into the integration directory.
    And did a full cache refresh in SXI_CACHE. Return code is (stays) zero, so that's OK.
    I've already included the error message from SXI_MONI. It is in the last step ("Call Adater") that the error occurs.
    The other steps execute just fine...
    The RFC communcation channel accepts the incoming RFC call and puts into the pipeline, so no problems with the communication channel either. the problem is actually when the pipeline is trying to forward the message into an IP trhough the BPE_ADAPTER (according to SXMB_MONI).
    Therefore I'm not able to go to into PE, because the workflow is never started. the BPE_ADAPTER does not find any active process for the interface determination i've entered.
    So i can not debug the IP in the PE and check container variables, like some of you mentioned.
    Maybe some more information about the scenario:
    The RFC is called from an R3 system to XI over the interface "CONTROL_RECIPE_DOWNLOAD", which is an imported RFC, with a request and response message type.
    Then I got a receiver and interface determination with lead the incoming RFC message to the IP, into interface "XI_ERP_MF_MD_CONTROL_RECIPE_REQ_AI_MI".
    This is an abstract synchronous interface based on the request and response types of the "CONTROL_RECIPE_DOWNLOAD" imported RFC.
    This interface is used the first step (receive) of my BPM as the synchronous interface to open the S/A bridge.
    The message (container var)  used in this step is
    name: CORREQ
    Category: Abstract interface
    type: "XI_ERP_MF_MD_CONTROL_RECIPE_REQ_AI_MI"
    The interface "XI_ERP_MF_MD_CONTROL_RECIPE_REQ_AI_MI" is an abstract, asynchronous interface based on the request type of the "CONTROL_RECIPE_DOWNLOAD".
    Then there are 2 send steps for putting the flat files into place and finally i close the the S/A bridge using message:
    name: CORRES
    Category: Abstract interface
    type: "XI_ERP_MF_MD_CONTROL_RECIPE_RES_AI_MI"
    The interface "XI_ERP_MF_MD_CONTROL_RECIPE_RES_AI_MI" is an abstract, asynchronous interface based on the response type of the "CONTROL_RECIPE_DOWNLOAD".
    I hope this information gives you guys a better understanding of hte problem.
    Really looking forward to see more suggestions and to solve this nasty problem ...
    Regards,
    Bob

  • Problem with decimal data visualization in a circular graphic object type

    When we are design a report using Crystal Reports 2008 we found the following problem. When we insert an object of type circle graphic selecting the option in the graphics wizard for view in the legend data both in value and percentage (u2018bothu2019 design) we cant show them in a two decimals format at the same time.
    Using the option u2018number formatu2019 and indicating two decimals only affects the value but not the percentage.
    Show both the value and the percentage with two decimals at same time itu2019s a necessary requirement for our report design.
    Is there any way to show both the value and the percentage in a circle graphic object with two decimals at the same time?
    Thanks.

    hello Jose,
    i am not sure what you mean by "circular graphic object type".
    there's nothing in the standard cr 2008 build that has this that i've ever found that creates a circle other than inserting a box and changing the rounding on the corners. if you're using a 3rd party product or add-on you'll need to contact whoever built it.
    cheers,
    jamie

Maybe you are looking for

  • Postfix error after update to 10.6.8

    Dear readers and admins After I did update SLS from 10.6.7 to 10.6.8, I got a problem with postfix smtp server. I did google around and found some note, that it is a problem, that a launchd org.postfix.master is running and thath's why the com.apple.

  • ISE: create rules with AD groups for Users and Computers

    Hello, We've just begun to work with ISE. Is it the good place to post on ISE, or there is a dedicated forum in another place? We'd like to create some rule depending of Computer member groups AND Users member groups from AD, but we meet some difficu

  • Selling Plugins and External SDK

    Hello I have developed plugins for illustrator in the past for internal use in my company. Now I plan to create a product that has to interact with AI and PSD files (analyzing them, changing them etc...) I appreciate if anyone can refer me to legal p

  • SDK to change the settings of Notifications under Schedule

    Post Author: Galen Chen CA Forum: Administration Hi everyone, Not sure if anybody knows more about the BOE's Notifications object. The question I have is that I found we can change the notifications settings through Central Management Console which i

  • SAP Enterprise Services: Configuration Date

    I need the configuration dates for SAP Enterprise Services. Case: my team of APO BPXs has done an analysis of available SAP Enterprise Services using ES Workplace on March 4th. and 5th. But there was the update of APO from 5.0 to 7.0. Therefore I nee