Mapping of PLSQL  table type  Date to java

i am having problem in mapping plsql table type DATE in java,
able to execute procedures which return plsql table type NUMBER,VARCHAR.
i am using oracle 9 , jdk1.4, oci driver, windows 2000.
sample code:
registering:
st.registerIndexTableOutParameter(15,100,OracleTypes.DATE,1000);
st.registerIndexTableOutParameter(16,100,OracleTypes.DATE,1000);
st.execute();
getting out params in arrays:
java.sql.Date[] O_lSubFolder_CrOn=(java.sql.Date[])java.sql.Date[] st.getPlsqlIndexTable(15);
O_lSubFolder_MdOn=(java.sql.Date[])st.getPlsqlIndexTable(16);
error while executing the code:
java.sql.SQLException: Invalid PL/SQL Index Table element type
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:180)
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:222)
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:285)
at oracle.jdbc.driver.OraclePreparedStatement.checkPlsqlIndexTableBindTypes(OraclePreparedSt
atement.java:2705)
at oracle.jdbc.driver.OracleCallableStatement.registerIndexTableOutParameter(OracleCallableS
tatement.java:834)
can anyone help me to solve this problem.

i am having problem in mapping plsql table type
DATE in java,
able to execute procedures which return plsql table
type NUMBER,VARCHAR.
i am using oracle 9 , jdk1.4, oci driver, windows
2000.
sample code:
registering:
st.registerIndexTableOutParameter(15,100,OracleTypes.D
TE,1000);
st.registerIndexTableOutParameter(16,100,OracleTypes.D
TE,1000);
st.execute();
getting out params in arrays:
java.sql.Date[]
O_lSubFolder_CrOn=(java.sql.Date[])java.sql.Date[]
st.getPlsqlIndexTable(15);
O_lSubFolder_MdOn=(java.sql.Date[])st.getPlsqlIndexTab
e(16);
can anyone help me to solve this problem.1. Write a wrapper procedure that converts the table of dates to either number or date and then re-convert the table back into date.
2. Since it's an out param you could create a temp table, insert the contents of the index by array into it and return a cursor.
3. Create a oracle type using CREATE TYPE and then use an array of the type.
David Rolfe
Orinda Software

Similar Messages

  • Report based on plsql table type

    Is it possible crete a report (updatable) based on plsql table type?
    thank in advance
    Franco Galante

    Sorry for my cryptic question, i wanted to mean create a report based on a stored procedure
    function which return a plsql table type variable.
    This idea could give me the chance to work with variable (plsql table) instead of db table.
    hope i'm enough clear
    thank you again
    Franco Galante

  • Best to use in terms of tuning Global Temporary table or PLSQL Table type

    Hi All,
    which one is best to use in terms of tuning Global Temporary table or PLSQL table type?
    Thanks in Advance.
    Regards
    Deepika

    user8828028 wrote:
    which one is best to use in terms of tuning Global Temporary table or PLSQL table type?The answer to which one is better depends on the requirements - and an informed decision as to which one to use to address those requirements.
    Thus it is important to understand how these work. They are nothing alike.
    PL/SQL collections reside in the PGA. Can only be used in SQL via binding. Cannot be indexed. Temp tables on the other hand does not use expensive PGA. Does not need to be bind in SQL. Can be indexed. Etc.
    Sure, a (surgical) saw and scalpel are both used on the operating table - but for very different purposes.

  • How to retrieve values in XML into a plsql table type

    Hi
    I have an XML doc like below which is a Web Service response message.
    <?xml version="1.0" encoding="UTF-8"?>
    <SOAP-ENV:Envelope
    xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <SOAP-ENV:Body>
    <GetOrgInput xmlns="http://www.example.org/ComplianceServices">
    <ProgramName>PgmA-PgmB</ProgramName>
    <ItemName>800 ADSL</ItemName>
    <Orgs>923</Orgs>
    <Orgs>1163</Orgs>
    <Orgs>1103</Orgs>
    </GetOrgInput>
    </SOAP-ENV:Body>
    </SOAP-ENV:Envelope>
    From the above doc you could see that i have multiple occurrences of "Orgs" element. Usually i am using the .extract and .getSTringVal() to retrieve the values as below.
    l_string_variable := p_response.doc.extract('//'||p_name||'/child::text()',p_namespace).getStringVal();
    But in this case if i do that, i am getting value as 92311631103. I need to get them into a table type of number. Pls advice me on how to achieve this.
    Thanks
    PKV

    I'm guessing this is a bug that Oracle fixed when 10.2 came out. I can reproduce your lack of results on 10.1.0.4 and as my post above shows, it works correctly on 10.2.0.4.
    Here's a modification to the script that shows what is going on as I was debugging this. (It took me a bit to realize the difference as it wasn't what I was expecting)
    declare
       p_response_doc XMLTYPE;
       l_new_doc      XMLTYPE;
    begin
       p_response_doc := XMLTYPE('<?xml version="1.0" encoding="UTF-8"?>
    <soapenv:Envelope
    xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
    <soapenv:Body>
    <GetOrgOutput xmlns="http://www.example.org/ComplianceServices">
    <CompliantOrgs>1163</CompliantOrgs>
    <CompliantOrgs>1103</CompliantOrgs>
    </GetOrgOutput>
    </soapenv:Body>
    </soapenv:Envelope>');
       SELECT p_response_doc.extract('/*/*/*/CompliantOrgs','xmlns="http://www.example.org/ComplianceServices"')
         INTO l_new_doc
          FROM dual;
       dbms_output.put_line(l_new_doc.getStringVal());
       dbms_output.put_line('before loop');
       FOR r_rec IN (SELECT value(t) val
    --   FOR r_rec IN (SELECT extractvalue(value(t)
    --      , '/CompliantOrgs'
    --      , 'xmlns="http://www.example.org/ComplianceServices"' ) val
          -- BULK COLLECT INTO l_nm_array
          FROM TABLE(
            XMLSequence(
              p_response_doc.extract('/*/*/*/CompliantOrgs','xmlns="http://www.example.org/ComplianceServices"')
            ) t
       ) LOOP
          dbms_output.put_line(r_rec.val.getStringVal());
    --      dbms_output.put_line(r_rec.val);
       END LOOP;
       dbms_output.put_line('After output');
    end;On 10.2.0.4 this produces
    <CompliantOrgs xmlns="http://www.example.org/ComplianceServices">1163</CompliantOrgs>
    <CompliantOrgs xmlns="http://www.example.org/ComplianceServices">1103</CompliantOrgs>
    before loop
    <CompliantOrgs xmlns="http://www.example.org/ComplianceServices">1163</CompliantOrgs>
    <CompliantOrgs xmlns="http://www.example.org/ComplianceServices">1103</CompliantOrgs>
    After outputOn 10.1.0.4 it produces
    <CompliantOrgs xmlns="http://www.example.org/ComplianceServices">1163</CompliantOrgs>
    <Complian tOrgs xmlns="http://www.example.org/ComplianceServices">1103</CompliantOrgs>
    before loop
    <CompliantOrgs>1163</CompliantOrgs>
    <CompliantOrgs>1103</CompliantOrgs>
    After outputAs you can see, Oracle is removing (well technically not adding) the default namespace to the extracted nodes. To compensate, you need to change your loop to look like
       FOR r_rec IN (SELECT extractvalue(value(t)
          , '/CompliantOrgs') val
    --      , 'xmlns="http://www.example.org/ComplianceServices"' ) val
          -- BULK COLLECT INTO l_nm_array
          FROM TABLE(
            XMLSequence(
              p_response_doc.extract('//CompliantOrgs','xmlns="http://www.example.org/ComplianceServices"')
            ) t
       ) LOOPso that extractValue is not expecting any namespaces associated with the nodes.
    I would suggest you document this so you will know why things break if you upgrade to 10.2 or later at some point in the future.

  • Creating variable of type of a PLSQL table type

    I have an object defined as
    create or replace type emp_rec as object (col1 date, col2 date);
    then I defined
    create or replace type data_emp_rec is table of emp_rec;
    Now I need to define a variable temp_rec which will host data returned of emp_rec structure.
    please advise how to define a variable to have data structure similar to that of emp_rec
    declare
    temp_rec emp_rec(null, null);
    or
    temp_rec data_emp_rec;
    Thx

    Hello
    It's all about casting data types and supplying the right data type to the bulk collect clause:
    SQL> SELECT
      2     usr.nm,
      3     perm.id,
      4     perm.descr
      5  FROM
      6     dt_test_user usr,
      7     dt_test_permission perm,
      8     dt_test_user_permission usr_perm
      9  WHERE
    10     usr.id = usr_perm.user_id
    11  AND
    12     perm.id = usr_perm.permission_id
    13  ORDER BY
    14     usr.nm
    15  /
    NM                                     ID DESCR
    Barry Bethel                            4 Be very enthusiastic about everything
    Barry Bethel                            2 Advertise slimming products
    Dr. Evil                                1 Take over the world
    Rolf Harris                             4 Be very enthusiastic about everything
    Rolf Harris                             3 Sing very strange songs
    SQL> select
      2     usr.id,
      3     usr.nm,
      4     CURSOR(select
      5                             p.user_id
      6                     from
      7                             dt_test_user_permission p
      8                     where
      9                             p.user_id = usr.id
    10                     ) pos_cursor
    11  from
    12     dt_test_user usr
    13  /
            ID NM                             POS_CURSOR
             1 Rolf Harris                    CURSOR STATEMENT : 3
    CURSOR STATEMENT : 3
       USER_ID
             1
             1
             2 Barry Bethel                   CURSOR STATEMENT : 3
    CURSOR STATEMENT : 3
       USER_ID
             2
             2
             3 Dr. Evil                       CURSOR STATEMENT : 3
    CURSOR STATEMENT : 3
       USER_ID
             3
    SQL> select
      2     usr.id,
      3     usr.nm,
      4     CAST(MULTISET(  select
      5                                                             p.user_id
      6                                                     from
      7                                                             dt_test_user_permission p
      8                                                     where
      9                                                             p.user_id = usr.id
    10                                             ) AS permissionList
    11                             ) pos_ntt
    12  from
    13     dt_test_user usr
    14  /
            ID NM                             POS_NTT(ID)
             1 Rolf Harris                    PERMISSIONLIST(PERMISSION_TYPE(1), PERMISSION_TYPE
                                              (1))
             2 Barry Bethel                   PERMISSIONLIST(PERMISSION_TYPE(2), PERMISSION_TYPE
                                              (2))
             3 Dr. Evil                       PERMISSIONLIST(PERMISSION_TYPE(3))
    SQL> declare
      2     ul userList;
      3  begin
      4     select
      5             usr.id,
      6             usr.nm,
      7             CAST(MULTISET(  select
      8                                                     p.user_id
      9                                             from
    10                                                     dt_test_user_permission p
    11                                             where
    12                                                     p.user_id = usr.id
    13                                     ) AS permissionList
    14                     ) pos_ntt
    15     bulk collect into
    16             ul
    17     from dt_test_user
    18             usr;
    19  end;
    20  /
            from dt_test_user
    ERROR at line 17:
    ORA-06550: line 17, column 2:
    PL/SQL: ORA-00947: not enough values
    ORA-06550: line 4, column 2:
    PL/SQL: SQL Statement ignored
    SQL> declare
      2     ul userList;
      3  begin
      4     select
      5             user_type(      usr.id,
      6                                     usr.nm,
      7                                     CAST(MULTISET(  select
      8                                                                             p.user_id
      9                                                                     from
    10                                                                             dt_test_user_permission p
    11                                                                     where
    12                                                                             p.user_id = usr.id
    13                                                             ) AS permissionList
    14                                             )
    15                             )
    16     bulk collect into
    17             ul
    18     from dt_test_user
    19             usr;
    20
    21  end;
    22  /
    PL/SQL procedure successfully completed.
    SQL> declare
      2     ul userList;
      3  begin
      4     select
      5             user_type(      usr.id,
      6                                     usr.nm,
      7                                     CAST(MULTISET(  select
      8                                                                             p.user_id
      9                                                                     from
    10                                                                             dt_test_user_permission p
    11                                                                     where
    12                                                                             p.user_id = usr.id
    13                                                             ) AS permissionList
    14                                             )
    15                             )
    16     bulk collect into
    17             ul
    18     from dt_test_user
    19             usr;
    20
    21     FOR li_Idx IN ul.FIRST..ul.LAST LOOP
    22
    23             dbms_output.put_line(ul(li_Idx).name);
    24
    25             FOR li_NttIdx IN ul(li_Idx).permissions.FIRST..ul(li_Idx).permissions.LAST LOOP
    26
    27                     dbms_output.put_line(ul(li_Idx).permissions(li_NttIdx).id);
    28
    29             END LOOP;
    30
    31     END LOOP;
    32
    33  end;
    34  /
    Rolf Harris
    1
    1
    Barry Bethel
    2
    2
    Dr. Evil
    3
    PL/SQL procedure successfully completed.HTH
    David

  • Accessing Table Type

    Hi All,
        In the code below WFAT_EMP_INT_EMPWA is a table type.
    For the function module 'WFA_EMP_DATA_GET' ,  ET_EMP_WORKAREA is an export parameter of type WFAT_EMP_INT_EMPWA
    For the function module 'WFA_EMP_DATA_MODIFY' , IT_EMP_WORKAREA is an import parameter of the same type.
    I need to get  the parameter from one function module and pass it to the next function module.
    Do i need to create a work area for the table type or can we simply define the table type and just pass it to the next FM as shown below.
    DATA: ITAB_WRKAREA TYPE WFAT_EMP_INT_EMPWA.
    DATA: itab_bapiret TYPE BAPIRET2_T,
          wa_bapiret TYPE LINE OF BAPIRET2_T.
    DATA: itab_bapiret1 TYPE BAPIRET2_T,
           wa_bapiret1 TYPE LINE OF BAPIRET2_T.
    FORM GET_WRKAREA_CODE.
      CALL FUNCTION 'WFA_EMP_DATA_GET'
        EXPORTING
          IV_EMP_BPID       = W_BUPNR
          IV_ORG_OBJID      = W_ORGEH
          IV_EFFECTIVE_WEEK = SY-DATUM
          IV_TEMPORARY      = GC_SPACE
        IMPORTING
          ET_EMP_WORKAREA   = ITAB_WRKAREA
          ET_RETURN         = itab_bapiret.
      LOOP AT itab_bapiret
      INTO wa_bapiret.
      WRITE :/ wa_bapiret-MESSAGE.
      ENDLOOP.
    ENDFORM.                    "get_wrkarea
    FORM TRANSFER_WRKAREA.
      CALL FUNCTION 'WFA_EMP_DATA_MODIFY'
        EXPORTING
          IV_EMP_BPID            = W_BUPNR
          IV_ORG_OBJID           = W_ORGEH
          IV_EFFECTIVE_WEEK      = SY-DATUM
          IS_EMP_INTERFACE_ADMIN = WA_WFAS_EMP_INT_ADMIN
         IT_EMP_WORKAREA        = ITAB_WRKAREA
        IMPORTING
          ET_RETURN              = itab_bapiret1.
          LOOP AT itab_bapiret1
          INTO wa_bapiret1.
          WRITE :/ wa_bapiret1-MESSAGE.
          ENDLOOP.
    ENDFORM.                    "transfer_wrkarea
    In the above context does ITAB_WRKAREA(table type) will have only one record.
    What is the difference between these 2 statements
    DATA:  x type TT.   " TT refers to table type
    DATA: x type ST.    "ST refers to structure type
    I am getting confused with the table types and structures . Table type refers to a line type which inturn refers to a structure? Can some one explain this.
    Thanks in Advance

    *-- Table type is a table.. when you refere to a table type u need not use again standard table of , or occurs 0 addition the follwoing statmenet will declare x as a internal table with out header line.
    DATA: x type TT. " TT refers to table type
    *-- Structure is a flat structure and x is a work area not internal table.
    DATA: x type ST. "ST refers to structure type
    if you have to create x as intenaal table using strrucre ST then
    data : x type standard table of ST..
    Thanks
    Mahesh

  • Relation between Table Type and CLOB

    Hello ALL,
    I am calling a procedure whose out parameter should be CLOB.
    I am getting the output into a out parameter of type TABLE.
    So how do we assign the table type data to CLOB variable.
    Please let me know.
    Kind Regards,
    Kumar.

    I presume you want to go through a pl/sql collection and agglomerate its contents to a clob. If so, this should give you teh general idea...
    SQL> create or replace procedure table_to_clob
      2    (  p_owner in varchar2, p_glom out clob )
      3  as
      4      l_ntab strings;
      5      c clob;
      6  begin
      7      dbms_lob.createtemporary(c, true);
      8      select table_name bulk collect into l_ntab
      9      from all_tables
    10      where owner = p_owner;
    11      for i in l_ntab.first()..l_ntab.last()
    12      loop
    13          dbms_lob.writeappend(c, length(l_ntab(i)), l_ntab(i));
    14      end loop;
    15      p_glom := c;
    16  end;
    17  /
    Procedure created.
    SQL> var lc clob
    SQL>
    SQL> exec table_to_clob(user, :lc)
    PL/SQL procedure successfully completed.
    SQL>
    SQL> print lc
    LC
    SEARCH_NOSGFP1P2GCENTITIESDOMAINSSHIPPINGSHIP_STATUSTSTADR$MYINDEX$IDR$
    SQL>Cheers, APC
    blog: http://radiofreetooting.blogspot.com

  • Table type & Structure

    Hi Experts. I have created on structure in DDIC and one table type.I have one class and within class from method I am passing the values of select statement threw the table type to my main program of se38.I need the syntax to use the structure and 'table type' and both get populated form the class method.

    Hi
    U need to define an internal table just like your TABLE TYPE:
    DATA: ITAB TYPE <TABLE TYPE>.
    and a work area like the LINE TYPE of the TABLE TYPE:
    DATA: WA TYPE <LINE TYPE>.
    Now you can read, update that table just like an internal table without the header line.
    So:
    WA-FIELD1 = ....
    WA-FIELD2 = ....
    WA-FIELDN = ....
    APPEND WA TO ITAB.
    Max

  • How to reference a pre-defined table type in entity definition

    I have a Table Type brc.sapere.gso.DDL::domain.TIME_PERIOD defined.
    I try to use it in an entity definition. (dbcommon.hdbdd is attached.)
    But there is an error saying
    ERROR      brc/sapere/gso/DDL/dbcommon.hdbdd
               CDS activation failed;Full qualified names are not allowed
    How can I reference the table type?

    Kalhari wrote:
    Hi, Thanks, but I've seen this. What I need to know is if there is a way to map "user defined table type" specifically, which is a new SQL type introduced with SQL 2008.1. Depends on the database.
    2. Depends on the JDBC driver
    3. Depends on JDBC spec that it being used.

  • Mapping Line type Data to table data

    Hi,
    I am trying to refer to a data element present in the line type of a table type which belongs to an import parameter of a smartform. How will i access the data element to use in the where clause of a select statement.
    For Eg:
    Import Parameter name: PARTNER_H
    TYPE: CRMT_OUTPUT_PARTNER_H_COMT  (table type)
    The line type attached to this table type is CRMT_OUTPUT_PARTNER_H_COM.
    This line type is the structure that contains the data element that i need to use. the details are as below:
    Component: RELATION_PARTNER
    Component type: BU_PARTNER_GUID
    I have written a select statement as below:
    SELECT SINGLE * from BUT000 into I_FS_BUT000 where
      PARTNER_GUID = PARTNER_H-RELATION_H.
    I have given the input parameter as  PARTNER_H.
    It throws me an error that "PARTNER_H" is a table without a header line and therefore has no component called "RELATION_H".
    Is this the correct way to access the data element?Please help.

    Hi Neena,
                   Since PARTNER_H is an internal table it may have multiple values. If you want only a single entry from BUT000, you ll have to determine which entry from PARTNER_H you need in select query.
    If it is always going to have only a single value then , this will work :
    data: wa_partner_h type line of CRMT_OUTPUT_PARTNER_H_COMT.
    Read table partner_h into wa_partner_h index 1.
    if sy-subrc is initial.
    SELECT SINGLE * from BUT000 into I_FS_BUT000 where
    PARTNER_GUID = WA_PARTNER_H-RELATION_H.
    endif.
    Regards,
    Arun

  • How to retrieve data from plsql table in BI publisher Data template

    Hi All,
    I have created a data template for XML publisher report. In data template i m getting data from plsql table. for that i have created one package with pipelined function. I am able to run that sql from sql developer .But if i run the concurrent program then i got error like "java.sql.SQLSyntaxErrorException: ORA-00904: "XXXXX": invalid identifier".
    I have used the same parameters in Data template and concurrent program....
    please clarify me what needs to be done....
    thanks in advance....
    Regards,
    Doss

    Hi Alex ,
    i am using pipelined function and get the data from cursor and load it into plsql table (nested table). and i use the below in my data template to fetch the data:
    <sqlStatement name="Q1">
    <![CDATA[select * from  table(PO_SPEND_RPT_PKG.generate_report(P_ORG_ID,P_SOB_ID,P_ORG_NAME,P_PERIOD_NAME,P_CLOSE_STATUS,P_E_PCARD_NEED,P_REPORT_TYPE))]]>
    </sqlStatement>
    if i run the above in sql developer i can get the result....from apps if i run i got the error "java.sql.SQLSyntaxErrorException: ORA-00904: "P_ORG_ID": invalid identifier"
    Edited by: kalidoss on Sep 14, 2012 4:32 AM

  • How to load the data using a plsql table in ODI.

    Hi All ,
    Can anyone help me on this ?
    We have a PLSQL procedure which returns a plsql table as out parameter.
    We are supposed to load the data in to a file using this plsql table (Table type) in ODI.
    Can this be done using ODI?
    Regards,
    Karthik+

    Hi,
    We have one process with a ref cursor (Oracle) as a source and remote Oracle DB as a target. I ended up writing my own KM that populates a global temporary table from the cursor first and then transfers the data to target. If temporary table is an option for you, the rest is pretty easy.
    Regards.

  • MDM JAVA API to enter value into field of type date

    Hi All,
    I am having an input field in a typical Dynpro application where a date would be entered.I want to enter  the date in my MDM table in a field of type "Date".Do you have any idea about MDM JAVA API's I need to do this.Also how can I do this ?
    Thanks
    Vinay

    Hi,
    Web Dynpro shall return you a type Date field. For Value, you shall have to pass SystemTime Object.
    Just get the substring of Date.toString() and convert them to Integer ..
    So a typical date would look like yyyy-mm-dd (eg: 2006-10-19) and not yyyymmdd.
    SystemTime st = new SystemTime();
    st.setYear( Integer.parseInt(Date.toString().substring(0,4));
    st.setMonth ( Integer.parseInt(Date.toString().substring(5,7));
    st.setDate ( Integer.parseInt(Date.toString().substring(8,10));
    A2iField date = new A2iField("fieldname", new Value(st));
    Hope that helps..
    Regards,
    Tanveer.
    <b>Please mark helpful answers</b>
    Note: The above mentioned code is not pasted from any editor..So might contain syntax error..

  • How to get the plsql table data into output cursor

    Hi,
    Could anybody please help me.
    Below is an example of the scenario..
    CREATE OR REPLACE PACKAGE chck IS
    PROCEDURE getdata(dept_no IN VARCHAR2,oc_result_cursor OUT sys_REFCURSOR);
    TYPE get_rec is record (ename varchar2(20),
    eno number(12));
    TYPE t_recs IS TABLE OF get_rec INDEX BY BINARY_INTEGER;
    emp_tab t_recs;
    END chck;
    CREATE OR REPLACE PACKAGE BODY chck AS
    PROCEDURE getdata(dept_no IN VARCHAR2,oc_result_cursor OUT sys_REFCURSOR)
    is
    BEGIN
    select ename, eno
    bulk collect into emp_tab
    from emp;
    open oc_result_cursor for select * from table(emp_tab); -- I believe something is wrong here ....
    END;
    END chck;
    the above package is giving me an error:
    LINE/COL ERROR
    10/29 PL/SQL: SQL Statement ignored
    10/43 PL/SQL: ORA-22905: cannot access rows from a non-nested table
    item
    let me know what needs to be changed
    Thanks
    Manju

    manjukn wrote:
    once i get the data into a plsql table, how to get this plsql table data into the cursor?There is no such thing as a PL/SQL table - it is an array.
    It is nothing at all like a table. It cannot be indexed, partitioned, cluster, etc. It does not exist in the SQL engine as an object that can be referenced. It resides in expensive PGA memory and needs to be copied (lock, stock and barrel) to the SQL engine as a bind variable.
    It is an extremely primitive structure - and should never be confused as being just like a table.
    Its use in SQL statements is also an exception to the rule. Sound and valid technical reasons need to justify why one want to push a PL/SQL array to the SQL engine to run SELECT 's against it.

  • Wsimport, mapping of xs:date to java.util.Date via ext file, and -B option

    Summary:
    JDK 1.7.0_09 and wsimport and xjc that comes with it.
    Global JAXB binding to map xs:date to java.util.Date
    I have the following external bindings file:
    <?xml version="1.0" encoding="UTF-8"?>
    <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
         xmlns:jaxb="http://java.sun.com/xml/ns/jaxb" xmlns:xjc="http://java.sun.com/xml/ns/jaxb/xjc"
         elementFormDefault="qualified" attributeFormDefault="unqualified"
         jaxb:extensionBindingPrefixes="xjc" jaxb:version="2.1">
         <xs:annotation>
              <xs:appinfo>
                   <jaxb:globalBindings>
                        <xjc:serializable />
                        <jaxb:javaType name="java.util.Date" xmlType="xs:date" parseMethod="au.com.xxx.jaxb.DateAdapter.parseDate" printMethod="au.com.xxx.jaxb.DateAdapter.printDate" />
                   </jaxb:globalBindings>
              </xs:appinfo>
         </xs:annotation>
    </xs:schema>The au.com.xxx.jaxb.DateAdapter code is as follows:
    package au.com.xxx.jaxb;
    import java.util.Calendar;
    import java.util.Date;
    import java.util.GregorianCalendar;
    import javax.xml.bind.DatatypeConverter;
    public class DateAdapter {
         public static Date parseDate(String s) {
              return DatatypeConverter.parseDate(s).getTime();
         public static String printDate(Date dt) {
              Calendar cal = new GregorianCalendar();
              cal.setTime(dt);
              return DatatypeConverter.printDate(cal);
    }When I run the following wsimport from the command line, I get:
    salvojo@AUD20901BL /cygdrive/c/workspace/JSF/insurance
    $ /cygdrive/c/java/jdk1.7.0_09/x64/bin/wsimport -keep -s gen-src -b external/wsdl/jaxb-bindings.xml -wsdllocation /wsdl/Member.wsdl -d WebContent/WEB-INF/classes external/wsdl/Member.wsdl
    parsing WSDL...
    Generating code...
    Compiling code...
    C:\workspace\JSF\insurance\gen-src\org\w3\_2001\xmlschema\Adapter1.java:13: error: package au.com.xxx.jaxb does not exist
            return (au.com.xxx.jaxb.DateAdapter.parseDate(value));
                                   ^
    C:\workspace\JSF\insurance\gen-src\org\w3\_2001\xmlschema\Adapter1.java:17: error: package au.com.xxx.jaxb does not exist
            return (au.com.xxx.jaxb.DateAdapter.printDate(value));
                                   ^
    2 errors
    compilation failed, errors should have been reportedWhich means that wsimport or xjc needs to know the classpath to find au.com.xxx.jaxb.DateAdapter.
    But how do I pass the classpath from wsimport to the JAXB compiler ?
    There is the -B option in wsimport, but I could not get it to work.
    If I read it correctly, I should be able to pass the -classpath option to the JAXB compiler from wsimport via -B.
    I tried:
    salvojo@AUD20901BL /cygdrive/c/workspace/JSF/insurance
    $ /cygdrive/c/java/jdk1.7.0_09/x64/bin/wsimport -keep -s gen-src -B"-classpath WebContent/WEB-INF/classes" -b external/wsdl/jaxb-bindings.xml -wsdllocation /wsdl/Member.wsdl -d WebContent/WEB-INF/classes external/wsdl/Member.wsdl
    no such JAXB option: -classpath WebContent/WEB-INF/classes
    Usage: wsimport [options] <WSDL_URI>
    where [options] include:
      -b <path>                 specify jaxws/jaxb binding files or additional schemas
                                (Each <path> must have its own -b)
      -B<jaxbOption>            Pass this option to JAXB schema compiler
      -catalog <file>           specify catalog file to resolve external entity references
                                supports TR9401, XCatalog, and OASIS XML Catalog format.
      -d <directory>            specify where to place generated output files
    <...snipped...>... where WebContent/WEB-INF/classes is the classpath where au.com.xxx.jaxb.DateAdapter.class could be found. Obviously it did not like it.
    Also, why is wsimport generate org.w3._2001.xmlschema.Adapter1.java ? All it is doing is wrapping up the exact same call that I have specified in my DateAdapter. How can I tell wsimport or xjc to NOT create that extra Adapter1.java and simply directly use my DateAdapter ??

    create additional column of type LONG to represent date.
    dateFormat is of type java.util.Date:
    long newLongDate = dateFormat.getTime();
    select object(b) from MyEntity b where b.MYLONGDATE > ?1 and b.MYLOGDATE <= ?2

Maybe you are looking for

  • Itunes no longer even loads

    I wanted to update the OS on my Ipad (1), but in order to do so I had to update my itunes. NOW i cant even load itunes at all let alone update my ipad. Ive tried everything I read on the support pages here - uninstalling apple programs, trying to re-

  • Downloading App Store's Mountain Lion gives me 10.8.2 again?

    Hello. OK, I gave up with Mac Mini's download due to the account issue. I took the 13.3" MacBook Pro (mid-2012) to a place with fast Internet (15/1 Mb/sec speeds), but its updated Mac OS X 10.8.5's App Store kept giving me 10.8.2 to download. I tried

  • Star ratings not transferring in sync

    When I'm on the go I give a star rating to my songs on my iPhone 3GS. When I get home I'd love to transfer the ratings over to iTunes. Is there a setting that turns this feature on? Is it suppose to happen automatically? I can't get any star ratings

  • Integrating workflow within an ADOBE Interactive form

    Hi experts, We have a  Web-dynpro ABAP application which uses an Interactive Adobe form to enter personal and org data for HR. The form is now being used by HR personnel for  new-hire- employee's personal, organizational, and payroll information.  Ev

  • CS3 Classroom in a book "Chapter 9" Error

    Iv been working through the Classroom in a book for dreamweaver CS3 and in chapter 9 it talks about xml and Creating Interactive Pages. The files included have a xml file as well as a suposidly compleated and working example page that is how my page