Array of records registerOutParameter

Hi !!
I have a Pl/SQL function that returns an array of records. I want to call this procedure doing the following:
st =conn.prepareCall("{? = call partes.PROYECTOS_DISPONIBLES(?,?,?)}");
st.registerOutParameter(1, oracle.jdbc.driver.OracleTypes.ARRAY);
but i don4t know how to cast the oracle array that return this function to i can access to this data.
could anyone help me???
Thanks in Advance

I have the following:
Type PROYECTO_REC
AS OBJECT
fat_pry_codig varchar2(10),
fat_pry_pro_are_div_soc_codig number(3),
fat_pry_pro_are_div_codig number(3),
fat_pry_pro_are_codig number(3),
fat_pry_pro_codig number(3),
fat_pry_nrevi number(3),
fat_codig varchar2(10),
icate varchar2(1),
cod varchar2(10),
dproy varchar2(50),
denom varchar2(50),
drazas varchar2(100),
horasl number,
horasm number,
horasx number,
horasj number,
horasv number,
horass number,
horasd number);
and a table of it:
type tabla_proy is table of proyecto_rec;
and i have a function in pl/sql that returns a table of this type and i want from jdbc to have access to the tabla that return this function.
Could anyone help me????

Similar Messages

  • ARRAY and records at multiple level ? please help

    Hi experts!!
    I am struck up with a problem. If u can please help me.
    I need a structure of this type.
    create type GRADE as object(
    grade varchar2(30)
    / -- works fine , creates
    create type GRADE_ARRAY as VARRAY(10) of GRADE;
    / -- works fine and creates
    create type SPECIES as object
    Species_number number,
    array_of_grade GRADE_ARRAY
    / works fine
    create type SPECIES_ARRAY as VARRAY(20) of SPECIES;
    -- error comes here.. Can not have multiple level..type error
    and so can not go ahead. In fect I wanted to use next level also. like this.
    The next command remains my dream only then because I could not create the SPECIES ARRAY it self..
    create type TIMBER as object
    timber_mark varchar2(6),
    no_species number,
    array_of_species(20) SPECIES_ARRAY
    the problem is for multiple level ARRAY AND RECORD/object combination..
    I tried with OBJECT AND VARRAY it does only for one level.. not even two level.
    my Mail ID:
    [email protected]
    Thanks and Regards..
    Virendra chauhan

    I think multi-level collections was first implemented in 9.2. You failed to mention what version of the DB you are using.

  • Create Array from Record

    Hi
    Somebody have a example how can I to create a Array from record ?
    tks

    Hi!
    Pls go through the followinglink --
    [url http://download-west.oracle.com/docs/cd/B14117_01/appdev.101/b10807/05_colls.htm]VArray From Record In Oracle
    Hope that will help u.
    Regards.
    Satyaki De.

  • Initializing a varying array of records?

    Hi everybody,
    Given below is a sample code. I have created a varying array of records. However I am unable to initialize the same. Can anybody help me out?
    DECLARE
    TYPE XRECORD IS RECORD(x NUMBER, y VARCHAR2(12));
    TYPE VARRAYTYPE IS VARYING ARRAY(10) OF XRECORD;
    xvartab VARRAYTYPE;
    BEGIN
    ----How do I populate/initialize the varying array
    --The following line gives me an error
    --xvartab := VARRAYTYPE(2,'XXXX');
    NULL;
    END;

    declare
       type xrecord is record(x number, y varchar2(12)); -- declare record type
       xrec xrecord; -- declare working record of type xrecord 
       type varraytype is varying array(10) of xrecord; -- declare varray type
       xvartab varraytype := varraytype(); -- declare and initialise varray of type varraytype   
    begin
       -- populate working record 
       xrec.x := 1;
       xrec.y := 'XXXX';
       -- make room for one new record in varray 
       xvartab.extend(1);
       -- insert record into element one of varray
       xvartab(1) := xrec;
       -- populate working record  
       xrec.x := 2;
       xrec.y := 'XXXX';
       -- make room for one new record in varray 
       xvartab.extend(1);
       -- insert record into element two of varray
       xvartab(2) := xrec;
       -- display record in element one of varray
       dbms_output.put_line('ELEMENT ONE : x='||xvartab(1).x||' and y='||xvartab(1).y);  
       -- display record in element two of varray  
       dbms_output.put_line('ELEMENT TWO : x='||xvartab(2).x||' and y='||xvartab(2).y);  
    end;
    SQL> /
    ELEMENT ONE : x=1 and y=XXXX
    ELEMENT TWO : x=2 and y=XXXX
    PL/SQL procedure successfully completed.
    SQL>

  • Receive array of record as a storeprocedure parameter

    Hello!
    Can I receive an array of record in a storeprocedure?
    I have seen that in C sharp you can receive an array of varchar, for example, but I don' t know if it's possible to receive a complex type array like a record or you can only receive a simple type array like output parameter.
    I work with this record:
    TYPE prueba IS RECORD
    TIPO VARCHAR2(30),
    CODIGO varchar2(10),
    DENOMINACION VARCHAR2(55),
    COD_TIPO NUMBER,
    DENOMINACION2 VARCHAR2(55)
    Thanks!!

    Hi, you can't pass array of record to stpred procedure, inside use UDT.
    [See.|http://forums.oracle.com/forums/thread.jspa?messageID=3606898&#3606898]
    Roberto
    Edited by: rober584812 on Sep 19, 2009 5:26 PM

  • How to insert array of records in Storage table and  Nested table same time??

    Hi,
    I am using ProC++ ( Oracle 8i) . I want to insert a host array
    in a table. That table has a nested table in it. So for every
    record in my host array, there are muliple records to be
    inserted in Nested table. How is this possible using pro*C??
    Pls help.
    Thanks
    Nivedita

    Have a look at the Oracle 9i PL/SQL manual, which has an example.

  • Array of array of records

    hey, i have an array of twelve weeks, and each week is an array of 240 records which have a char for the status and an integer for the student number.
    I was wanting to store this structure to file, can anyone help me?
    preferably the data should be accessed randomly?
    thanks in advance!

    Hi.
    Take a look at the Java 2 API Documentation. The class RandomAccessFile should meet your demands.
    Regards,
    Kai

  • Using dynamic array as record selection criteria-performance issue

    Hi All,
    I have successfully passed an array to my subreport and using it as selection criteria. This subreport is embedded in a group and prints data recursively. Problem is the selection is happening locally which causes all the records to be brought and then filters them. Any solution/help will be greatly appreciated.
    Thanks, in advance.
    -Vishal

    Thanks Vinay. But I think I found my answer actually at the selection criteria I was creating an array from string as follows,
    stringvar array ConjugateLots = split( str, ",")
    in ConjugateLots* //this was causing the local fitration and then I switch to
    * in split( str, ",") // which worked.
    But once again thanks. But now I have another issue, I want the records to be sort in the array items. Any help with that also greatly appreciated.
    Thanks,
    -Vishal

  • Using an array to record button click order

    I am working on a demo of a UI for a handheld device. I am
    trying to make a back button that can track the users actions back
    several steps.
    I started by putting this line of code in my frame 1 actions
    layer:
    var wherefrom:Array = new Array();
    then i placed this follwing code on several different
    buttons:
    on(release){
    wherefrom.push("frame_name1");
    gotoAndStop("frame_name2");
    then on the back button i added this following code:
    on(release){
    gotoAndStop(wherefrom.pop());
    it doesnt seem to be working. I was wondering if this type of
    action is possible using AS2.0? any suggestions would be greatly
    appreciated.

    I believe scene names (and also scenes) only exist at
    authoring time and are converted to frame numbers when the swf is
    compiled (I may be wrong because I don't use them). You might have
    more success if you tried using frame numbers.
    Try using
    wherefrom.push(_currentframe);

  • How to retrieve Table of Records output param from stored procedure ?

    Hi,
    I'm trying to retrieve data from a PL/SQL stored proc. It seems I can't modify this procedure (I'm not allowed to and I don't know PL/SQL :)).
    My only documentation is the PL/SQL code and its comments. And that's the first I have to deal with output of a defined complex PL/SQL type
    So the signature of the procedure is :
    FUNCTION FUN_AFF_EVELEG_IHM (
        pEntumTyp       IN          NUMBER,
        pEntnum         IN          VARCHAR2,
        pEveListSize      IN OUT      NUMBER,
        pEveList       IN OUT      pkg_funaff_eveleg.TableRecordEVL,
        pErrCode   IN OUT      VARCHAR2,
        pMessage        IN OUT      VARCHAR2)
      RETURN NUMBER;pkg_funaff_eveleg.TableRecordEVL type is defined as "TABLE of RecordEVL"
    pkg_funaff_eveleg.RecordEVL type is defined as "RECORD" (struct of 12 different fields : NUMBER or VARCHAR2)
    What is the correct syntax to call the stored procedure then ? I don't find how to manage the pEveList output param. Is it a Cursor ? An ARRAY ? And how to register it ?
    My code so far :
    public static void callFunaffEVL(Connection con, String rcs) {
        // CallableStatement procCstmt=null;
        OracleCallableStatement oraCstmt = null;
        try {
          // Identifiy the Stored procedure
          // package synonyme : pkg_aff_EVELEG_IHM
          // stored procedure name : FUN_AFF_EVELEG_IHM
          String command = new StringBuilder("{? = call pkg_aff_EVELEG_IHM.FUN_AFF_EVELEG_IHM(?,?,?,?,?,?");
          // 1 RETURN 
          // 2 pEntumTyp IN NUMBER
          // 3 pEntnum IN VARCHAR2
          // 4 pEveListSize IN OUT NUMBER,
          // 5 pEveList IN OUT pkg_funaff_eveleg.TableauRecordEVL,
          // 6 pErrCpde IN OUT VARCHAR2,
          // 7 pMessage IN OUT VARCHAR2)
          // Create a Callable Statement Object:
          oraCstmt = (OracleCallableStatement) con.prepareCall(command);
          // Assign IN and OUT parameters
          oraCstmt.registerOutParameter(1, OracleTypes.NUMBER); // RET
          oraCstmt.setInt(2, 0); // ENTNUMTYP
          oraCstmt.setString(3, rcs); // ENTNUM
          oraCstmt.registerOutParameter(4, OracleTypes.NUMBER); // pEveListSize
          oraCstmt.registerOutParameter(5, OracleTypes.ARRAY); // pEveList
          oraCstmt.registerOutParameter(6, OracleTypes.VARCHAR); // pErrCode
          oraCstmt.registerOutParameter(7, OracleTypes.VARCHAR); // pMessage
          // Execute the Procedure or Function Call:
          oraCstmt.execute();
          // Process the OUT Placeholders:
          int ret = oraCstmt.getInt(1);
          String errCode = oraCstmt.getString(6);
          String message = oraCstmt.getString(7);
          System.out.println("RCS : " + rcs);
          System.out.println("ret : " + ret);
          System.out.println("errCode : " + errCode );
          System.out.println("message : " + message);
        } catch (SQLException sqle) {
          sqle.printStackTrace();
        } finally {
          // Close the CallableStatement Object:
          try {
            oraCstmt.close();
          } catch (SQLException e) {
            e.printStackTrace();
    Return : java.sql.SQLException: Parameter type Conflict: sqlType=2003
    Any help ? I found several examples that might refer to this case, but everything I tried end by a SQL exception of one type or another...
    (and sorry for my poor english :))
    Cy

    As I said, "pkg_funaff_eveleg.TableRecordEVL" is TABLE of RecordEVL.
    i.e : I can find 2 defined types under the package pkg_funaff_eveleg :
    TYPE TableRecordEVL is TABLE of RecordEVL INDEX BY BINARY_INTEGER;
    TYPE RecordEVL is RECORD (
      EVLENTNUM_PK        EVENEMENTS_LEGAUX.EVLENTNUM_PK%TYPE,
      EVLENTNUMTYP_PK     EVENEMENTS_LEGAUX.EVLENTNUMTYP_PK%TYPE,
      EVLSEQ_PK           EVENEMENTS_LEGAUX.EVLSEQ_PK%TYPE,
      EVLTYPSRC           EVENEMENTS_LEGAUX.EVLTYPSRC%TYPE,
      EVLPK1              EVENEMENTS_LEGAUX.EVLPK1%TYPE,
      EVLPK2              EVENEMENTS_LEGAUX.EVLPK2%TYPE,
      EVLPK3              EVENEMENTS_LEGAUX.EVLPK3%TYPE,
      EVLPK4              EVENEMENTS_LEGAUX.EVLPK4%TYPE,
      EVLPK5              EVENEMENTS_LEGAUX.EVLPK5%TYPE,
      EVLPK6              EVENEMENTS_LEGAUX.EVLPK6%TYPE,
      EVLCODEVTSRC        EVENEMENTS_LEGAUX.EVLCODEVTSRC%TYPE,
      EVLLEGEVECOD        EVENEMENTS_LEGAUX.EVLLEGEVECOD%TYPE,
      EVLSEQREF_FK        EVENEMENTS_LEGAUX.EVLSEQREF_FK%TYPE,
      EVLCOMMENT          EVENEMENTS_LEGAUX.EVLCOMMENT%TYPE,
      EVLETATCOD          EVENEMENTS_LEGAUX.EVLETATCOD%TYPE,
      EVLHISDATPUB        EVENEMENTS_LEGAUX.EVLHISDATPUB%TYPE,
      EVLHISPUBPRE        EVENEMENTS_LEGAUX.EVLHISPUBPRE%TYPE,
      EVLHISDATEFF        EVENEMENTS_LEGAUX.EVLHISDATEFF%TYPE,
      EVLHISEFFPRE        EVENEMENTS_LEGAUX.EVLHISEFFPRE%TYPE,
      EVLHISPOIDATEFF     EVENEMENTS_LEGAUX.EVLHISPOIDATEFF%TYPE,
      EVLHISORICOD        EVENEMENTS_LEGAUX.EVLHISORICOD%TYPE,
      EVLHISSUPPORTCOD    EVENEMENTS_LEGAUX.EVLHISSUPPORTCOD%TYPE,
      EVLHISNUMSUPPORT    EVENEMENTS_LEGAUX.EVLHISNUMSUPPORT%TYPE,
      EVLHISNUMINF        EVENEMENTS_LEGAUX.EVLHISNUMINF%TYPE,
      ANNNUMBODPCL        CBODACCPROD.CODANN2.ANNNUMBOD%TYPE
    );If needed, I can translate each "EVENEMENTS_LEGAUX.EVLENTNUM_PK%TYPE", but they must be VARCHAR2 or NUMBER
    Do I answer your question ?

  • How to pass Array String to callable statement

    How can I pass an array variable to the callable statement as an out parameter and how to define that in the pl/sql procedure.
    Thanks,
    HC

    HC
    If you would refer to the link given by Anil, You can make out that there in input as well as in output it is passing an array of records.
    CallableStatement cs = conn.prepareCall("{call XX_PassTableType.XX_PassTableType_prc(:1, :2)}"); 
    ARRAY array = new ARRAY(new ArrayDescriptor("APPS.JTF_NUMBER_TABLE", conn), conn, vNumber); 
    ARRAY array1 = new ARRAY(new ArrayDescriptor("APPS.JTF_VARCHAR2_TABLE_100", conn), conn, as); 
    cs.setArray(1, array); 
    cs.setArray(2, array1); 
    cs.registerOutParameter(2, 2003, "JTF_VARCHAR2_TABLE_100");In above lines 1 is the input parameter that is an array of number while 2 is an array of varchar.
    Thanks
    AJ

  • How to bind arrays to PL/SQL stored procedure using OCI?

    Hi,
    We are having problems trying to bind arrays to PL/SQL stored procedure using OCI. Here is the situation:
    - We have a stored procedure called "GetVEPFindTasks" with the following interface:
    PROCEDURE GetVEPFindTasks (
    p_ErrorCode OUT NUMBER,
    p_ErrorMsg OUT VARCHAR2,
    p_RowCount OUT NUMBER,
    p_VEPFindTasks OUT t_VEPFindTaskRecordTable,
    p_MaxTask IN NUMBER);
    t_VEPFindTaskRecordTable is a record with the following entries:
    TYPE t_VEPFindTaskRecord IS RECORD (
    RTCID NUMBER,
    TransNum NUMBER,
    TransTimestamp VARCHAR2(20),
    Pathname1 image_data.pathname%TYPE,
    Pathname2 image_data.pathname%TYPE,
    Pathname3 image_data.pathname%TYPE,
    OperatorID operator.id%TYPE);
    - Now, we are trying to call the stored procedure from C++ using OCI (in UNIX). The call that we use are: OCIBindByName and OCIBindArrayOfStruct to bind the parameters to the corresponding buffers. We bind all parameters in the interface by name. Now, we do bind the record's individual item by name (RTCID, TransNum, etc.), and not as a record. I don't know if this is going to work. Then, we use the bind handles of the binded record items (only record items such as RTCID, TransNum, and NOT error_code which is not part of the record) to bind the arrays (using OCIBindArrayOfStruct).
    All of the parameters that are binded as arrays are OUTPUT parameters. The rest are either INPUT or INPUT/OUTPUT parameters. Now, when we try to execute, OCI returns with an error "Invalid number or types of arguments" (or something to that sort... the number was something like ORA-06550). Please help...
    Is there any sample on how to use the OCIBindArrayOfStruct with PL/SQL stored procedures? The sample provided from Oracle is only for a straight SQL statement.
    Thank's for all your help.
    ** Dannil Chan **

    As you said:
    You have to pass in an array for every field and deconstruct/construct the record in the procedure. There is no support for record type or an array of records. Can you give me a example? I'am very urgently need it.
    thanks
    email: [email protected]

  • JDBC-Adapter-Receiver Calling Stored Procedure with Input-Typ Record

    Hallo,
    I´ m trying calling a stored-procedure with two input-parameter; one of typ record (oracle) and one of type tabel of records. Is this possible (I think there are only types like string, integer etc. possible)? When not is there another possibility to work with that type?
    Thanks in advance,
    Frank

    Hi Frank,
    I think stored procedures will not take Array of Records as a Input. If you want to make a loop funtionality etc then JDBC adapter will work accordingly. You need to just call the stored procedure from the JDBC adapter. It will work for the array of records(multiple occurences).
    Receiver JDBC Procedures.
    /people/siva.maranani/blog/2005/05/21/jdbc-stored-procedures
    Alternative option is you can make use of Java Proxy and from there you can call stored procedure ..I think it is possible.. not tried.
    Hope this helps
    Regards,
    Moorthy

  • Require help on Array of Nested tables and Oracle Object type

    Hi All,
    I have a scenario where I have some millions of records received from a flat file and the record is stored in Table as below:
    Tablename: FILE_RECORD
    Rows:
    FILE_REG_ID = 1
    RECORD_NBR = 1     
    PROCESSED_IND = U
    RECORD= 00120130326006A
    FILE_REG_ID = 1
    RECORD_NBR = 2     
    PROCESSED_IND = U
    RECORD= 00120130326003
    1) I have to read these records at once and
    a) Split the RECORD column to get various other data Eg: Fld1=001, Fld2=20130326, Fld3 = 003
    b) send as an Array to Java.
    2) Java will format this into XML and sent to other application.
    3) The other application returns a response as Successful or Failure to Java in XML
    4) Java will send RECORD_NBR and the corresponding response as Success or Failure back to PLSQL
    5) PLSQL should match the RECORD_NBR and update the PROCESSED_IND = P.
    I 'm able to achieve this using SQL Table type by creating a TYPE for Each of the fields (Flds) however the problem is Java cannot Access the parameters as the TYPE are of COLUMN Types
    Eg: For RECORD_NBR
    SUBTYPE t_record_nbr IS FILE_RECORD.T010_RECORD_NBR%TYPE;
    Can you please let me know how I can achieve this to support Java, I know one way that is by creating an OBJECT TYPE and a TABLE of the OBJECT TYPE.
    Eg: T_FILE_RECORD_REC IS OBJECT
    FILE_REG_ID number(8), RECORD_NBR number (10), PROCESSED_IND varchar2(1), RECORD varchar(20)
    Create type T_FILE_RECORD_TAB IS TABLE OF T_FILE_RECORD_REC
    However I'm facing a problem to populate an Array of records, I know I'm missing something important. Hence please help.
    It would be helpful to provide some guidelines and suggestions or Pseudo or a Code to achieve this. Rest all I can take up further.
    Thanks in advance,

    I know once way that is creating a OBJECT TYPE and a TABLE of OBJECT TYPE, howeve I feel I'm missing something to achieve this.You're right, you need SQL object types created at the database level. Java doesn't know about locally defined PL/SQL types
    However you can do without all this by creating the XML directly in PL/SQL (steps 1+2) and passing the document to Java as XMLType or CLOB.
    Are you processing the records one at a time?

  • How to process a group of records in a single Web Service Call through SDK

    Hi Experts,
    The Business Scenario is as follows:
    Entire data of the customer accounts and Sales information of my client's is coming from an external system called DellBoomi into the ByD. We had a solution for this where we had used a custom inbound web service for some reasons and we cannot consume standard SAP provided web service to do this for customer account creation/updation in ByD. In the solution when we are trying with a custom web service we found that the associations of SalesArrangment and Payment Data are not PSM write enabled for partners. So we had taken a route of consuming SAP standard web service as a external web service and we consumed it and we used this for creation of the customer and for the updation we used the custom web service which we built.
    Here now the problem is it is taking long time to process a batch of 100 customers (almost 3hours it took). It is due to because we are trying to call SAP standard web service for each and every record of 100 records which are coming from DellBoomi and creating them and again updating some of the information with the use of custom web service.
    I know this is a long process and step which we had taken but there is no other way we had left with us.
    Now I am looking for a way to get all the 100 records of the DellBoomi together should invoke the SAP standard web service at a time instead of going and looking for it for each and every record.
    Can any one reply back with their valuable suggestions and solutions.
    Regards..
    Hanu K

    Hello,
    Thank you, guys, for advice. I should have explained calling context before, but what I basically need to do is to see if procedure(arg1, list(record(arg2, arg3))) returns true.
    I see array binding wouldn't fit there nicely. Internal procedure calls would be proc(next(arg1), next(arg2), next(arg3)) - if all these return true, external call should also return true. I would need to make a list of repeating values of arg1 and separate list(record(arg2, arg3)) into separate lists. I would also need to record whether the internal call returns true to deduce whether external call returns true.
    As I see no better way yet, I'll make Oracle procedure proc(arg1, arg2, arg3) and implement a loop in .NET side. If I optimize for performance, I'll probably pack the array of records into string and pass it for Oracle side to parse.
    Regards,
    Aurimas Pranskevicius

Maybe you are looking for

  • How to get the value of the selected link

    Hello, I have a page which displays the result of the VO in a table Region. One of the columns is made as a url . Now when the user selects the link, how can i capture the value (i.e. the link name). Thanks in advance. Kumar

  • App Store says Lion is installed, but in reality it is not, and now I'm stuck..

    downloaded Lion, got an error message that it was not downloaded completely... then did some updates with the software updater. went to app store to download lion again, it says lion is already installed. But i checked and i'm still running 10.6.8 Sn

  • IWeb pages displayed correctly in Firefox but on in Safari/Chrome

    I made a personal web page with iWeb. Now some of the pages are not displayed correctly in Safari and/or Chrome. Check this page for example : http://maiklohse.de/Maik_Lohse/media.html There are 6 YouTube videos embedded in the page. They all will sh

  • Acrobat - Preflight - Single Check - Non CMYK ?

    Hi all, I'm looking for a universal single check in Acrobat -> Preflight to find any things (I mean everything - fonts, pictures, borders of a table, objects, ect.) that are NOT in CMYK colors (mainly they are RGB) Right now I'm using this: All -> Ob

  • Adding E-mail accounts

    Just purcahsed a new IMac. my e-mail is coming into mail fine, but how do I add my wife's account, and how do we switch back and forth from accounts. Our older Mac is still up and working, we used Entourage for that, and I kind of would like to dupli