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.

Similar Messages

  • 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

  • Response from one stored proc. to another stored procedure call in JDBC

    Hi,
    I have to call 2 stored procedures, where the response from first stored procedure ( an id) is mapped as a parameter to the second stored procedure call.
    My question is that can this be achieved without using BPM?
    Can we somehow map the response from the stored procedure 1 to stored procedure 2 parameter w/o using BPM?
    I have to insert multiple rows using the stored procedure.
    Should I use STATEMENT unbounded times ( which means stored procedure is called multiple times) or should I use the parameter as unbounded ( like an array, maybe define the parameter as an array in the stored procedure)?
    From the performance standpoint, which approach is better?
    Please suggest.

    Hi Ardent !
    I think you could use 2 mapping programs (message mapping objects) in your interface mapping. The first one, executes and returns the ID to a message type defined by you for internal use only between both stored procedure executions. The second ones uses that message type as source message and the XML required by the JDBC for the second stored procedure execution as target message type. This can be done without BPM.
    Regards,
    Matias.

  • DML visibility in stored procedures called via JDBC

    Hello,
    I have two stored procedures, A and B. Proc A inserts Q into table X. Proc B selects Q from table X to insert it into table Y. Neither procedure does a COMMIT.
    My Java class executes Proc A and then Proc B within a transaction (autocommit is false). But Proc B fails to select Q from table X with the No Data Found error, apparently unable to see the recently inserted Q.
    If these two procedures are called from a SQL*Plus block, everything succeeds.
    Does anyone have a clue about what I am missing? All my DML should be visible to my session.
    Thank you in advance for any suggestions.
    - CJ

    Thank you, Joe, for your reply!
    To the best of my knowledge, all of my stored procedure calls are being made from the same connection so I can rollback everything if necessary. I have not explicitly closed the connection between calls. The debugger indicates my connection session id never changes across calls.
    Do you know of any JDBC trace tools that might help me verify my connections? I've enabled logging with oracle.jdbc.driver.OracleLog.setTrace(true) but it doesn't really give me specific connection information - at least not that I can tell. :)
    Thanks!
    Cori

  • How to Migrate Stored procedure on Sql server 2008 to Oracle Database

    Guys, I need help vey badly as I am new in this field.
    Problem is that, I have to migrate stored procedure on Sql server 2008 to oracle Oracle database:
    Whole scenario--
    1. Sql Server 2008 application on Windows server (source machine)
    2. I have to migrate 70 Stored Procedure
    3. To Oracle Database on Linux machine (Target machine)
    Any method (no problem)
    Please, help me or give me any reference as I don't know which keyword is differ in both database.
    Thanks in advance

    Hi,
      You could the free Oracle SQL*Developer to do this.
    There is information and a download link here -
    Oracle SQL Developer</title><meta name="Title" content="Oracle SQL Developer"><meta n…
    and information on using it for migrations here -
    http://www.oracle.com/technetwork/database/migration/index-084442.html
    You could use it in 2 ways -
    1. Go through a migration but just pull the stored procedure code from the file created after you generate the SQL from the SQL*Server database
    2. Use the scratch editor accessed from -
    - Tools - Migration - Scratch Editor
    and paste the SQL*Server stored procedure code into the window and it will convert it to Oracle code. The tool is very good but may have problems if you have very complicated procedures that use SQL*Server specific utilities.
    Regards,
    Mike

  • Stored Procedure Call from Bean Error - PLS-00201

              Hello all,
              I am using the java stored procedure code in the examples dir of weblogic51/examples/jdbc/...
              with one exception. I created the stored procedure as another user with more
              permissions than
              the user that the jdbc connection will be established with. I created a public
              synonym so the stored
              procedure doesn't have to be refered to as "username.proc_squareInt". I keep
              getting the following
              errors. The web user has execute permissions and I tried calling it both with
              the owner.proc_name
              and proc_name (which I know won't work since it won't be able to find it).
              Any help would be greatly appreciated.
              Sincerely,
              Michael Prinsen
              Tue Jul 17 13:47:41 MDT 2001:<E> <WebAppServletContext-et> Root cause of ServletException
              java.sql.SQLException: ORA-06550: line 1, column 7:
              PLS-00201: identifier 'WTHDBM.PROC_SQUAREINT' must be declared
              ORA-06550: line 1, column 7:
              PL/SQL: Statement ignored
                   at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:114)
                   at oracle.jdbc.ttc7.TTIoer.processError(TTIoer.java:208)
                   at oracle.jdbc.ttc7.Oall7.receive(Oall7.java:542)
                   at oracle.jdbc.ttc7.TTC7Protocol.doOall7(TTC7Protocol.java:1330)
                   at oracle.jdbc.ttc7.TTC7Protocol.parseExecuteFetch(TTC7Protocol.java:757)
                   at oracle.jdbc.driver.OracleStatement.executeNonQuery(OracleStatement.java:1313)
                   at oracle.jdbc.driver.OracleStatement.doExecuteOther(OracleStatement.java:1232)
                   at oracle.jdbc.driver.OracleStatement.doExecuteWithBatch(OracleStatement.java:1353)
                   at oracle.jdbc.driver.OracleStatement.doExecute(OracleStatement.java:1760)
                   at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1807)
                   at oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePreparedStatement.java:332)
                   at oracle.jdbc.driver.OraclePreparedStatement.execute(OraclePreparedStatement.java:376)
                   at weblogic.jdbc.pool.PreparedStatement.execute(PreparedStatement.java:35)
                   at csu.et.testBean.getWeatherData1(testBean.java:46)
                   at jsp_servlet._test._tester._jspService(_tester.java:107)
                   at weblogic.servlet.jsp.JspBase.service(JspBase.java:27)
                   at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:120)
                   at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:138)
                   at weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletContextImpl.java:915)
                   at weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletContextImpl.java:879)
                   at weblogic.servlet.internal.ServletContextManager.invokeServlet(ServletContextManager.java:269)
                   at weblogic.socket.MuxableSocketHTTP.invokeServlet(MuxableSocketHTTP.java:365)
                   at weblogic.socket.MuxableSocketHTTP.execute(MuxableSocketHTTP.java:253)
                   at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:129)
              // START CODE
              package csu.et;
              import java.io.*;
              import java.sql.*;
              import java.util.*;
              import java.text.*;
              import java.beans.*;
              import java.math.*;
              import java.util.Date;
              import java.util.Locale;
              import csu.util.*;
              public class testBean {
              public String getWeatherData1() throws SQLException {
              Connection conn = null;
              conn = CSUConnection.getConnection("etSelectConnectionPool");
              // Create a stored proc - (CREATED ALREADY)
              // Statement stmt1 = conn.createStatement();
              // stmt1.execute("CREATE OR REPLACE PROCEDURE proc_squareInt " +
              // "(field1 IN OUT INTEGER, " +
              // " field2 OUT INTEGER) IS " +
              // "BEGIN field2 := field1 * field1; " +
              // "field1 := field1 * field1; END proc_squareInt;");
              // stmt1.close();
              String sql = "{call proc_squareInt(?, ?)}";
              CallableStatement cstmt1 = conn.prepareCall(sql);
              cstmt1.registerOutParameter(2, java.sql.Types.INTEGER);
              for (int i = 0; i < 5; i++) {
              cstmt1.setInt(1, i);
              cstmt1.execute();
              System.out.println(i + " " + cstmt1.getInt(1) + " " + cstmt1.getInt(2));
              cstmt1.close();
              conn.close();
              return("hard-coded stuff");
              //END CODE
              

    this is probably an oracle related issue, and has very little to do with
              Weblogic transactions.
              your easiest way to debug this is to open a SQL/Plus window, log in as user
              WTHDBM and try to run the command
              "execute proc_squareInt(5,5);"
              "execute owner.proc_squareInt(5,5);"
              if this doesn't work, consult Oracle technet on how to setup synonyms and
              permissions
              Filip
              ~
              Namaste - I bow to the divine in you
              ~
              Filip Hanik
              Software Architect
              [email protected]
              www.filip.net
              "Michael Prinsen" <[email protected]> wrote in message
              news:[email protected]...
              >
              > Hello all,
              >
              > I am using the java stored procedure code in the examples dir of
              weblogic51/examples/jdbc/...
              > with one exception. I created the stored procedure as another user with
              more
              > permissions than
              > the user that the jdbc connection will be established with. I created a
              public
              > synonym so the stored
              > procedure doesn't have to be refered to as "username.proc_squareInt". I
              keep
              > getting the following
              > errors. The web user has execute permissions and I tried calling it both
              with
              > the owner.proc_name
              > and proc_name (which I know won't work since it won't be able to find it).
              >
              > Any help would be greatly appreciated.
              >
              > Sincerely,
              >
              > Michael Prinsen
              >
              > Tue Jul 17 13:47:41 MDT 2001:<E> <WebAppServletContext-et> Root cause of
              ServletException
              > java.sql.SQLException: ORA-06550: line 1, column 7:
              > PLS-00201: identifier 'WTHDBM.PROC_SQUAREINT' must be declared
              > ORA-06550: line 1, column 7:
              > PL/SQL: Statement ignored
              >
              > at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:114)
              > at oracle.jdbc.ttc7.TTIoer.processError(TTIoer.java:208)
              > at oracle.jdbc.ttc7.Oall7.receive(Oall7.java:542)
              > at oracle.jdbc.ttc7.TTC7Protocol.doOall7(TTC7Protocol.java:1330)
              > at oracle.jdbc.ttc7.TTC7Protocol.parseExecuteFetch(TTC7Protocol.java:757)
              > at
              oracle.jdbc.driver.OracleStatement.executeNonQuery(OracleStatement.java:1313
              > at
              oracle.jdbc.driver.OracleStatement.doExecuteOther(OracleStatement.java:1232)
              > at
              oracle.jdbc.driver.OracleStatement.doExecuteWithBatch(OracleStatement.java:1
              353)
              > at oracle.jdbc.driver.OracleStatement.doExecute(OracleStatement.java:1760)
              > at
              oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java
              :1807)
              > at
              oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePreparedState
              ment.java:332)
              > at
              oracle.jdbc.driver.OraclePreparedStatement.execute(OraclePreparedStatement.j
              ava:376)
              > at weblogic.jdbc.pool.PreparedStatement.execute(PreparedStatement.java:35)
              > at csu.et.testBean.getWeatherData1(testBean.java:46)
              > at jsp_servlet._test._tester._jspService(_tester.java:107)
              > at weblogic.servlet.jsp.JspBase.service(JspBase.java:27)
              > at
              weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java
              :120)
              > at
              weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java
              :138)
              > at
              weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletContextImp
              l.java:915)
              > at
              weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletContextImp
              l.java:879)
              > at
              weblogic.servlet.internal.ServletContextManager.invokeServlet(ServletContext
              Manager.java:269)
              > at
              weblogic.socket.MuxableSocketHTTP.invokeServlet(MuxableSocketHTTP.java:365)
              > at weblogic.socket.MuxableSocketHTTP.execute(MuxableSocketHTTP.java:253)
              > at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:129)
              >
              >
              >
              > // START CODE
              >
              > package csu.et;
              >
              > import java.io.*;
              > import java.sql.*;
              > import java.util.*;
              > import java.text.*;
              > import java.beans.*;
              > import java.math.*;
              > import java.util.Date;
              > import java.util.Locale;
              > import csu.util.*;
              >
              > public class testBean {
              >
              > public String getWeatherData1() throws SQLException
              >
              > Connection conn = null;
              > conn = CSUConnection.getConnection("etSelectConnectionPool");
              >
              > // Create a stored proc - (CREATED ALREADY)
              > // Statement stmt1 = conn.createStatement();
              > // stmt1.execute("CREATE OR REPLACE PROCEDURE proc_squareInt " +
              > // "(field1 IN OUT INTEGER, " +
              > // " field2 OUT INTEGER) IS " +
              > // "BEGIN field2 := field1 * field1; " +
              > // "field1 := field1 * field1; END proc_squareInt;");
              > // stmt1.close();
              >
              > String sql = "{call proc_squareInt(?, ?)}";
              > CallableStatement cstmt1 = conn.prepareCall(sql);
              >
              > cstmt1.registerOutParameter(2, java.sql.Types.INTEGER);
              > for (int i = 0; i < 5; i++) {
              > cstmt1.setInt(1, i);
              > cstmt1.execute();
              > System.out.println(i + " " + cstmt1.getInt(1) + " " +
              cstmt1.getInt(2));
              > }
              >
              > cstmt1.close();
              > conn.close();
              > return("hard-coded stuff");
              > }
              >
              > }
              >
              > file://END CODE
              

  • 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

  • Stored Procedure calling from EJB

    Can i call a stored procedure from a EJB. First time attempt.
    IF some details available will help me a lot

    You may just use JDBC to call a stored procedure from a BMP
    bean. Below is a section from the "Oracle JDBC Developer's Guide
    and Reference":
    As an example of using Oracle syntax, here is a PL/SQL code
    snippet that creates a stored function. The PL/SQL function gets
    a character sequence and concatenates a suffix to it:
    create or replace function foo (val1 char)
    return char as
    begin
    return val1 || 'suffix';
    end;
    Your invocation call in your JDBC program should look like:
    Connection conn = DriverManager.getConnection
    ("jdbc:oracle:oci8:@<hoststring>", "scott", "tiger");
    CallableStatement cs = conn.prepareCall ("begin ? := foo(?);
    end;");
    cs.registerOutParameter(1,Types.CHAR);
    cs.setString(2, "aa");
    cs.executeUpdate();
    String result = cs.getString(1);

  • Who know how to handle pl/sql table return from stored procedure calling from jsp

    I have some stored procedure which return pl/sql table (index by table), It is look like an array. how jdbc handle this?
    CallableStatement cs = con.prepareCall("EXECUTE bill.getcountry(?,?)");
    cs.setInt(1, cid);
    cs.registerOutParameter(2, java.sql.Types.VARCHAR);// ARRAY?
    ResultSet rs = cs.executeQuery();
    Array array = (Array) rs.getObject (1);
    ResultSet array_rset = array.getResultSet ();

    Not that familiar with the OCI (Oracle Call Interface), but I think this call will be problematic - the OCI deals with SQL data types and not with PL/SQL structures.
    The OCI has since Oracle 8i sported an object call interface (see OCI Runtime Environment for Objects for details).
    This allows you to use the CREATE TYPE command to create advance user data types - and these are supported by the SQL engine, PL/SQL engine and external languages via the OCI.
    So you need to have a look at the Perl-DBI documentation to see how it supports Oracle object types and consider using these. As for internal PL/SQL data structures. These are not supported by the SQL engine and I would expect limited or no support in the OCI for these. Anyway, using SQL data types makes a lot more sense ito flexibility and transparency across languages and environments.

  • Stored procedure by a JDBC sender

    Hi,
    My scenario involves accessing an SQL server to XI to APO.
    I need to invoke a stored procedure residing on SQL server in order to get the data into XI.
    Can somebody suggest how i acheive this.
    It has to be done every month...so is there a way i can schedule the JDBC sender adapter
    Thanks,
    Vineet

    Hi Vineet,
    Yes, of course you can invoke Stored Procedures on SQL server using XI. The link you are looking for is this:
    http://help.sap.com/saphelp_nw2004s/helpdata/en/22/b4d13b633f7748b4d34f3191529946/frameset.htm
    The only limitation is that you can have only one SELECT statement in the Stored Procedure.
    Regards,
    Puloma.

  • Stored Procedure Call from XMII

    Hi, I am facing the following problem.
    My SQL Stored Procedure has one input parameter,and it returns three values.
    I want to know the syntax for calling this stored procedure ie. syntax in  fixed query in XMII.
    Thanks.

    Hi Adam,
    I assume that you are using MSSQL server stored procedure which outputs 3 values.
    Say that you are inputting 1 integer @inval and returning 3 integer values @outval1, @outval2, @outval3 from Stored Procedure
    Then perform the following in Query Template
    DECLARE @val1 INT
    DECLARE @val2 INT
    DECLARE @val3 INT
    EXEC StoredProcedureName
        @inval = 10,
        @outval1 = @val1 OUTPUT,
        @outval2 = @val2 OUTPUT,
        @outval3 = @val3 OUTPUT
    SELECT @val1,@val2,@val3
    Use FixedQuery mode
    Regards,
    Adarsh
    Edited by: Adarsh Sidnoor on Aug 27, 2009 7:46 PM
    Edited by: Adarsh Sidnoor on Aug 27, 2009 7:47 PM

  • Stored procedure by using jdbc sender adapter.

    Hi All
    I need to call the stored procedure and make it as sender how do design data type to make stored procedure as sender
    Thanks
    Jeongbok.

    Hi Jeong;
    The Data type structure will be like
    row
      field1
      field2
      field3
    the name of the fields will be same as defined in your stored procedure
    Mudit

  • EP 6.0 SP4 JDBC iview for Oracle Database

    Hi,
    I have created an Oracle system in Portal. Specified the user mapping as admin,user.
    Using this system created a JDBC iview. In the step of selecting query or existing function, i selected the query option to browse the tables. But its not displaying any tables. It just keep on displaying "Loading...".
    But when i select Existing function,in the next step i am getting the list of functions.
    can anyone help me in getting the list of tables from database in the iview?
    Thanks,
    Mital

    Dear Aviad,
    Thnx a lot for your guidance, Incidentally we found the problem. For some reason the Portal was not able to resolve the ip address 132.12.33.30, but was able to resolve the host name "newspd".
    This is the final url we created :
    jdbc:sap:oracle://newspd:1521;SID=SALES
    I'm able to create the iviews with the JDBC connection now, but the look is not so great, as there are a couple of problems :
    1. The iview's table output has the raw column names showing as column titles. Atleast in SP2 there is no way to create a alternate column name. Ex: the table row name is say "amt_1", the column name in the iview also shows as "AMT_1". Is there a alternative for this problem ??
    2. For passing parameters, the iview allows for only static parameters, but is there a way I can create a dynamic parameter allocation. Ex: In the query parameters I have a employee number as a included column, but I wish to show only his records to him, but in the portal environment, we havent a way to find the logged on employee ? Is there a way we can do that ??
    Hope you'll be able to help.
    Regards,
    Neeraj S

  • Too many arguments for stored procedure call

    I have a stored procedure with 34 arguments, including the return value. I am trying to call it from java using JDBC thin drivers (jdk11, oracle815), but I get the "wrong number or types of arguments" error message. JDBC-OCI fails also. I saw a reference in this discussion group to there being a limit of 32 arguments for stored procedure calls from jdbc (posted 6/29/99). Is there such a limit? If so, is there a fix or workaround? If there is not a limit, how can I determine which argument is causing the problem?
    Many thanks.
    Mike
    java.sql.SQLException: ORA-06550: line 1, column 13:
    PLS-00306: wrong number or types of arguments in call to 'PUT_CHECK'
    ORA-06550: line 1, column 7:
    PL/SQL: Statement ignored
    at oracle.jdbc.ttc7.TTIoer.processError(TTIoer.java)
    at oracle.jdbc.ttc7.Oall7.receive(Oall7.java)
    at oracle.jdbc.ttc7.TTC7Protocol.doOall7(TTC7Protocol.java)
    at oracle.jdbc.ttc7.TTC7Protocol.parseExecuteFetch(TTC7Protocol.java)
    at oracle.jdbc.driver.OracleStatement.doExecuteOther(OracleStatement.jav
    a)
    at oracle.jdbc.driver.OracleStatement.doExecuteWithBatch(OracleStatement
    .java)
    at oracle.jdbc.driver.OracleStatement.doExecute(OracleStatement.java)
    at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStateme
    nt.java)
    at oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePrepar
    edStatement.java)
    at oracle.jdbc.driver.OraclePreparedStatement.execute(OraclePreparedStat
    ement.java)
    at metris.quickcheck.database.DS1.main(DS1.java:79)
    null

    I must confess I still don't understand your problem. By rows ...
    I have an sql that recodes a column and has 1450 rows. This doesn't work
    although when I use the same with less rows 40-60 it works.... do you mean rows in the table or elements in the CASE() statement ?
    From the 9i SQL Reference:
    " The maximum number of arguments in a CASE expression is 255, and each WHEN ... THEN pair counts as two arguments. To avoid exceeding the limit of 128 choices, you can nest CASE expressions. That is return_expr can itself be a CASE expression."
    According to the 10g docs the limit is the same there.
    Cheers, APC

  • JDBC callableStatement stored procedure call cancellation?

    up vote0down votefavorite
    I have a very complex oracle stored procedure that searches and retrieves some data. The procedure returns an output parameter - an oracle cursor. I execute the procedure by JDBC:
    CallableStatement stmt = conn.prepareCall("{call myprocedure(?,?,?,?}");
    The problem is, the queries can sometimes take quite long (few minutes) and i would like user to be able to cancel the query anytime by clicking button. I have reference to stmt object, but unfortunatelly calling stmt.cancel() (from other thread) has NO EFFECT.
    On the other hand when i change the CallableStatement sql to some query like:
    CallableStatement stmt = conn.prepareCall("select * from all_objects");
    i get "java.sql.SQLTimeoutException: ORA-01013: user requested cancel of current operation" after calling stmt.cancel() - so thats the right reaction.
    Does that mean than i cannot cancel stored procedure call via jdbc, but only simple select statements? Does anyone else had and resolved similar problem?
    I guess i could cancel the query by oracle kill session, but i use connection pooling (jboss) and i have plenty of sessions for the same user existing.
    Database Product Version is Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production JDBC Driver Version is 11.2.0.4.0
    any help will be appreciated.

    This property didnt help, still no reaction after statement.cancel().
    I could not cancel the statment from the db size , so i decided to spawn new java thread and run the statement in that thread, and when user clicks cancel button i just cancel the thread, some snipper of code below:
                   AtomicBoolean userCanceled - this must be AtomicBoolean or  volatile variable, so other threads would see the change of variable after clicking button
                   try{
                    MyCallableQuery callable = new MyCallableQuery(rs,stmt,this,rsh,outParameter);
                    FutureTask<T> queryTask = new FutureTask<T>(callable);
                    ExecutorService executor = Executors.newFixedThreadPool(1);
                    executor.execute(queryTask);                 
                    while  (!queryTask.isDone()){         //stil processing statement            
                     Thread.sleep(100);
                          if (userCanceled)){               //user decided to cancel
                           futureTask1.cancel(true);
                           executor.shutdown();
                           throw new SQLException("User decided to cancel procedure call");
                     result = futureTask1.get(); 
                     //here the code after the resultset has been processed without cancelation
                   catch (SQLException e}{
                   //here the code when user decided to cancel  like clearing the datatable
    and my callable class is like:
    public class MyCallable<T> extends ProcRunner implements Callable<T> {
        private ResultSet rs;
        private CallableStatement stmt;
        private ProcRunner procRunner;
        private ResultSetHandler<T> rsh;
        private Integer outParameter;
        public MyCallable(ResultSet rs,CallableStatement stmt,ProcRunner procRunner,ResultSetHandler<T> rsh,Integer outParameter){
            this.rs = rs;
            this.stmt = stmt;
            this.procRunner = procRunner;
            this.rsh = rsh;
            this.outParameter = outParameter;
        @Override
        public T call() throws Exception {
           T result = null;     
          stmt.executeUpdate();
           rs = (ResultSet) stmt.getObject(outParameter);
           rs = this.wrap(rs);
           result = rsh.handle(rs);  
        return result;

Maybe you are looking for

  • Contracts tolerances are not transfering to SRM SC PO

    Hi SRM Expects , contract tolerances not transfering to SRM SC PO . We have created a SC based on the contract with  Product category and Supplier , when SC is orderd and PO is created , i can see Contract number in item tab , but  tolerances are not

  • My mails are disappearing

    My mails disappear from my iphone after a few days. Sometimes I don´t even had time to read them. They also go missing from my computer. Does anyone know if there is a mailsetting which does this? Can I fix it myself?

  • 1z0-045 - 10g upgrade exam for oracle 8i Ocps

    Hi Guys, Can any body tell me about 1z0-045 exam books or material. Thanks in advance. Ram

  • Drag & drop; image degradation; preview for web screen

    Hi. I'm a photographer and was wondering how to enforce a no drag and drop option for each of my images on my page. I'm also having problems with dragging an image from the desktop to my template and the image not transfering over well, i.e. it looks

  • EVB and Date/Time

    I'm trying to add a new record to an oracle lite database on my pocket pc. I'm getting an error assigned a date to the value of the date field in my table. lrs_rs.Fields("TEMP_DATE").Value = CDate(tempDate) Can anyone find anything wrong with this, o