Passing collection parameters from/to Oracle 8i stored procedure to/from Weblogic java program

Environment- Oracle DB 8.1.7 (Sun) - JDBC OCI 8.1.7 - Application Server (WebLogic 6.0 or 6.1)QuestionHow to pass oracle collection data types from PL/SQL stored procedures to Weblogic java program as in/out stored procedures parameters. I am hitting oracle error 2006 unidentified data type trying to pass the following data types:-o java.sql.Structo java.sql.Arrayo oracle.sql.STRUCTo oracle.sql.ARRAYo oracle.jdbc2.Structo oracle.jdbc2.Arrayo any class implemented oracle.jdbc2.SQLData or oracle.sql.CustomDatumInformationAbout PL/SQL stored procedure limitation which only affects the out argument types of stored procedures calledusing Java on the client side. Whether Java methods cannot have IN arguments of Oracle 8 object or collection type meaning that Java methods used to implement stored procedures cannot have arguments of the following types:o java.sql.Structo java.sql.Arrayo oracle.sql.STRUCTo oracle.sql.ARRAYo oracle.jdbc2.Structo oracle.jdbc2.Arrayo any class implemented oracle.jdbc2.SQLData or oracle.sql.CustomDatum

this is becoming a mejor problem for me.And are you storing it as a blob?
Oracle doesn't take varchars that big.
And isn't LONG a deprecated field type for Oracle?
From the Oracle docs......
http://download-west.oracle.com/docs/cd/B13789_01/server.101/b10759/sql_elements001.htm#sthref164
Oracle strongly recommends that you convert LONG RAW columns to binary LOB (BLOB) columns. LOB columns are subject to far fewer restrictions than LONG columns. See TO_LOB for more information.

Similar Messages

  • Stored Procedure call from JDBC sender for Oracle Database

    Hi,
    I have a requirement to call stored procedure using JDBC sender adapter for retriving data from an Oracle database.
    I need to execute first stored procedure call from Querry SQL statement and then trigger second stored procedure call for confirming the succesful retrival of those records from the update SQL statement.
    Querries:
    1. Can we trigger stored procedure from Update statement of JDBC sender.
    2. Can we call stored procedure from Querry statement, since I have read on other sdn threads that stored procedure calls on Oracle database are not allowed. If not possible to have "Execute stored procedure" would the function call (select * from table(function name)) work same as stored procedure.
    3. In a JDBC sender the Querry statement and Update statement are executed in same session call and same database connection. What happens if the querry statement was not succesful, would the update be still triggered.
    Please note PI does not have direct access to main table and hence the need to have separate stored procedure calls.
    The PI version is PI 7.11 sp4.
    Appreciate your inputs.
    Thanks.
    Siddhesh S.Tawate

    >1. Can we trigger stored procedure from Update statement of JDBC sender.
    I think not possible using update statement.
    > Can we call stored procedure from Querry statement, since I have read on other sdn threads that stored procedure calls on Oracle database are not allowed. If not possible to have "Execute stored procedure" would the function call (select * from table(function name)) work same as stored procedure.
    Yes using select query you can call stored procedure.
    >. In a JDBC sender the Querry statement and Update statement are executed in same session call and same database connection. What happens if the querry statement was not succesful, would the update be still triggered.
    No select and update handles in the same session using the same thread so if one transaction fails update should not proceed.

  • Pass a jdbc resultset in to a Stored Procedure

    Any answer to the following question would be highly appreciated:
    How can we pass a jdbc resultset in to a Stored Procedure?
    Thanks.

    You could use Oracle's ANYDATASET type or declare schema TYPEs to support passing the data in a known structure. See "Working with Oracle Collections" in the "JDBC Developer's Guide and Reference" on technet.

  • How to Insert date in 'DD/MM/YYYY' format in oracle using stored procedure?

    Hi
    How to Insert date in 'DD/MM/YYYY' format in oracle using stored procedure?
    This is my Input data.
    11/25/2007.
    By using below query, it is inserted into database.
    sql>Insert into tblname values(to_date('11/25/2007','MM/DD/YYYY'));
    But using stored procedure, the same query is not running.
    It shows error like
    ORA-01843: not a valid month ORA-06512: at line 1
    Procedure:
    create or replace procedure Date_Test(datejoin in DATE) is
    begin
    insert into datetest values(to_date(datejoin,'MM/DD/YYYY'));
    end Date_Test;
    I had used 'nls_date_language = american' also.
    Prcodeure is created but not worked in jsp. The same error is thrown.
    Pls provide a solution

    This might help you....
    SQL> Create Table DateTest(col1 Date);
    Table created.
    Elapsed: 00:00:00.00
    SQL> create or replace procedure Date_Test(datejoin in DATE) is
    2 begin
    3 insert into datetest values(to_date(datejoin,'MM/DD/YYYY'));
    4 end ;
    5 /
    Procedure created.
    Elapsed: 00:00:00.00
    SQL> exec Date_Test('11/25/2007');
    BEGIN Date_Test('11/25/2007'); END;
    ERROR at line 1:
    ORA-01843: not a valid month
    ORA-06512: at line 1
    Elapsed: 00:00:00.00
    SQL> exec Date_Test(To_Date('11/25/2007','mm/dd/yyyy'));
    BEGIN Date_Test(To_Date('11/25/2007','mm/dd/yyyy')); END;
    ERROR at line 1:
    ORA-01843: not a valid month
    ORA-06512: at "CTBATCH.DATE_TEST", line 3
    ORA-06512: at line 1
    Elapsed: 00:00:00.00
    SQL> create or replace procedure Date_Test(datejoin in DATE) is
    2 begin
    3 insert into datetest values(datejoin);
    4 end ;
    5 /
    Procedure created.
    Elapsed: 00:00:00.00
    SQL> exec Date_Test(To_Date('11/25/2007','mm/dd/yyyy'));
    PL/SQL procedure successfully completed.
    Elapsed: 00:00:00.00
    SQL> Select * from DateTest;
    COL1
    25-NOV-07
    Elapsed: 00:00:00.00
    SQL> create or replace procedure Date_Test(datejoin in VarChar2) is
    2 begin
    3 insert into datetest values(to_date(datejoin,'mm/dd/yyyy'));
    4 end ;
    5 /
    Procedure created.
    Elapsed: 00:00:00.00
    SQL> exec Date_Test('11/25/2007');
    PL/SQL procedure successfully completed.
    Elapsed: 00:00:00.00
    SQL> select * from DateTest;
    COL1
    25-NOV-07
    25-NOV-07
    Elapsed: 00:00:00.00
    SQL>

  • Creating a Oracle 10g stored procedure as a datasource for  crystal 9 repor

    Can someone direct me to instructions or information on how to create a Oracle 10g stored procedure as a datasource for  my Crystal  Reports 9.0  report?

    i've found this example for you
    http://www.pdssoftware.com/newsletter/mar07/page6.htm
    and you could be able to get the guides from the SAP guide website for the products
    http://help.sap.com/businessobject/product_guides/
    hope this was helpful
    good luck
    Amr

  • Execution Times of Stored Procedures Called from Other Stored Procedures

    If I execute sys.dm_exec_procedure_stats, it will produce execution times of my stored procedures executed recently.
    However, stored procedures called from other stored procedures do not show up.
    Is there code that can return the execution times of stored procedures even though they are called from other stored procedures.

    Look at the example. It is counting nested execution.
    CREATE PROC z1SP AS SELECT * FROM Production.Product;
    GO
    CREATE PROC z2SP AS SELECT * FROM Production.Product WHERE Color is not null; EXEC z1SP;
    GO
    SELECT object_name(2002822197), object_name(2034822311);
    --z1SP z2SP
    EXEC z1SP; EXEC z2SP;
    GO 10
    SELECT * from sys.dm_exec_procedure_stats
    database_id object_id type type_desc cached_time last_execution_time execution_count
    16 2002822197 P SQL_STORED_PROCEDURE 2014-12-16 13:02:45.170 2014-12-16 13:02:46.717 20
    16 2034822311 P SQL_STORED_PROCEDURE 2014-12-16 13:02:45.460 2014-12-16 13:02:46.687 10
    Kalman Toth Database & OLAP Architect
    SQL Server 2014 Database Design
    New Book / Kindle: Beginner Database Design & SQL Programming Using Microsoft SQL Server 2014

  • Pass a null value to a JDBC stored procedure call?

    pass a null value to a JDBC stored procedure call? Is this even possible? My DBA gave me a procedure to call that sometimes requires a null value. I don't think this is even possible.

    do you mind tell me how to resolve your problem?i using the setnull method,but it doesn't work.

  • Is it possible to pass TABLE as the output parameter in stored procedure

    Hey Experts,
      Is it possible to pass TABLE as the output parameter in stored procedure.
    eg
    create procedure spGetData
    @tableName as TABLE(intValue INT NOT NUL)
    as 

    You can use OPENQUERY or OPENROWSET, as mentioned above, to make stored procedure results table like. There are
    some limitations with these methods:
    http://technet.microsoft.com/en-us/library/ms188427.aspx
    In OPENQUERY this-sql-server-instance can be used instead of a linked server name. It requires setting data accces server option:
    exec sp_serveroption @server = 'PRODSVR\SQL2012'
    ,@optname = 'DATA ACCESS'
    ,@optvalue = 'TRUE'
    LINK: http://www.sqlusa.com/bestpractices/select-into/
    Kalman Toth Database & OLAP Architect
    SELECT Video Tutorials 4 Hours
    New Book / Kindle: Exam 70-461 Bootcamp: Querying Microsoft SQL Server 2012

  • Passing multiple parameters to an Oracle procedure

    I'm having trouble passing multiple parameters to a stored procedure in Crystal Reports 2008 (12.2.0.290).
    I'm using an OLE DB (ADO) connection to an Oracle 10g database.
    I have created a stored procedure that has 3 parameters (in out sys_refcursor, in varchar2, in varchar2) and conforms to all of Crystal Reports' requirements for stored procedures.
    When I select my stored procedure in the Database Expert, it prompts me to enter values for both varchar2 parameters. I enter values and everything seems fine. I close the Database Expert.
    Now the stored procedure is listed in the Field Explorer, but I cannot expand the list of fields. There is a plus sign next to the stored procedure, but clicking on it does nothing. I do not get any error messages.
    If I remove one of the parameters from the stored procedure and try again, everything works fine. I've also tried using a variety of parameter types, but this problem occurs every time there are 2 or more parameters (3 including the ref cursor).
    Please help.

    Try a different Database driver...

  • Passing UDT TABLE of VARCHAR as an Input parameter in Stored procedure call from java

    I have following Type defined at the schema: ident_arr IS TABLE OF VARCHAR2(100) which is type of one of the input parameters. I am able to create oracle.sql.ARRAY object to map it with this UDT before calling my stored procedure from java. When I execute my stored procedure, I get the following error:
    ORA-06550: line 1, column 7:
    PLS-00306: wrong number or types of arguments in call to 'P_PV_WCC_INSERT'
    ORA-06550: line 1, column 7:
    PL/SQL: Statement ignored
    I have already checked all other parameter types.

    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

  • How to get multiple out parameters from a pl/sql stored procedure in ADF Jdeveloper 11g release2

    I´m trying to call from AppModuleImpl a stored procedure from my oracle DB which receives one input parameter and returns 5 out parameters. 
    I´m using jdeveloper 11g release2  ADF and I have created a java bean "ProRecallPlatesBean " with the atributes and accesors and I serialize it. just like in this article http://docs.oracle.com/cd/E24382_01/web.1112/e16182/bcadvgen.htm#sm0297
    This is my code so far:
    public ProRecallPlatesBean getCallProRecallPlates(String numPlates) {
    CallableStatement st = null;
    try {
              // 1. Define the PL/SQL block for the statement to invoke
              String stmt = "begin CTS.Pk_PreIn.proRecallPlates(?,?,?,?,?,?); end;";
              // 2. Create the CallableStatement for the PL/SQL block
              st = getDBTransaction().createCallableStatement(stmt,0);
              // 3. Register the positions and types of the OUT parameters
              st.registerOutParameter(2,Types.VARCHAR);
    st.registerOutParameter(3,Types.VARCHAR);
    st.registerOutParameter(4,Types.VARCHAR);
    st.registerOutParameter(5,Types.VARCHAR);
    st.registerOutParameter(6,Types.VARCHAR);
    // 4. Set the bind values of the IN parameters
    st.setString(1,numPlates);
    // 5. Execute the statement
    st.executeUpdate();
    // 6. Create a bean to hold the multiple return values
    ProRecallPlatesBean result = new ProRecallPlatesBean();
    // 7. Set values of properties using OUT params
    result.setSpfVal(st.getString(2));
    result.setTransportTypeVal(st.getString(3));
    result.setTransportCompanyVal(st.getString(4));
    result.setCompanyDescrVal(st.getString(5));
    result.setDGAPrint(st.getString(6));
    // 8. Return the result
    return result;
    } catch (SQLException e) {
    throw new JboException(e);
    } finally {
    if (st != null) {
    try {
    // 9. Close the JDBC CallableStatement
    st.close();
    catch (SQLException e) {}
    In Jdeveloper I went into AppModule.xml JAVA>Client Interface section and expose "getCallProRecallPlates" Then I can see "getCallProRecallPlates" in Data Controls, I drag and drop it to a JSF page, an input text component and a button are generated in order to put in there the procedure input parameter (numPlates).
    I don't know if I'm on the right track.
    When I click the button, the "result" variable is supposed to be filled with data from the stored procedure. I want each of those values to be displayed in Output text or input text adf components but I dont know how. Thank you very much in advance I´m a newbie and i'll appreciate your help!

    What version are you on?
    Works fine for me on my 11g:
    SQL> create or replace procedure testxml (clob_out out clob)
      2  is
      3     l_clob   clob;
      4     l_ctx    dbms_xmlquery.ctxhandle;
      5  begin
      6     l_ctx := dbms_xmlquery.newcontext ('select * from dual');
      7     l_clob := dbms_xmlquery.getxml (l_ctx);
      8     clob_out := l_clob;
      9     dbms_xmlquery.closecontext (l_ctx);
    10  end testxml;
    11  /
    Procedure created.
    SQL>
    SQL> variable vout clob;
    SQL>
    SQL> exec testxml (:vout)
    PL/SQL procedure successfully completed.
    SQL>
    SQL> print vout
    VOUT
    <?xml version = '1.0'?>
    <ROWSET>
       <ROW num="1">
          <DUMMY>X</DUMMY>
       </ROW>
    </ROWSET>But definitely you can optimize your proc a bit: Try
    create or replace procedure testxml (clob_out in out nocopy clob)
    is
       l_ctx    dbms_xmlquery.ctxhandle;
    begin
       l_ctx := dbms_xmlquery.newcontext ('select * from dual');
       clob_out := dbms_xmlquery.getxml (l_ctx);
       dbms_xmlquery.closecontext (l_ctx);
    end testxml;
    /

  • URGENT: Passing Array from JSP to a Stored Procedure

    Hi,
    Can some one please help me understanding how can I pass array from JSP page to a stored procedure in database.
    Thanks in advance.
    Jatinder

    Thanks.
    I tried ArrayExampla.java and was successful in passing array values to the stored database procedure.
    How can I use this class in JSP? Like I have first JSP where in I will collect input from the user and then submit it to the second JSP - that needs to call the ArrayExample.java to pass the values as array to the database.
    How should I call this java code in my second JSP?
    Thanks in advance.

  • Passing parameters to sub report's stored procedure

    I'm attempting to pass values from the main report to a linked sub report's stored procedure, but I haven't been successful yet.
    I know how to filter the parameters on the return set of the stored procedure, using parameters from the main report. However, I would like the stored procedure executed for each record of the main report, using those values passed.

    I was getting "missing parameter values" trying to send parameters to a stored procedure in the subreport.  Turns out there is a hot fix for my issue.  Not sure if it matches what you're trying to do; you need to give more information on what you've already tried.
    I was using CR XI, and also CR for VS 2005. The problem seems to be fixed with CR VS2005 SP1, for Visual Studio CR.
    Look up under Business Objects Downloads: Crystal Reports > .NET > Hot Fixes
    Files:
    CRRedist2005_x86.msi
    crvs05sp1.exe
    Then open the report again, and re-save it.
    This has fixed the problem for me.
    Good luck!

  • Calling stored procedure (AS400) from Oracle

    From Oracle, I can't call a simple stored procedure (function created on a AS400) :
    1) Let's take a basic function in AS400
    CREATE FUNCTION TEST.TEST2 (x INTEGER)
    RETURNS INTEGER LANGUAGE
    SQL CONTAINS
    SQL NO EXTERNAL ACTION DETERMINISTIC
    RETURN x * 2
    2) Let's test the function in AS400 with a simple SQL :
    SELECT TEST.TEST2(5) FROM SYSIBM.SYSDUMMY1
    The return result : 10
    3) I give the maximum Grants to this function
    GRANT ALL ON FUNCTION TEST.TEST2 TO PUBLIC;
    4) Testing the function in ORACLE with a simple SQL (with the gateway) :
    SELECT TEST.TEST2@DB2DBLINK(5) FROM DUAL
    The return result : ERRORS: ORA-06571 and ORA-06512
    QUESTION:
    Is there any tricks or setting on the gateway to make works functions and also procedures?
    Thanks if anyone can help,
    Michel

    Michel,
    This is 'expected' behavior when using an DB2/400 function, but the manual describes on how to be able to use a DB2/400 function:
    Oracle® Transparent Gateway for DB2/400
    Installation and User’s Guide
    10g Release 2 (10.2) for IBM iSeries OS/400
    Chapter 9 - Developing aplication
    Paragraph - 9.6 Using DB2/400 Stored Functions with the Gateway
    <snippet>
    If the stored function is referenced within a SQL command, then the user must specify its name in the IFS file /HOME/MYINST/RDBMS/ADMIN/CALL_NAMES.ORA, where, MYINST is your instance name. If you attempt to use an AS/400 stored function (DB2/400 user defined function) in a SQL command without specifying that name in the above IFS file, then you will get the Oracle error 'ORA-06571: function xxxxx does not guarantee not to update database'. After changing this file, it is recommended that you bring down and then re-start the instance. Other than the declaration of the function name in the above IFS file, the gateway does not require any other special definitions in order to invoke the DB2/400 stored function.
    </snippet>
    The manual can be downloaded from http://docs.oracle.com :
    http://download.oracle.com/docs/cd/B19306_01/gateways.102/b16222.pdf
    Ed

  • How can I pass a BLOB parameter 32K from VB to a stored procedure?

    I am using Visual Basic 6 and the Oracle database 10g to call stored procedures. I am passing a XML input parameter to this stored proc. This variable has been defined as BLOB in stored proc and as XMLType in the table to which it finally gets stored through procedure.
    But there seems to be a limit to the size of a parameter you can pass in. This seems to be 32K!!! It works fine as long as my input is < 32k but once it becomes > 32k, Oracle gives the following error:-
    "ORA-01460: unimplemented or unreasonable conversion requested"
    I searched on net and found lots of examples for a workaround with .Net (using OracleLob). For Vb6, the only examples I found were using AppendChunk method etc through a loop, where each call will insert 32k chunk. But, that would mean lots of calls to stored proc, as we need to do this for thousands of files and each file of size > 100k.. So, this method would not be acceptable.
    Can someone please help me with this.

    Mofizur,
    You can achieve the same using Session variable.
    If u are not executing the VO after PR. Then you will be able to get the same value as u are using in PR
    String transactionId = (String) vo_trans.first().getAttribute("Getnexttrans");
    Note - You have a few of the threads left open, mark it as answered if solved.
    Regards,
    Gyan

Maybe you are looking for

  • Nvidia 8600M GT GPU issues - please explain

    what is this exactly? well, whatever it is, someone told me this is why my MBP is in shop right now! screen went totally black lastnight with the computer running fine and normal. if this Nvidia thing is truly the problem and damaged, is this a big d

  • Problem when displaying smartform in chinese language

    Hi , I have copied a standard smart form into Z smartform and added few fields in it  as per the requirement . When I display form in english or german it prints correctly . when I print it in Chinese it prints the workarea name which I am using to p

  • SQL Loader / WHEN clause / swich off? / bloated log files

    Hallo everyone, I am loading data from very large source files using SQL-Loader. This all works fine. However, now, using the WHEN clause (in the control file), I would like to load only a very restricted sub-set of the main data. This also works fin

  • Problems creating 9i db on local machine

    Hi guys I am trying to create a 9i database on my laptop (running Windows2000 Pro) which currently has Oracle Designer 6i on it too. I want to be able to use Designer against 9i databases that I create on the same machine. I cannot get the createdb s

  • Replace WLC Mobility Group Anchor

    We have 2 5508 and 1 4402 WLCs and all belong to the same mobility group. The 4402 does not have any access points and does nothing more than serve as a mobility anchor for our public wireless SSID. We are planning to replace the 4402 with a new 2504