Returing array from PL/SQL procedure

Hi,
I am trying to return array from PL/SQL procedure. Heres is the code. I am getting an error "OracleParameter.ArrayBindSize is invalid ".
Will anybody let me know what is wrong in following code. or does anybody have code to return PL/SQL array using VB.NET.
oCommand.CommandText = "MyPack.TestVarchar2"
oCommand.CommandType = CommandType.StoredProcedure
Dim id As Integer = 10
Dim deptname As String()
Dim oParam1 As Oracle.DataAccess.Client.OracleParameter = New Oracle.DataAccess.Client.OracleParameter("id", Oracle.DataAccess.Client.OracleDbType.Int32)
Dim oParam2 As Oracle.DataAccess.Client.OracleParameter = New Oracle.DataAccess.Client.OracleParameter("deptname", Oracle.DataAccess.Client.OracleDbType.Varchar2)
oParam1.Direction = ParameterDirection.Input
oParam2.Direction = ParameterDirection.Output
oParam1.CollectionType = Oracle.DataAccess.Client.OracleCollectionType.None
oParam2.CollectionType = Oracle.DataAccess.Client.OracleCollectionType.PLSQLAssociativeArray
oParam1.Value = id
oParam2.Value = ""
oParam1.Size = 10
oParam2.Size = 20
oCommand.Parameters.Add(oParam1)
oCommand.Parameters.Add(oParam2)
oCommand.ExecuteNonQuery()
Thanks
Sameer

Thanks Arnold for the reply..
Yes, I am trying to get result set in array which is unknow to me (No of rows return by the query). For the test I will pre-define the result set so that I will able to set ArrayBindSize.
I have read C# example but when I try to write it in VB.NET it gives me syntax error when I try to set the ArrayBindSize.
oParam.ArrayBindSize = new int[3]{15,23,13} // individual max size of 3 outputsWill you please let me know how to set ArrayBindSize (VB.NET) because I am new to this..
There is an example at otn "How to: Bind an Array to an ODP.NET Database Command" which does multiple INSERTs in one trip to database. This works fine. I need to do same for the SELECT statement which will return me multiple rows. I do not mean refCursor. If I use refCursor, it will make soft parse which I am trying to avoid using this Array techniq.
Thanks
Sameer

Similar Messages

  • Returning collection-associative array from pl-sql procedure

    CREATE OR REPLACE procedure test_ganesh( p_deptno IN number,gana out PARTIES_RESULT)
    is
    query varchar2(200);
    PARTY_ID varchar2(200);
    PARTY_CODE varchar2(200);
    PARTY_NAME varchar2(200);
    PARTY_SEQ VARCHAR2(200);
    counter number;
    TYPE PARTIES IS TABLE OF varchar2(2000) index by binary_integer;
    txn_parties PARTIES;
    type PARTIES_RESULT IS TABLE OF PARTIES index by binary_integer;
    total_result PARTIES_RESULT;
    TYPE EmpTyp IS REF CURSOR;
    p_du EmpTyp;
    p_cursor EmpTyp;
    global_counter number;
    begin
    global_counter:=1;
    counter:=1;
    open p_cursor FOR
    select A.ref_no
    from ot_lc_txn_details A
    where rownum <12;
    LOOP
    FETCH p_cursor INTO query;
    EXIT WHEN p_cursor%NOTFOUND;
    counter:=1;
    open p_du FOR
         select party_id,party_code,seq_no,party_name from ot_txn_party where ref_no=query;
         LOOP
         FETCH p_du INTO PARTY_ID,PARTY_CODE,PARTY_SEQ,PARTY_NAME;
         EXIT WHEN p_du%NOTFOUND;
         txn_parties(counter):=PARTY_ID || '&&&' || PARTY_CODE || '&&&'||PARTY_SEQ || '&&&' || PARTY_NAME;
              counter:=counter+1;
         END LOOP;
         CLOSE p_du;
    total_result(global_counter):=txn_parties;
    global_counter:=global_counter+1;
    END LOOP;
    CLOSE p_cursor;
    --open gana FOR SELECT * FROM table(cast(total_result as PARTIES_RESULT)) ;
    end;
    The error comes at line one, PLS-00905- object PARTIES_RESULT is invalid.
    i have used the create type thing to create this type.
    if i remove the out parameter it works, no compilation error.
    Questions i) How to return the associative array as out parameter?
    ii)Am i doing aynthing qrong here?
    iii) Can i open a ref cursor to this associative array and then return that ref_cursor?
    Please anyone reply back, Thanks in advance
    Message was edited by:
    user649602

    As an example:
    SQL> create type PARTIES is table of varchar2(2000);
      2  /
    Type created.
    SQL> create or replace procedure proc1(p_deptno number,gana out parties) as
      2  begin
      3   select ename
      4   bulk collect into gana
      5   from emp
      6   where deptno = p_deptno;
      7  end;
      8  /
    Procedure created.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Run report from PL/sql procedure

    Please any one tell how to I run a report from pl/sql procedure.

    I am not sure, but depending on your environment you can create a script to run your PL/SQL code and then generate the report. As is customary in an UNIX environment utilizing shell scripts.

  • Creating web service from pl/sql procedure

    Hello.
    I need to create a web service from pl/sql procedure and i chose JDeveloper for this implementation. I have wsdl, but I never created web services. So, I created web service with document/literal message format.
    But I have several troubles:
    1. All element names have lower case letters.
    2. The SOAP envelope must begin from words soapenv:Envelope but i have soap:Envelope.
    3. And operation name has tail like "Element".
    I know bad way for implement 1 and 3 points. It's a modification of java_wsdl_mapping.xml and wsdl files. But if I want to add new method to my service all changes will be cleaned. It's not critical but inconvenient to support.
    But for point 3 i have no ideas.
    This task is very important for me. Can somebody help me?
    JDeveloper 10.1.3.3
    Regards,
    Aleksey

    http://www.oracle.com/technology/obe/obe1013jdev/10131/wsfromplsqlpackage/devwsfrom%20plsql.htm
    Frank

  • How to call javascript function from PL/SQL procedure

    Can anybody advice me how to call javascript function from PL/SQL procedure in APEX?

    Hi,
    I have a requirement to call Javascript function inside a After Submit Process.
    clear requirement below:
    1. User selects set of check boxes [ say user want to save 10 files and ticks 10 checkboxes]
    2. user clicks on "save files" button
    3. Inside a After submit process, in a loop, i want to call a javascript function for each of the file user want to save with the filename as a parameter.
    Hope this clarify U.
    Krishna.

  • Unix shell script run from pl/sql procedure

    Hi Guru
    I want to run unix shell script from pl/sql procedure. Actual I want to run it from developer 10g form.
    Please guide me in this regards
    Regards
    Jewel

    Look at the host or client_host builtins in the help

  • Sending message from PL/SQL procedure to form

    Hello Friends,
    How can I send messages from PL/SQL procedure to Form ?
    Ultimate target is catching progress of PL/SQL procedure from
    form. I heard about DBMS_PIPe but not sure,.
    Adi

    Hello,
    Yeah , I got the solution using DBMS_PIPE function,I
    followed following steps.
    1. Pipe is created. see below procedure.
    create or replace procedure proc_testpipe as
         v_pipe_integer          integer;
         v_pipe_message          integer;
    begin
         v_pipe_integer := DBMS_PIPE.Create_Pipe('adipipe');
         dbms_pipe.pack_message('Hello Adinath Kamode,Message
         from Pipe');
         v_pipe_message := dbms_Pipe.Send_message('adipipe');
         end;
    end;
    2. then I created one Function which will obtain message from
    Pipe and
    will return value to form.
    create or replace function proc_callpipe return varchar2 as
    v_msg          integer;
    v_rem          integer;
    v_message          varchar2(500);
    begin
    v_msg:=dbms_pipe.receive_message('adipipe');
    dbms_pipe.unpack_message(v_message);
    dbms_pipe.purge('adipipe');
    v_rem := dbms_pipe.remove_pipe('adipipe');
    return(v_message);
    end;
    3. Last I called this function from form.
    Cheers .. !
    Adi

  • Creating Excel Workbook from PL/SQL Procedure

    I am trying to create Excel Workbook with two worksheets from PL/SQL procedure. I created one worksheet. Can I create a separate sheet from same procedure. I used OWA_UTIL.MIME_HEADER ('application/vnd.ms-excel', FALSE)
    command to create the spreadsheet.
    Any help would be helpful.
    Thanks
    Yagna Shah

    Further to my previous post here is how I will develop a typical master details excel report.
    by using the package,
    It will also show sum of salary at each department.
    Note : When I paste the code here I loose the indentation. So the code below is not indented properly.
    DECLARE
    r NUMBER := 0 ; --- r IS the ROW NUMBER IN this excel file
    l_sum NUMBER ;
    BEGIN
    --- Generate the styles that we need
    gen_xl_xml.create_excel( 'UTL_DIR','master_Detail.xls') ;
    gen_xl_xml.create_style( 'dept_title' , 'Arial', 'Red',14, p_backcolor => 'LightGray' );
    gen_xl_xml.create_style( 'sgs2' , 'Arial', NULL ,10, p_bold => TRUE );
    gen_xl_xml.create_style( 'sgs3' , 'Arial', 'blue',14 );
    gen_xl_xml.create_style( 'sgs4' , 'Arial', 'green',14 );
    gen_xl_xml.create_style( 'emp_title' , 'Arial', 'Black',9, p_backcolor => 'LightBlue' );
    gen_xl_xml.create_style( 'sal_tot' , 'Arial', 'Brown',13, p_backcolor => 'Yellow' );
    -- SET ANY COLUMN AND ROW changes
    gen_xl_xml.set_column_width( 3, 145 );
    gen_xl_xml.set_column_width( 4, 145 );
    l_sum := 0 ;
    FOR recd IN ( SELECT department_id, department_name FROM departments ) LOOP
    IF l_sum <> 0 THEN
    r := r +1 ;
    gen_xl_xml.write_cell_char( r, 4, 'Department Total ->' , 'sal_tot' );
    gen_xl_xml.write_cell_num( r, 5, l_sum , 'sal_tot' );
    l_sum := 0;
    END if ;
    r := r+1 ;
    gen_xl_xml.write_cell_CHAR( r,1, 'Department : '|| recd.department_name , 'dept_title' );
    -- As we need same style applied till the above data flows use write_cell_null
    gen_xl_xml.write_cell_NULL( r,2 , null );
    gen_xl_xml.write_cell_NULL( r,3, 'dept_title' );
    gen_xl_xml.write_cell_NULL( r,4, 'dept_title' );
    gen_xl_xml.write_cell_NULL( r,5, 'dept_title' );
    --- Add employee heading
    r := r+1 ;
    gen_xl_xml.write_cell_CHAR( r,2, 'EmployeeID' , 'emp_title' );
    gen_xl_xml.write_cell_CHAR( r,3, 'First Name' , 'emp_title' );
    gen_xl_xml.write_cell_CHAR( r,4, 'Last Name' , 'emp_title' );
    gen_xl_xml.write_cell_CHAR( r,5, 'Salary' , 'emp_title' );
    FOR rec IN (SELECT employee_id , first_name , last_name, salary FROM employees WHERE department_id = recd.department_id ) LOOP
    r := r+1 ;
    gen_xl_xml.write_cell_num( r,2, rec.employee_id, 'sgs2' );
    gen_xl_xml.write_cell_char( r,3, rec.first_name, 'sgs3' );
    gen_xl_xml.write_cell_char( r,4, rec.last_name , 'sgs4' );
    gen_xl_xml.write_cell_num( r,5, rec.salary );
    l_sum := l_sum + rec.salary ;
    END LOOP ;
    END LOOP ;
    gen_xl_xml.close_file ;
    END ;
    -----------------------------------------------------------------------------------------------------------------

  • Sending OS command from PL/SQL procedure

    "How can I send a operating system comand from PL/SQL procedure?
    I want to move , to copy , delete a file from a PL/sql procedure. i.e under unix send mv, cp or
    rm command";
    my e-mail is [email protected]

    take a look at
    http://asktom.oracle.com/pls/ask/f?p=4950:8:881946
    regards
    Freek D'Hooge
    "How can I send a operating system comand from PL/SQL procedure?
    I want to move , to copy , delete a file from a PL/sql procedure. i.e under unix send mv, cp or
    rm command";
    my e-mail is [email protected]

  • Error while pasing arrays to pl/sql procedure

    Hi,
    I am trying to pass an array from java to pl/sql procedure.
    I tried this code:
    CREATE OR REPLACE TYPE HEADER_UPLOAD IS OBJECT
    (VENDOR_NAME VARCHAR2(240) --hr_all_organization_units.name%TYPE
    ,BILL_TO_CUSTOMER_NAME VARCHAR2(240)-- hz_parties.party_name%TYPE
    ,BILL_TO_CUSTOMER_NUMBER VARCHAR2(240) --hz_cust_accounts.account_number%TYPE
    ,BILL_TO_SITE_USE_ID VARCHAR2(240) --hz_cust_site_uses_all.site_use_id%TYPE
    ,RESELLER_NAME VARCHAR2(240) --hz_parties.party_name%TYPE
    ,RESELLER_ADDRESS_1 VARCHAR2(240)--hz_locations.address1%TYPE
    ,RESELLER_ADDRESS_2 VARCHAR2(240)--hz_locations.address2%TYPE
    ,RESELLER_ADDRESS_3 VARCHAR2(240)--hz_locations.address3%TYPE
    ,RESELLER_ADDRESS_4 VARCHAR2(240)--hz_locations.address4%TYPE
    ,RESELLER_COUNTRY VARCHAR2(240)--hz_locations.country%TYPE
    ,RESELLER_STATE VARCHAR2(240) --hz_locations.state%TYPE
    ,RESELLER_CITY VARCHAR2(240)--hz_locations.city%TYPE
    ,RESELLER_POSTAL_CODE VARCHAR2(240)--hz_locations.postal_code%TYPE
    ,FEDERAL_GOVT_END_USER VARCHAR2(240)
    ,END_USER_NAME VARCHAR2(240)--hz_parties.party_name%TYPE
    ,END_USER_ADDRESS_1 VARCHAR2(240)--hz_locations.address1%TYPE
    ,END_USER_ADDRESS_2 VARCHAR2(240)--hz_locations.address2%TYPE
    ,END_USER_ADDRESS_3 VARCHAR2(240)--hz_locations.address3%TYPE
    ,END_USER_ADDRESS_4 VARCHAR2(240)--hz_locations.address4%TYPE
    ,END_USER_COUNTRY VARCHAR2(240)-- hz_locations.country%TYPE
    ,END_USER_STATE VARCHAR2(240) --hz_locations.state%TYPE
    ,END_USER_CITY VARCHAR2(240) --hz_locations.city%TYPE
    ,END_USER_POSTAL_CODE VARCHAR2(240)--hz_locations.postal_code%TYPE
    ,END_USER_CONTACT_NAME VARCHAR2(240)
    ,END_USER_EMAIL VARCHAR2(2000)
    ,SHIP_TO_CUSTOMER_NAME VARCHAR2(240)--ra_customers.customer_name%TYPE
    ,SHIP_TO_ADDRESS_1 VARCHAR2(240) --hz_locations.address1%TYPE
    ,SHIP_TO_ADDRESS_2 VARCHAR2(240) --hz_locations.address2%TYPE
    ,SHIP_TO_ADDRESS_3 VARCHAR2(240) --hz_locations.address3%TYPE
    ,SHIP_TO_ADDRESS_4 VARCHAR2(240) --hz_locations.address4%TYPE
    ,SHIP_TO_COUNTRY VARCHAR2(240) --hz_locations.country%TYPE
    ,SHIP_TO_STATE VARCHAR2(240) --hz_locations.state%TYPE
    ,SHIP_TO_CITY VARCHAR2(240)--hz_locations.city%TYPE
    ,SHIP_TO_POSTAL_CODE VARCHAR2(240)--hz_locations.postal_code%TYPE
    ,SHIP_TO_CONTACT_NAME VARCHAR2(240)
    ,SHIP_TO_CONTACT_PHONE VARCHAR2(50)
    ,SHIPPING_INSTRUCTIONS VARCHAR2(240)--oe_order_headers_all.shipping_instructions%TYPE
    ,SHIPPING_METHOD VARCHAR2(240) --fnd_lookup_values.meaning%TYPE
    ,ALERT_EMAIL VARCHAR2(2000)
    ,LICENSE_EMAIL VARCHAR2(2000)
    ,ORDER_CONTACT_FIRST_NAME VARCHAR2(150)
    ,ORDER_CONTACT_LAST_NAME VARCHAR2(150)
    ,ORDER_CONTACT_PHONE VARCHAR2(50)
    ,ORDER_CONTACT_FAX_NUMBER VARCHAR2(50)
    ,ORDER_CONTACT_EMAIL VARCHAR2(2000)
    ,NOTES VARCHAR2(4000)
    ,CURRENCY_CODE VARCHAR2(240) --fnd_currencies.currency_code%TYPE
    ,SERVICE_RENEWAL_ORDER varchar2(10)
    ,CUSTOMER_PO_NUMBER VARCHAR2(240) --oe_order_headers_all.cust_po_number%TYPE
    ,RESUBMITTED_ORDER VARCHAR2(10)
    ,PREV_CUSTOMER_PO_NUMBER VARCHAR2(240) --oe_order_headers_all.cust_po_number%TYPE
    ,END_USER_PO_NUMBER VARCHAR2(50)
    ,PO_NET_TOTAL NUMBER
    ,FOB VARCHAR2(240) --fnd_lookup_values.meaning%TYPE
    ,FREIGHT_TERMS VARCHAR2(240) --fnd_lookup_values.meaning%TYPE
    ,FREIGHT_ACCOUNT_NUMBER VARCHAR2(200)
    create or replace type header_upload_tab is table of header_upload;
    java code is: this is a java class which first inserts the csv file data into array headerdata
    public static String[] parseCSV(long l)
    throws SQLException, FrameworkException, IOException
    String s = "parseCSV";
    String lResult[] = new String[3];
    if(IBEUtil.logEnabled())
    IBEUtil.log("oracle.apps.ibe.shoppingcart.util.OrderUploadCSVReader", s, "Start");
    OracleConnection oracleconnection = (OracleConnection)TransactionScope.getConnection();
    OraclePreparedStatement oraclepreparedstatement = null;
    OracleResultSet oracleresultset = null;
    BLOB blob = null;
    long l1 = System.currentTimeMillis();
    if(IBEUtil.logEnabled())
    IBEUtil.log("oracle.apps.ibe.shoppingcart.util.OrderUploadCSVReader", s, "Before fetching the File data from FND_LOBS");
    oraclepreparedstatement = (OraclePreparedStatement)oracleconnection.prepareStatement(" SELECT FILE_DATA FROM FND_LOBS WHERE FILE_ID = :1 ");
    oraclepreparedstatement.defineColumnType(1, 2004);
    oraclepreparedstatement.setLong(1, l);
    try
    if(IBEUtil.logEnabled())
    IBEUtil.log("oracle.apps.ibe.shoppingcart.util.OrderUploadCSVReader", s, "Before Executing the query");
    oracleresultset = (OracleResultSet)oraclepreparedstatement.executeQuery();
    if(IBEUtil.logEnabled())
    IBEUtil.log("oracle.apps.ibe.shoppingcart.util.OrderUploadCSVReader", s, "After Executing the query");
    while(oracleresultset.next())
    blob = (BLOB)oracleresultset.getObject(1);
    finally
    if(oracleresultset != null)
    oracleresultset.close();
    if(oraclepreparedstatement != null)
    oraclepreparedstatement.close();
    if(oracleconnection != null)
    TransactionScope.releaseConnection(oracleconnection);
    if(IBEUtil.logEnabled())
    IBEUtil.log("oracle.apps.ibe.shoppingcart.util.OrderUploadCSVReader", s, "Time taken to get the BLOB object(" + (System.currentTimeMillis() - l1) + " milliseconds)");
    l1 = System.currentTimeMillis();
    if(IBEUtil.logEnabled())
    IBEUtil.log("oracle.apps.ibe.shoppingcart.util.OrderUploadCSVReader", s, "Get the stream from the BLOB");
    InputStreamReader inputstreamreader = new InputStreamReader(blob.getBinaryStream());
    if(IBEUtil.logEnabled())
    IBEUtil.log("oracle.apps.ibe.shoppingcart.util.OrderUploadCSVReader", s, "Before creating the csvreader");
    xxbcIbeOrderUploadCSVReader OrderUploadcsvreader = new xxbcIbeOrderUploadCSVReader(inputstreamreader);
    if(IBEUtil.logEnabled())
    IBEUtil.log("oracle.apps.ibe.shoppingcart.util.OrderUploadCSVReader", s, "After creating the csvreader");
    OrderUploadcsvreader.setFieldSeparator(",");
    OrderUploadcsvreader.setHandleEscapes(true);
    if(IBEUtil.logEnabled())
    IBEUtil.log("oracle.apps.ibe.shoppingcart.util.OrderUploadCSVReader", s, "Before getting the headers");
    // Fetch the Header Record
    ArrayList arraylistH = OrderUploadcsvreader.getHeaders();
    if(IBEUtil.logEnabled())
    IBEUtil.log("oracle.apps.ibe.shoppingcart.util.OrderUploadCSVReader", s, "After getting the headers");
    String s1 = (String)arraylistH.get(0);
    if ("HEADER".equals(s1))
    if(IBEUtil.logEnabled())
    IBEUtil.log("oracle.apps.ibe.shoppingcart.util.OrderUploadCSVReader", s, "Parse and Create the Header Record");
    // Fetch the Header Data. This data will be inserted into Staging table, XXBC_IBE_ORDER_HEADER_IFACE
    ArrayList arraylistHData = OrderUploadcsvreader.readRecord();
    String headerData[] = new String[60];
    for(int i = 1; i < arraylistH.size(); i++) {
    headerData[i] = "";
    for(int i = 1; i < arraylistH.size(); i++)
    String h_element = (String)arraylistH.get(i);
    String h_value = (String)arraylistHData.get(i);
    if(IBEUtil.logEnabled())
    IBEUtil.log("oracle.apps.ibe.shoppingcart.util.OrderUploadCSVReader", s, h_element);
    if ("VENDOR NAME*".equals(h_element)) headerData[1] = h_value;
    if ("BILL TO CUSTOMER*".equals(h_element)) headerData[2] = h_value;
    if ("BILL TO CUSTOMER NUMBER*".equals(h_element)) headerData[3] = h_value;
    if ("BILL TO SITE NUMBER*".equals(h_element)) headerData[4] = h_value;
    if ("RESELLER*".equals(h_element)) headerData[5] = h_value;
    if ("RESELLER ADDRESS LINE 1*".equals(h_element)) headerData[6] = h_value;
    if ("RESELLER ADDRESS LINE 2".equals(h_element)) headerData[7] = h_value;
    if ("RESELLER ADDRESS LINE 3".equals(h_element)) headerData[8] = h_value;
    if ("RESELLER ADDRESS LINE 4".equals(h_element)) headerData[9] = h_value;
    if ("RESELLER COUNTRY*".equals(h_element)) headerData[10] = h_value;
    if ("RESELLER STATE*".equals(h_element)) headerData[11] = h_value;
    if ("RESELLER CITY*".equals(h_element)) headerData[12] = h_value;
    if ("RESELLER POSTAL CODE*".equals(h_element)) headerData[13] = h_value;
    if ("FEDERAL GOVT END USER".equals(h_element)) headerData[14] = h_value;
    if ("END USER*".equals(h_element)) headerData[15] = h_value;
    if ("END USER ADDRESS LINE 1*".equals(h_element)) headerData[16] = h_value;
    if ("END USER ADDRESS LINE 2".equals(h_element)) headerData[17] = h_value;
    if ("END USER ADDRESS LINE 3".equals(h_element)) headerData[18] = h_value;
    if ("END USER ADDRESS LINE 4".equals(h_element)) headerData[19] = h_value;
    if ("END USER COUNTRY*".equals(h_element)) headerData[20] = h_value;
    if ("END USER STATE*".equals(h_element)) headerData[21] = h_value;
    if ("END USER CITY*".equals(h_element)) headerData[22] = h_value;
    if ("END USER POSTAL CODE*".equals(h_element)) headerData[23] = h_value;
    if ("END USER CONTACT**".equals(h_element)) headerData[24] = h_value;
    if ("END USER CONTACT EMAIL**".equals(h_element)) headerData[25] = h_value;
    if ("SHIP TO CUSTOMER*".equals(h_element)) headerData[26] = h_value;
    if ("SHIP TO ADDRESS LINE 1*".equals(h_element)) headerData[27] = h_value;
    if ("SHIP TO ADDRESS LINE 2".equals(h_element)) headerData[28] = h_value;
    if ("SHIP TO ADDRESS LINE 3".equals(h_element)) headerData[29] = h_value;
    if ("SHIP TO ADDRESS LINE 4".equals(h_element)) headerData[30] = h_value;
    if ("SHIP TO COUNTRY*".equals(h_element)) headerData[31] = h_value;
    if ("SHIP TO STATE*".equals(h_element)) headerData[32] = h_value;
    if ("SHIP TO CITY*".equals(h_element)) headerData[33] = h_value;
    if ("SHIP TO POSTAL CODE*".equals(h_element)) headerData[34] = h_value;
    if ("SHIP TO CONTACT**".equals(h_element)) headerData[35] = h_value;
    if ("SHIP TO CONTACT PHONE NUMBER**".equals(h_element)) headerData[36] = h_value;
    if ("SHIPPING INSTRUCTIONS".equals(h_element)) headerData[37] = h_value;
    if ("SHIPPING METHOD*".equals(h_element)) headerData[38] = h_value;
    if ("ALERT EMAIL*".equals(h_element)) headerData[39] = h_value;
    if ("LICENSE EMAIL**".equals(h_element)) headerData[40] = h_value;
    if ("ORDER CONTACT FIRST NAME*".equals(h_element)) headerData[41] = h_value;
    if ("ORDER CONTACT LAST NAME*".equals(h_element)) headerData[42] = h_value;
    if ("ORDER CONTACT PHONE NUMBER*".equals(h_element)) headerData[43] = h_value;
    if ("ORDER CONTACT FAX NUMBER".equals(h_element)) headerData[44] = h_value;
    if ("ORDER CONTACT EMAIL*".equals(h_element)) headerData[45] = h_value;
    if ("NOTES".equals(h_element)) headerData[46] = h_value;
    if ("CURRENCY*".equals(h_element)) headerData[47] = h_value;
    if ("SERVICE RENEWAL ORDER".equals(h_element)) headerData[48] = h_value;
    if ("CUSTOMER PO NUMBER*".equals(h_element)) headerData[49] = h_value;
    if ("RESUBMISSION*".equals(h_element)) headerData[50] = h_value;
    if ("PREVIOUS CUSTOMER PO NUMBER**".equals(h_element)) headerData[51] = h_value;
    if ("END USER PO NUMBER".equals(h_element)) headerData[52] = h_value;
    if ("PO NET TOTAL*".equals(h_element)) headerData[53] = h_value;
    if ("FOB*".equals(h_element)) headerData[54] = h_value;
    if ("FREIGHT TERMS*".equals(h_element)) headerData[55] = h_value;
    if ("FREIGHT ACCOUNT NUMBER".equals(h_element)) headerData[56] = h_value;
    if(IBEUtil.logEnabled())
    IBEUtil.log("oracle.apps.ibe.shoppingcart.util.OrderUploadCSVReader", s, (String)headerData);
    } // End of processing Header Data
    if(IBEUtil.logEnabled())
    IBEUtil.log("oracle.apps.ibe.shoppingcart.util.OrderUploadCSVReader", s, "Insert the Header Record into Interface Table");
    if(IBEUtil.logEnabled())
    IBEUtil.log("oracle.apps.ibe.shoppingcart.util.OrderUploadCSVReader", s, (String)headerData[1]);
    if(IBEUtil.logEnabled())
    IBEUtil.log("oracle.apps.ibe.shoppingcart.util.OrderUploadCSVReader", s, (String)headerData[2]);
    if(IBEUtil.logEnabled())
    IBEUtil.log("oracle.apps.ibe.shoppingcart.util.OrderUploadCSVReader", s, "checkpoint");
    oracleconnection = (OracleConnection)TransactionScope.getConnection();
    oracleconnection.setAutoCommit(true);
    if(IBEUtil.logEnabled())
    IBEUtil.log("oracle.apps.ibe.shoppingcart.util.OrderUploadCSVReader", s, "After getting connection");
    ArrayDescriptor descriptor = ArrayDescriptor.createDescriptor( "HEADER_UPLOAD_TAB", oracleconnection );
    if(IBEUtil.logEnabled())
    IBEUtil.log("oracle.apps.ibe.shoppingcart.util.OrderUploadCSVReader", s, "before new array");
    ARRAY array_to_pass = new ARRAY( descriptor, oracleconnection, headerData );
    if(IBEUtil.logEnabled())
    IBEUtil.log("oracle.apps.ibe.shoppingcart.util.OrderUploadCSVReader", s, "calling procedure");
    OraclePreparedStatement ps =
    (OraclePreparedStatement)oracleconnection.prepareStatement ( "BEGIN insert_data(:1); END;" );
    ps.setARRAY( 1, array_to_pass );
    ps.execute();.......continued
    the above code executes till the message :---IBEUtil.log("oracle.apps.ibe.shoppingcart.util.OrderUploadCSVReader", s, "before new array");
    after that it gives error as :---Exception=java.sql.SQLException: Fail to convert to internal representation
    Kindly Help....
    Thanks in advance
    Gaurav

    Gaurav,
    Just a guess, but try the following:
    ArrayDescriptor descriptor = ArrayDescriptor.createDescriptor( "SCOTT.HEADER_UPLOAD_TAB", oracleconnection );In other words, prefix the data-type name, HEADER_UPLOAD_TAB, with its schema owner name.
    Good Luck,
    Avi.

  • Passing ARRAYs to PL/SQL procedure

    Hi,
    How do i pass an array(from java program) to pl/sql stored procedure, and after doing some data manipulation in the database, i wanted to pass back the same array to the java program. Can anyone help me or post some sample code here?
    Thanks in advance.
    Kumar
    null

    Are you hoping to use JDBC or ODBC to pass this array? If JDBC, I'd suggest asking this question on the JDBC forum.
    Justin Cave
    ODBC Development

  • Execute report from pl/sql procedure

    hi all
    please, can i know whether there's any way to execute a report from pl/sql stored procedure??
    thank you.

    Hallo,
    usually you would use 21.1 The Event-Driven Publishing API
    You can search the forum for examples Google: site:forums.oracle.com call report from pl/sql
    Regards
    Marcus

  • Creating page items from pl/sql procedure and using them on a page

    I have a page containing 2 select lists (P21_DEPARTMENTS and P21_DATE). Originally I added them as items that were "select list with submits". The problem is that based on the clearance level of the currently logged on user I only wanted the P21_DEPARTMENTS to be a select list if the user was an administrator. If however the user is not an admin then I want the page to have a hidden form field called P21_DEPARTMENTS that stores the user's department and has a label item that has the department name.
    There is also a report region that generates a table based on the department selected from the select list (if the user is an admin) or the value stored in the hidden form field if the user is not.
    My problem is that I cannot have both those items on the same page and use the HTML built-in authentication to determine which item should be rendered because I need to use the same ID for both items so that the stored procedure in my report region doesn't break. HTML does not permit items to share the same ID.
    I tried to circumvent the problem by creating a stored procedure that performs all of the item rendering in the procedure and uses "htp.p()" to output all of my HTML code. This solution would allow me to pass a parameter into the procedure informing me as to whether or not the user is an administrator. If the user is an administrator the procedure would use a conditional statement and render a select list. If not, the hidden form field and label option would be used instead.
    I finally got the stored procedure working perfectly. Now I am encountering the most bizarre thing. Since the "select list with submit" was not working (I used the same code that gets generated when I created other items using htmlDB's GUI) I decided to use a JavaScript function instead that gets triggered by the onChange event. I send along the value that is currently selected in the select list and in the function I set:
    location.href='http://www.myoraclesite.com/pls/htmldb/f?p=111:21:729740000000000000::NO::P21_DEPARTMENTS:1';
    In theory this should work. The problem is that it doesn't. The page reloads and the P21_DEPARTMENTS select list is not pre-selected.
    The only thing I can think of is that when htmlDB generates page items that you've created with it's own admin tool it assigns some internal guid or something as opposed to when someone tries to generate dynamic page items of their own from a pl/sql procedure it's like the application doesn't even know they exist.
    Any help would be GREATLY appreciated.
    My only other solution would be to create a totally separate page (one for admin and another for non-admin). I would really like to avoid this.
    Thanks in advance.

    I would love to be able to generate my menus and
    various other items in my htmlDB applications in much
    the same way I can using ASP, PHP and Cold Fusion.
    Users should have the ability to write server-side
    code wherever they feel like it. The way htmlDB works
    right now I spend more time trying to figure out how
    to create simple effects and generate simple
    interfaces when I need to be building a portal. Ami - it's important to understand that HTML DB is not like other languages. Thus, trying to force concepts which are common in other languages into HTML DB will often result in more work.
    It's definitely worth the time to go over the HTML DB 2-day Developer, which can be found here: http://www.oracle.com/technology/products/database/htmldb/pdf/B14377_01.pdf
    I can build a portal using Classic ASP, C#, PHP or Cold
    Fusion in like 1/10 of the time that it takes me to
    build one using htmlDB. I understand that this is not
    meant for the hard-core programmer but no web
    programming application in today's day and age should
    prevent experts from getting under the hood.And I can build a Portal in HTML DB in 1/10 the time it will take me to do it in any other language. It's like anything else - proficiency comes with practice and work.
    As for getting under the hood, there is plenty of places you can do that with HTML DB. Keep in mind that HTML DB itself is an HTML DB application, so the limits on what you can build with HTML DB are virtually limitless.
    Sorry for the vent there. After spending the last 2
    days trying to figure out how to implement such a
    straightforward thing and now being informed that it
    can't be done kind of bugged me.I understand your frustration, as I've been there before. My rule for beginners is that if you are writing more than a line or two of code in the first week, you're doing something wrong. Stop, take a break, and then use the ample resources (including searching this forum) to help solve your problem. There are plenty of resources available for you to learn about HTML DB on the HTML DB home page: http://otn.oracle.com/htmldb
    Good luck,
    - Scott -

  • Producing text file from PL/SQL procedure (UTL_FILE)?

    Hi,
    I need to produce a text file from a PL/SQL procedure. My output should be a little over 38K records and my query has 70 fields. I'd like to separate the fields by pipe delimiters in the text file. I can either concatenate all 70 fields into one variable for each record or send all 70 fields over with a pipe, whichever is easier. It looks like I can't spool within PL/SQL but UTL_FILE might be an option from what I'm reading. Does anyone have any good, simple example(s) to produce a text file using this package in calling multiple fields from a LOOP? Our os is UNIX and db is Oracle 9i.
    Also, I've read that UTL_FILE has a record output of 1,023 bytes. Is this for each record line or the whole file size? I belive the max # of characters for each line wouldn't exceed 500 characters. The 38K rows I have for the data set would be well over 1MB. If this is the case, is there a work around to produce a larger text file?
    Any suggestions and/or examples would be greatly appreciated.
    Thanks,
    Eric

    Assuming the goal is to create a text file on the database server, you can use UTL_FILE here. Each line can be 1023 characters, but you can have as many lines as you'd like.
    Tom Kyte has an example here
    http://asktom.oracle.com/pls/ask/f?p=4950:8:::::F4950_P8_DISPLAYID:235814350980
    Justin
    Distributed Database Consulting, Inc.
    http://www.ddbcinc.com/askDDBC

  • XML Data from PL/SQL procedure -- special character issue (eBS)

    Hi All,
    I am developing a report, where the XML data is created by a PL/SQL procedure. I chose this approach over a data template, since there is a lot of processing involved in producing the actual data, and it cannot be done by select-statements alone. The report is run as a regular concurrent request.
    So far so good. There is a problem though. Every time the data contains special characters (ä, ö, umlauts), the concurrent request is completed with a warning, the log confirms that "One or more post-processing actions failed.", also there is no output file. The XML structure is valid as such. The report runs smoothly and produces the output when the XML data does not contain special characters.
    I am producing the XML lines by using the standard FND_FILE.PUT_LINE procedure: Fnd_File.put_line(Fnd_File.output, '<?xml version="1.0" encoding="UTF-8"?>'); This seems like a character encoding issue, but declaring the UTF-8 encoding in this way does not solve the problem.
    Any ideas what can be done to fix this? I have been searching Metalink but cannot find an answer. Many thanks for your kind help.
    Best Regards, Matilda

    Hi Rajesh,
    One idea I have, is that it might be possible to modify the PL/SQL code into a "before report" type trigger, attached to a data template. The code would process the data and write the lines into a temporary table, from which the data template could retrieve them in a simple select-query. However, it would be neat to be able to solve this without adding an extra layer of processing, since BI Publisher supposedly supports PL/SQL procedures as the data source.
    The data in this case is all correct, special characters are an intrinsic feature of the Finnish language. :)
    Best Regards, Matilda

Maybe you are looking for

  • Can I hook up a windows computer to my airport time capsule for internet access?

    We have hooked up our time capsule for the first time today.  It works wonderful on our apple products BUT can I connect a windows based computer to it for internet access? 

  • I cant update my ipod touch 3rd generation

    when I try to update the IOS version on my ipod touch 3rd gen. it goes through the whole process then says "unkown error occurred (-1.) unable to restore ipod" it only has IOS 2.2 so I cant download any games or apps, it wont even let me download ibo

  • How to insert automatic, serial numbering in Illustrator CS, v. 11

    I am trying to create a series of raffle tickets and would like to have each ticket identified with a unique number, generated in order--so that the first ticket reads "number 1", the second ticket reads "number 2", etc. I know how to do this sort of

  • How to remove old stuff

    I do have some misbehaviors on my Macs user accounts. I thought about instaling a new clean system and a reformatting the harddisc before, but when I like to import the user accounts, I will get all old stuff from the previous installation back to my

  • Image quality / compression on 3G data connections

    Hi, Does anyone know a work-around to the image compression problem that happens when using 3G modems to access the Internet? On Firefox you can hit SHIFT+A to send a request to reload all images on a webpage and this request bypasses the ISP's compr