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
          

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.

  • 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

  • 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);

  • 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

  • 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.

  • 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

  • Capture error messages from stored procedure calls

    Hi there,
    How do I capture a stored procedure calls error messages provided the stored procedures does not have output parameters? This questions applies to Oracle 7.3.4 stored procedures calls.
    TQ
    Neo

    There are two parts.
    The stored proc must 'throw' an exception.
    And java must catch it.
    You probably already have the java part. That is the catch(SQLException).
    As for the stored proc you can use the following search string in the jdbc forum
    raise oracle
    You need to use 'raise' in the stored proc but I am not sure of the exact form, but one of the threads using the above search string is likely to have it.

  • WCF OData Service stored procedure call generates "Operation could destabilize the runtime" error with $select option

    I've been trying to call a stored procedure through Entity Framework and WCF Data Services (OData). It returns an entity not a complex type. Following walkthroughs found all over the web, I came up with this code inside my service:
    [WebGet]
    public IQueryable<Entity> GetEntitiesByParameterId(int parameterId)
    return CurrentDataSource.GetEntitiesByParameterId(parameterId).AsQueryable();
    Calling the proc this way: ~WcfService.svc/GetEntitiesByParameterId?parameterId=1 executes
    the stored procedure and returns entities that should be returned. No problem there.
    Everything works well until I try to use $select OData option ie. ~WcfService.svc/GetEntitiesByParameterId?parameterId=1&$select=name.
    Upon debugging, the method above runs without any error but it returns an Operation could destabilize the runtime error upon reaching the
    client. After so much research, apparently it is a very general error pointing to a lot of different causes. I haven't found one that really matches my particular problem. Closest are 
    http://stackoverflow.com/questions/378895/operation-could-destabilize-the-runtime
    https://social.msdn.microsoft.com/Forums/en-US/d2fb4767-dc09-4879-a62a-5b2ce96c4465/for-some-columns-entity-properties-executestorequery-failed-with-error-operation-could?forum=adodotnetdataservices 
    but none of the solutions worked on my end.
    Also, from the second article above:
    This is a known limitation of WCF DS. ...
    Second is that some of the queries won't work correctly because LINQ to EF needs little different LINQ expressions than LINQ to Objects in some cases. Which is the problem you're seeing.
    It has been posted on 2012. If it its true, are there still no updates on this? And is there any other workaround to get the $select working on the stored proc call?
    What works:
    ~WcfService.svc/GetEntitiesByParameterId?parameterId=1
    ~WcfService.svc/GetEntitiesByParameterId?parameterId=1&$top=1
    ~WcfService.svc/GetEntitiesByParameterId?parameterId=1&$skip-5
    ~WcfService.svc/GetEntitiesByParameterId?parameterId=1&$filter={filter query}
    ~WcfService.svc/GetEntitiesByParameterId?parameterId=1&$expand=SomeNavigationProperty
    What doesn't work:
    ~WcfService.svc/GetEntitiesByParameterId?parameterId=1&$select=name
    Tech details:
    EntityFramework 5, WCF Data Service 5.0, OData V3
    *I've also tried upgrading to EF6 and WCF 5.6.2 and it still didn't work.
    Any help would be appreciated. Thanks!

    Someone from SO replied to my question there and said that $select is still not supported though I couldn't find any definitive documentation about it.
    From what I gather and observed, $select breaks the stored procedure call because it tries to alter the data shape already gotten from the database and attempts to return a dynamic entity instead. Something about the stored proc returning an ObjectResult might
    be messing it up. As I have said, these are merely my observations.
    Workaround: I found a simple and elegant workaround for it though. Since my stored procedures are only getting data from the database and does
    not alter data in any way (INSERT, UPDATE, DELETE), I tried using table-valued functions that returns a table equivalent to the entity on my EF. I've found that calling this function on the Service Operation method returns an IQueryable<Entity> which
    is basically what is needed. $select also works now and so does other OData query options.
    Steps:
    Create a function on the database
    Update EDMX -> Add function
    Add new Function Import with Entity return type
    Create service operation in WCF Data Service that calls CurrentDataSource.<FunctionName>()
    Test in fiddler.
    CODES
    Database Function:
    CREATE FUNCTION GetEntities(@parameter)
    RETURN @entites TABLE(
    [Id] [int],
    [Name] [nvarchar](100),
    AS
    BEGIN
    INSERT INTO @entities
    SELECT [Id], [Name], ... FROM [EntityTable]
    RETURN
    END
    WCF:
    [WebGet]
    public IQueryable<Entity> GetEntity(int parameter)
    return CurrentDataSource.GetEntity(parameter);
    It doesn't really solve the stored procedure problem but I'm marking this as answer until someone can provide a better one as it does solve what I'm trying to do.
    Hope this helps others too. :)

  • Unexpected error msg returned by stored procedure (called by 'C' program)

    My 'C' code is calling an Oracle stored procedure that can either return a record or not ~ depending on if rows already exist having the existing coordinates. In this case, there are not any existing records so I would expect the stored procedure to return an error code of 100 ~ for "no rows found". Instead, it is returning ORA-21000: error number argument to raise_application_error of 100". Do I need to change my 'C' code to look for a return code of -21000 to represent "no rows found" from my stored procedure, or is error code 100 still what I should be checking for and I am encountering a different problem ?
    Vicki

    So, are you trying to copy the error codes over from Sybase as well (i.e. an error code of 100 in your Sybase application translates to "no data found")?
    RAISE_APPLICATION_ERROR allows you to raise custom errors, but the error numbers have to be in the range -20000 to -20999 (i.e. ORA-20000 through ORA-20999). You can use RAISE to re-raise Oracle's NO_DATA_FOUND message, though that won't match the error number 100 you're expecting. It would also be pointless to have an exception handler that just raises the same error again, so you'd want to remove the error handler entirely if it would just RAISE again.
    Justin

  • 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.

  • Failed to execute SP with error PLS-00201

    I've stored procedure called CAL_TAX which create by schema EMP_DBA, right now I want to grant execute right on this SP to user USER1. I've execute below statement:
    CREATE USER USER1 IDENTIFIED BY USER1234;
    GRANT CONNECT TO USER1;
    GRANT RESOURCE TO USER1;
    GRANT CREATE SESSION TO USER1;
    GRANT EXECUTE ON EMP_DBA.CAL_TAX TO USER1;
    DECLARE
    CURSOR C1 IS SELECT TABLE_NAME FROM USER_TABLES;
    CMD VARCHAR2(200);
    BEGIN
    FOR C IN C1 LOOP
    CMD:='GRANT SELECT ON ' || C.TABLE_NAME || ' TO USER1';
    EXECUTE IMMEDIATE CMD;
    END LOOP;
    END;
    When I connect as USER1 and execute SP CAL_TAX, I received below error messages. Can anyone help me on this ? I've no problem to execute SP if connect as EMP_DBA
    BEGIN CAL_TAX; END;
    ERROR AT LINE 1:
    ORA-06550: LINE 1, COLUMN 7:
    PLS-00201: IDENTIFIER 'CAL_TAX' MUST BE DECLARED
    ORA-06550:LINE 1, COLUMN 7:
    PL/SQL: STATEMENT IGNORED
    This is the part of the SP CAL_TAX, could it AUTHID CURRENT_USER caused this problem ?
    CREATE OR REPLACE PROCEDURE CAL_TAX
    AUTHID CURRENT_USER
    IS

    When I connect as USER1 and execute SP CAL_TAX, I received below error messages. Can anyone help me on this ? I've no problem to execute SP if connect as EMP_DBA
    BEGIN CAL_TAX; END;
    You are connected as USER1 trying to execute a procedure named CAL_TAX.
    But USER1 does not own any object named CAL_TAX so you  get the exception.
    User EMP_DBA owns object CAL_TAX so USER1 has to provide the schema prefix to reference that object
    BEGIN
       EMP_DBA.CAL_TAX;
    END;
    If you create a public synonym then USER1 can use the synonym to reference the object.

  • 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

  • Structure for Stored Procedure Call

    Hi All,
             Guys I am trying to call a stored procedure call using receiver jdbc adapter...
    This is the outgoing message:
    <b><?xml version="1.0" encoding="UTF-8" ?>
    - <ns0:SP_DB xmlns:ns0="urn:sce-com:xi:dev:mohammf">
    - <Test>
    - <PP_TEST_P action="EXECUTE">
      <table>PP_TEST_P</table>
      <RECTYPEIND type="CHAR">CC</RECTYPEIND>
      <JENUMBER type="CHAR">76724</JENUMBER>
      <COMPANY type="CHAR">BCEO</COMPANY>
      <CONSTANT1 type="CHAR">AB</CONSTANT1>
      <SYSTEMDATE type="CHAR">08/12/2007</SYSTEMDATE>
      <DR_CR_ID type="CHAR">0</DR_CR_ID>
      <AMOUNT type="CHAR">934928599475843</AMOUNT>
      <MONTH_NUMBER type="CHAR">000008</MONTH_NUMBER>
      <COST_CENTER type="CHAR">LosAngeles</COST_CENTER>
      <ORDERNO type="CHAR">694950375830</ORDERNO>
      <WBS type="CHAR">Southern California Edis</WBS>
      <ACCOUNTID type="CHAR">6949503758</ACCOUNTID>
      <BATCH_ID type="CHAR">3408102007</BATCH_ID>
      <ASSIGNMENT type="CHAR">Technology Solutio</ASSIGNMENT>
      <GL_JOURNAL_CATEGORY type="CHAR">GHTF</GL_JOURNAL_CATEGORY>
      <PROFIT_CENTER type="CHAR">3434694950</PROFIT_CENTER>
      <REFDOCNUMBER type="CHAR">00000000004304300056006056</REFDOCNUMBER>
      </PP_TEST_P>
    - <PP_TEST_P action="EXECUTE">
      <table>PP_TEST_P</table>
      <RECTYPEIND type="CHAR">XX</RECTYPEIND>
      <JENUMBER type="CHAR">76724</JENUMBER>
      <COMPANY type="CHAR">BCEO</COMPANY>
      <CONSTANT1 type="CHAR">AB</CONSTANT1>
      <SYSTEMDATE type="CHAR">08/12/2007</SYSTEMDATE>
      <DR_CR_ID type="CHAR">0</DR_CR_ID>
      <AMOUNT type="CHAR">934928599475843</AMOUNT>
      <MONTH_NUMBER type="CHAR">000008</MONTH_NUMBER>
      <COST_CENTER type="CHAR">LosAngeles</COST_CENTER>
      <ORDERNO type="CHAR">694950375830</ORDERNO>
      <WBS type="CHAR">Southern California Edis</WBS>
      <ACCOUNTID type="CHAR">6949503758</ACCOUNTID>
      <BATCH_ID type="CHAR">3408102007</BATCH_ID>
      <ASSIGNMENT type="CHAR">Technology Solutio</ASSIGNMENT>
      <GL_JOURNAL_CATEGORY type="CHAR">GHTF</GL_JOURNAL_CATEGORY>
      <PROFIT_CENTER type="CHAR">3434694950</PROFIT_CENTER>
      <REFDOCNUMBER type="CHAR">00000000004304300056006056</REFDOCNUMBER>
      </PP_TEST_P>
      </Test>
      </ns0:SP_DB></b>
    The error I am getting is: 
    <b><i>2007-08-20 09:44:05 Error Unable to execute statement for table or stored procedure. 'PP_TEST_P' (Structure 'Test') due to java.sql.SQLException: ERROR: Invalid XML document format for stored procedure: 'type="<SQL-type>"' attribute is missing for element 'table' (Setting a SQL-type (e.g. INTEGER, CHAR, DATE etc.) is mandatory !)
    2007-08-20 09:44:05 Error JDBC message processing failed; reason Error processing request in sax parser: Error when executing statement for table/stored proc. 'PP_TEST_P' (structure 'Test'): java.sql.SQLException: ERROR: Invalid XML document format for stored procedure: 'type="<SQL-type>"' attribute is missing for element 'table' (Setting a SQL-type (e.g. INTEGER, CHAR, DATE etc.) is mandatory !)
    2007-08-20 09:44:05 Error MP: Exception caught with cause com.sap.aii.af.ra.ms.api.RecoverableException: Error processing request in sax parser: Error when executing statement for table/stored proc. 'PP_TEST_P' (structure 'Test'): java.sql.SQLException: ERROR: Invalid XML document format for stored procedure: 'type="<SQL-type>"' attribute is missing for element 'table' (Setting a SQL-type (e.g. INTEGER, CHAR, DATE etc.) is mandatory !)
    2007-08-20 09:44:05 Error Exception caught by adapter framework: null
    2007-08-20 09:44:05 Error Delivery of the message to the application using connection JDBC_http://sap.com/xi/XI/System failed, due to: com.sap.aii.af.ra.ms.api.RecoverableException: Error processing request in sax parser: Error when executing statement for table/stored proc. 'PP_TEST_P' (structure 'Test'): java.sql.SQLException: ERROR: Invalid XML document format for stored procedure: 'type="<SQL-type>"' attribute is missing for element 'table' (Setting a SQL-type (e.g. INTEGER, CHAR, DATE etc.) is mandatory !).</i></b>
    Pls advice..
    XIer
    Message was edited by:
            XIer

    Hi,
    Check your DATA TYPE attributes with the attributes of the column names in the Database table.  There is a mismatch between the DT and Table in the database.
    <b>Cheers,
    *RAJ*</b>

Maybe you are looking for

  • Downloaded song on ipad but can't find it on itunes on desktop

    DOwnloaded a song on my ipad and went to my desktop to put song on my ipod but can not locate it.

  • When I used to receive emails it would make a beep now it doesn't make any noise

    it will not even make the *whoosh* sound anymore. My volume is up I checked the mail settings and the sound were all on, then I checked the system prefreces in the sounds menu and that appeared to be fine Any suggestions?

  • Error in info type 0001

    Hi all when hired an employee, while saving 0001 info type inpa40 system shows one error " Define a fiscal year variant first for company code 9369" anyone solve prob thanks and regards Seenu

  • Why cant I use relative paths in Netbeans

    Why cant I use relative paths in Netbeans to files on my PC. I want to be able to copy my project folder between different drives and pcs dont want to edit the code everytime I do. BTW I didnt know where on the forum to post this. Just in case this i

  • Gift card money lost!

    I had just redeemed some gift cards and as I was downloading more songs, my iTunes crashed. So I started it up again and said I had only $38.00, the amount I had before the gift cards equaling $80. I tried to re-enter the codes, but they were already