Exception handling in a stored procedure

Hello,
I have a stored procedure with one IN parameter that  insert values in a table as a treatment ,and i have to define an exception that raise when the same row is inserted several times (the row should be inserted one time).
do you have any idea of what is the request that should i write to do that (verify the existence of a row)??
PS : I'm just a beginner in PL/SQL
Regards,
AC

ok i have the following stored procedure calculer(p_duration_modifiee IN NUMBER ) that fill the table entrepot with data after a specific treatment in function of the stored procedure parameter of course.
the problem is the call of calculer(0.64) should be one time,because if we call it again with 0.64 the table entrepot will have two same raws which is not good for my application.
The question is how should raise the exception in order to have the following error message for example (row already exists,please enter a new parameter)
i wish it is more clear

Similar Messages

  • Exception handling in Custom Login procedure

    Hi,
    I have a custom login procedure. Now instead of handling the possible exceptions in a custom way too, I want to use the syntax of the exception handling API (probably the one in the PDK) the default login procedure uses. Can someone point me to the values the default login procedure uses?
    Thanks, Tony

    Tony,
    The default login page (the source of which is now unwrapped in 3.0.0), uses the following snippet of code to report the errors:
    if p_error then
    wwerr_api_error_ui.show_inline_html;
    end if;The errors are stacked when the ls_login procedure is executed, and the next time the login page is called up, it just displays the stacked errors.

  • Exception in calling a stored procedure

    Hi ,
    i am calling a stored procedure using TopLink up on clicking a button from my jspx.
    i got an exception at this statement
    Result = (Integer)session.executeQuery(query,parameters);
    and the exception is:
    [TopLink Warning]: 2007.12.13 02:34:19.158--ClientSession(21746066)--Exception [TOPLINK-4002] (Oracle TopLink - 10g Release 3 (10.1.3.3.0) (Build 070608)): oracle.toplink.exceptions.DatabaseException
    Internal Exception: java.sql.SQLException: ORA-06550: line 1, column 134:
    PLS-00103: Encountered the symbol "[" when expecting one of the following:
    . ( ) , * @ % & = - + < / > at in is mod not rem
    <an exponent (**)> <> or != or ~= >= <= <> and or like
    between ||
    The symbol ". was inserted before "[" to continue.
    ORA-06550: line 1, column 172:
    PLS-00103: Encountered the symbol "]" when expecting one of the following:
    . ( ) , * @ % & - + / at mod rem <an exponent (**)> and or ||
    The symbol "]" was ignored.
    Error Code: 6550
    Call:BEGIN APPS.XXUL_DAP_PKG.maint_err_inact_codes(i_action=>'U', i_flex_value_set_name=>'XXUL_DAP_ERROR_CODES_VS', i_code=>CoreOutputText[UIXFacesBeanImpl, id=outTextErrorCode], i_description=>'National Deviations', i_prog_comb_code=>'103', i_err_help_text=>NULL, i_enabled_flag=>'Y', i_summary_flag=>'N', i_commit=>'Y', i_user=>35454, o_error_code=>?, o_error_message=>?, io_flex_value_id=>?); END;
         bind => [=> o_error_code, => o_error_message, 0 => io_flex_value_id]
    Query:DataModifyQuery()
    could someone suggest me a solution..
    Thanks in anticipation

    This looks like a sql syntax error.
    Can you show the SQL you are trying to execute via toplink?
    Is the stored procedure valid/compiled? Can you call it in SQLPlus or from the sql worksheet in jdeveloper?
    Jeroen van Veldhuizen

  • Transaction Handling via Multiple Stored Procedure Calls

    Hello,
    we have the requirement that we call severall stored procedures in a sequence. The problem now is to have one explicit transaction which is only commited in case all calls have been succesful. In case there is an error during one of the calls all already executed stored procedures should be rolled back.
    One idea would be to define transactional behavior in BPM within a block but I have some doubts whether this works as I have found the following warning in the SAP XI help section:
    "The transaction control mechanism for integration processes is not a central transaction manager for an entire system landscape. The transaction control mechanism cannot roll back any processing steps outside the Integration Server"
    Do you have any advice on this issue?
    Thanks a lot!

    The best solution would be to call the root SP from XI adaptor and handle the transaction commit logic in side this root SP. That way even BPM will not be in picture.
    BPM can not handle transaction roll back on external systems.
    VJ

  • Calling stored procedures using forms & ruleframe

    Does anybody know how I should call a stored procedure (which does some DML on tables) from forms when ruleframe is used? Should a transaction be opened before the procedure is called and closed afterwards? What should happen in the exception handler of the stored procedure, and how should exceptions be handled in the form?

    Mike,
    When calling code that performs DML, you must explicitly code the open and close transaction call. In that call, specify a program name that is specific to that piece of code. And you have to have an exception handler (see below).
    What will happen, is that the open transaction call checks if a transaction is already open. If it is, it does nothing, and also the close transaction call will then do nothing, as the transaction was opened by another program unit.
    If there is no open transaction yet, your call will open one, and then your close-call will also close it because it has the same program name. If at that moment errors are raised, you have to catch them with the standard Headstart exception handler (which you ought to have in all your Forms program units):
    when form_trigger_failure
    then
    raise;
    when others
    then
    qms$errors.unhandled_exception(<program unit>);
    This exception handler will recognize the ruleframe exception and show the messages.
    We have updated the CDM RuleFrame documentation for 6i to make this more clear, to avoid confusion in the future.
    Hope this helps,
    Sandra

  • Getting exception whil calling an oracle stored procedure from java program

    Dear All,
    I encounter this error in my application when I call only the stored procedure but the view is executing fine from the application and my environment is as follow:
    Java 1.4
    oracle 10g
    oracle jdbc driver:9.2.0.8.0
    websphere portal 6.0.0.1
    this error is occur from time to time randomly, when it happens, the only workaround is to restart the server..Does anyone have any idea about this error?
    Unable to execute stored Procedure in Method
    java.lang.NullPointerException
    at oracle.jdbc.driver.T4C8Oall.getNumRows(T4C8Oall.java(Compiled Code))
    at oracle.jdbc.driver.T4CCallableStatement.executeForRows(T4CCallableStatement.java:1140)
    at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java(Compiled Code))
    at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java(Compiled Code))
    at oracle.jdbc.driver.OraclePreparedStatement.execute(OraclePreparedStatement.java:3606)
    at oracle.jdbc.driver.OracleCallableStatement.execute(OracleCallableStatement.java:5267)
    at com.ibm.ws.rsadapter.jdbc.WSJdbcPreparedStatement.pmiExecute(WSJdbcPreparedStatement.java:632)
    at com.ibm.ws.rsadapter.jdbc.WSJdbcPreparedStatement.execute(WSJdbcPreparedStatement.java:427)
    And sometime I am getting this exception
    Unable to execute stored Procedure in Method
    java.lang.ArrayIndexOutOfBoundsException: 27787320
    at oracle.jdbc.driver.T4CCallableStatement.doOall8(T4CCallableStatement.java(Compiled Code))
    at oracle.jdbc.driver.T4CCallableStatement.executeForRows(T4CCallableStatement.java:1134)
    at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java(Compiled Code))
    at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java(Compiled Code))
    at oracle.jdbc.driver.OraclePreparedStatement.execute(OraclePreparedStatement.java:3606)
    at oracle.jdbc.driver.OracleCallableStatement.execute(OracleCallableStatement.java:5267)
    at com.ibm.ws.rsadapter.jdbc.WSJdbcPreparedStatement.pmiExecute(WSJdbcPreparedStatement.java:632)
    at com.ibm.ws.rsadapter.jdbc.WSJdbcPreparedStatement.execute(WSJdbcPreparedStatement.java:427)
    Thanks
    Jay

    spacetorrent escribi&oacute;:
    for (int x=0; x <result.size(); x++){
    System.out.println(result.get(x));
    I can't do this, because result object is a Map, and I need write the Key of the Value to obtain.
    So I can do:
    result.get("res");And I odtain a *$Proxy3* Object

  • Nested Stored procedure

    Hi experts,
    case :- A stored procedure calling 5 stored procedure in 3rd procedure a error handled in execption
    is the 3rd procedure resume next?
    the 4 & 5 procedure will execute or not?
    Many thanks
    Kalinga

    Hi experts,
    case :- A stored procedure calling 5 stored procedure
    in 3rd procedure a error handled in execption
    is the 3rd procedure resume next?
    the 4 & 5 procedure will execute or not?
    Many thanks
    KalingaSo you have 1 procedure that calls 5 others.
    In the 3rd procudure an exception happens, which you capture within that procedure and handle it.
    Assuming the 3rd procedure exception handler is at the top level for that procedure, it will cease execution and drop back out and then the 4th and 5th procedures will continue to be executed.
    If the exception handler in the 3rd procedure is in a nested execution block then the execution will continue from after that execution block in that 3rd procedure.
    If the 3rd procedure doesn't actually handle the exception but raises the error then the exception handler of the calling procedure will capture the exception (if there is an exception handler there) and the 4th and 5th procedures will not be called.
    The key thing to remember is that once an exception happens inside an execution block the execution point cannot return back within that same execution block automatically. It can only leave that execution block gracefully by handling the exception or it can raise the exception up a level to the calling execution block's exception handler.

  • SQLException while calling a Stored Procedure in Oracle

    Hi all,
    I am getting this error while calling a Stored Procedure in Oracle...
    java.sql.SQLException: ORA-00600: internal error code, arguments: [12259], [], [
    at oracle.jdbc.ttc7.TTIoer.processError(TTIoer.java:207)
    at oracle.jdbc.ttc7.Oall7.receive(Oall7.java:540)
    at oracle.jdbc.ttc7.TTC7Protocol.doOall7(TTC7Protocol.java:1273)
    at oracle.jdbc.ttc7.TTC7Protocol.fetch(TTC7Protocol.java:780)
    at oracle.jdbc.driver.OracleResultSet.next(OracleResultSet.java:135)
    at StoredProcedureDemo.main(StoredProcedureDemo.java:36)
    The Program is ...
    import java.sql.*;
    public class StoredProcedureDemo {
         public static void main(String[] args) throws Exception {
              Connection con = null;
              ResultSet rs = null;
              Statement st = null;
              CallableStatement cs = null;
              int i;
              try {
                   Class.forName("oracle.jdbc.driver.OracleDriver");
                   con = DriverManager.getConnection("jdbc:oracle:thin:@127.0.0.1:1521:SHYAM","scott","tiger");
                   System.out.println("Got Connection ");
                   st = con.createStatement();
                   String createProcedure = "create or replace PROCEDURE Get_emp_names (Dept_num IN NUMBER) IS"
                             +" Emp_name VARCHAR2(10);"
                             +" CURSOR c1 (Depno NUMBER) IS"
                             +" SELECT Ename FROM emp WHERE deptno = Depno;"
                             +" BEGIN"
                             +" OPEN c1(Dept_num);"
                             +" LOOP"
                             +" FETCH c1 INTO Emp_name;"
                             +" EXIT WHEN C1%NOTFOUND;"
                             +" END LOOP;"
                             +" CLOSE c1;"
                             +" END;";
                   System.out.println("Stored Procedure is \n"+createProcedure);
                   i = st.executeUpdate(createProcedure);
                   System.out.println("After creating the Stored Procedure "+i);
                   cs = con.prepareCall("{call Get_emp_names(?)}");
                   System.out.println("After calling the Stored Procedure ");
                   cs.setInt(1,20);
                   System.out.println("Before executing the Stored Procedure ");
                   rs = cs.executeQuery();
                   System.out.println("The Enames of the given Dept are ....");
                   while(rs.next()) {
                        System.out.println("In The while loop ");
                        System.out.println(rs.getString(1));
              catch (Exception e) {
                   e.printStackTrace();
    Stored Procedure is ...
    create or replace PROCEDURE Get_emp_names (Dept_num IN NUMBER) IS
    Emp_name VARCHAR2(10);
    CURSOR c1 (Depno NUMBER) IS
    SELECT Ename FROM emp WHERE deptno = Depno;
    BEGIN
    OPEN c1(Dept_num);
    LOOP
    FETCH c1 INTO Emp_name;
    EXIT WHEN C1%NOTFOUND;
    END LOOP;
    CLOSE c1;
    END;
    Stored procedure is working properly on sql*plus(Oracle 8.1.5)) editor. But it is not working from a standalone java application. Can anyone please give me a solution.
    thanks and regards
    Shyam Krishna

    The first solution is to not do that in java in the first place.
    DDL should be in script files which are applied to oracle outside of java.
    Other than I believe there are some existing stored procedures in Oracle that take DDL strings and process them. Your user has to have permission of course. You can track them down via the documentation.

  • Handling result form Stored Proc in java program

    Folks, I have a question on how to handle results from Stored Procedures with the java.sql API. I execute a stored proc from a java program using the statement:
    statement.execute();
    where 'statement' is of type Statement. Then I get the results:
    ResultSet rs = query.getResultSet();
    The above returns me a ResultSet object. Now, my stored proc is such that it will return an integer in case of errors (as error code), and, if no error,it'll return the result set. Because I wouldn't know if the stored proc is returning an integer or a result set, how do I get the result of the stored proc in the java program? 'query.getResultSet()' would get me only an object of type ResultSet. What if the stored proc is returning an integer (i.e. when an error occurs)?
    Thanks.

    GSP wrote:
    Thanks to all for your replies. I do not have access to modify the stored procedure. I can just use it in my java program. The stored proc first validates its input parameters. If it finds them invalid, then it returns an appropriate error code (which is an integer) depending on which input param is found invalid. If all the input parameters are found valid, then it fetches the rows from the DB tables & returns them as result set. Now my question is: say if I give a statement as this in my java program:
    ResultSet rs = query.getResultSet();
    what if the stored proc returns an error code (Since the above statement gets only ResultSet object, how will it handle if the stored proc returns an int)? Is there any alternative?
    Ok, so there is a piece of missing data.
    Store procs, conceptuatlly can return data in a variety of ways.
    So the first step is to determine how the data is being returned.
    Unless you know that there is no way to determine how to use it in java.

  • Calling Stored Procedure with CLOB parameter

    Hi,
    i have one procedure with IN parameter CLOB which is taking xml file and stored in one table column and this table column datatype is also CLOB. And this procedure called by .Net program but problem is when the file will come more than 32KB calling procedure failed. But as i know CLOB can stored up to 4GB data.
    Is that Limitation of oracle or .Net version
    please let me know the solution for that,
    Create Procedure Insert_File(P_XMLFILE IN CLOB)
    as
    begin
    insert into instances
    values(p_xmlfile);
    commit;
    end;
    regards,
    Madan

    Hi Thanks for your reply,
    Actually this procedure called by .net program and the XML file has passed in that parameter which come from some FTP(its inbound) and this files we are storing into above mentioned table.
    Error has come while calling stored procedure Through .net
    Error Details:
    Error calling stored procedure. 0 retry attemps has failed. Error: System.Exception: Error while calling stored procedure on Oracle: INSERT_FILE: System.Data.OracleClient.OracleException: ORA-01460: unimplemented or unreasonable conversion requested

  • SQLException Calling Stored Procedure

    Hello all,
    I'm getting the following exception when calling a stored procedure from Java. Maybe someone can help me out here. See details below.
    Exception
    java.sql.SQLException: ORA-01747: invalid user.table.column, table.column, or column specification
    at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134)
    at oracle.jdbc.ttc7.TTIoer.processError(TTIoer.java:289)
    at oracle.jdbc.ttc7.Oall7.receive(Oall7.java:573)
    at oracle.jdbc.ttc7.TTC7Protocol.doOall7(TTC7Protocol.java:1891)
    at oracle.jdbc.ttc7.TTC7Protocol.parseExecuteFetch(TTC7Protocol.java:1093)
    at oracle.jdbc.driver.OracleStatement.executeNonQuery(OracleStatement.java:2047)
    at oracle.jdbc.driver.OracleStatement.doExecuteOther(OracleStatement.java:1940)
    at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:2709)
    at oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePreparedStatement.java:589)
    at oracle.jdbc.driver.OraclePreparedStatement.execute(OraclePreparedStatement.java:656)
    at storedproctest.StoredProcApp.<init>(StoredProcApp.java:111)
    at storedproctest.DBApp.<init>(DBApp.java:20)
    at storedproctest.DBApp.main(DBApp.java:49)
    Database - Oracle 9.2.0.1.
    SQL> desc dsl_type;
    Name Null? Type
    SITE_NAME VARCHAR2(30)
    DSL_ID NUMBER(10)
    DSL_NAME VARCHAR2(20)
    THRESHOLD NUMBER
    AZIMUTH NUMBER
    SIG_DWN_COL_DURATION NUMBER
    COMMENTS VARCHAR2(100)
    CREATED_BY_ID NUMBER(5)
    DATE_CREATED DATE
    LAST_MODIFIED_BY_ID NUMBER(5)
    DATE_LAST_MODIFIED DATE
    DATE_DEACTIVATED DATE
    SQL>
    SQL> desc dsls;
    Name Null? Type
    SITE_NAME NOT NULL VARCHAR2(30)
    DSL_ID NOT NULL NUMBER(10)
    DSL_NAME NOT NULL VARCHAR2(20)
    THRESHOLD NOT NULL NUMBER
    AZIMUTH NOT NULL NUMBER
    SIG_DWN_COL_DURATION NOT NULL NUMBER
    COMMENTS NOT NULL VARCHAR2(100)
    CREATED_BY_ID NOT NULL NUMBER(5)
    DATE_CREATED NOT NULL DATE
    LAST_MODIFIED_BY_ID NOT NULL NUMBER(5)
    DATE_LAST_MODIFIED NOT NULL DATE
    DATE_DEACTIVATED DATE
    SQL>
    pl/SQL procedure
    PROCEDURE add( dslIn IN DSL_TYPE )
    AS
    dslId NUMBER := 0;
    BEGIN
    -- Do a little sanity checking
    utils.assert_non_zero( dslIn.created_by_id );
    utils.assert_not_null( dslIn.dsl_name );
    -- Get a new sequence value and insert the new dsl
    SELECT dsls_id_seq.NEXTVAL INTO dslId FROM dual;
    INSERT INTO dsls( SITE_NAME, DSL_ID, DSL_NAME, THRESHOLD, AZIMUTH, SIG_DWN_COL_DURATION, COMMENTS,
    CREATED_BY_ID, DATE_CREATED, LAST_MODIFIED_BY_ID, DATE_LAST_MODIFIED, DATE_DEACTIVATED )
    VALUES(( SELECT TRIM( global_name ) FROM global_name ), dslId, dslIn.dsl_name, dslIn.threshold,
    dslIn.azimuth, dslIn.sig_Dwn_Col_Duration, dslIn.comments, dslIn.created_by_id, SYSDATE,
    dslIn.created_by_id, SYSDATE, NULL );
    -- Commit this transaction to the database
    COMMIT;
    END add;
    Java code
    try {
    StructDescriptor dslStructDesc = StructDescriptor.createDescriptor( "DSL_TYPE", dbConn );
    Object[] dslAttributes = new Object[12];
    dslAttributes[0] = " "; // populated via pl/sql
    dslAttributes[1] = new BigDecimal( 0 ); // populated via pl/sql
    dslAttributes[2] = "Crator Lake";
    dslAttributes[3] = new BigDecimal( 098.34 );
    dslAttributes[4] = new BigDecimal( 23.67 );
    dslAttributes[5] = new BigDecimal( 101.1 );
    dslAttributes[6] = "Inserting from JAVA!";
    dslAttributes[7] = new BigDecimal( 2 );
    dslAttributes[8] = new java.sql.Date( GregorianCalendar.getInstance().getTimeInMillis());
    dslAttributes[9] = new BigDecimal( 2 );
    dslAttributes[10] = new java.sql.Date( GregorianCalendar.getInstance().getTimeInMillis());
    dslAttributes[11] = new java.sql.Date( GregorianCalendar.getInstance().getTimeInMillis());
    STRUCT dslType = new STRUCT( dslStructDesc, dbConn, dslAttributes );
    ocStmnt = (OracleCallableStatement)dbConn.prepareCall( "CALL DSL.add( ? )" );
    ocStmnt.setObject( 1, dslType );
    ocStmnt.execute();
    ocStmnt.close();
    dbConn.close();
    catch( SQLException sqlEx ) { sqlEx.printStackTrace(); }

    I'm not necessarily recommending the approach, but you can use a SELECT in the VALUES clause.
    It acts as a scalar subquery, so it will work in 8i and up in SQL, and 9i and up in PL/SQL.
    It will also work in PL/SQL in 8i if you use dynamic SQL.
    65765, use the code tags to format your code.
    I ran this in 9.2.0.4.
    INSERT INTO t
            id,
            value
    VALUES
            1,
            (SELECT ROWNUM FROM all_objects WHERE ROWNUM = 1)
    1 row created.
    SELECT * FROM t
            ID      VALUE
             1          1
    BEGIN
            INSERT INTO t
                    id,
                    value
            VALUES
                    2,
                    (SELECT ROWNUM FROM all_objects WHERE ROWNUM = 1)
    END;
    PL/SQL procedure successfully completed.
    SELECT * FROM t
            ID      VALUE
             1          1
             2          1

  • Stored procedure call fails

    Hi,
    I have a very peculiar problem. I use Oracle 8i, and I use Oracle 8i for my development.
    My call to stored procedure is successfull for the first time. The second time I call it, it does not work.
    I am not able to reproduce it in a stand alone code. It happens in my application only.
    Additional information, I obtained on tracing the session.
    1. The sql statement for execute gets prepared using OCIStmtPrepare().(2nd time also.)
    2. The variables get bound with the sql statement.
    3. It fails only on OCIStmtExecute() statement. (Only the 2nd time.)
    I use Oracle type objects for retrieving data from the views, and obtain references for the same from my stored procedure.
    Kindly let me know how I can solve this problem.

    Hi,
    I just missed mentioning, I get the error ORA-1001.
    Which means, invalid cursor.
    When the stored procedure is getting executed the second time, it straight away goes to the exception block of the stored procedure. It does not go even into the 1st line of the stored procedure.
    -Prathap

  • Error after calling PL/SQL Stored Procedure

    I have a JSP/Struts application that has a master table and several subordinate tables. Each table has inserts, updates and deletes handled by a stored procedure.
    When a record is inserted into any of the subordinate tables, the stored procedure gets called successfully and the data is saved, but an error condition is raised:
    JBO-26041: Failed to post data to database during "Rollback to Savepoint": SQL Statement "null".
    ORA-01086: savepoint 'BO_SP' never established
    The stored procedures execute a commit.
    On the master table, if a search has been performed and returned rows, inserting a new row raises:
    JBO-27021: Failed to load CustomDatum value at index 8 with java object of type oracle.jbo.domain.Raw due to java.sql.SQLException.
    Stream has already been closed
    There is a BLOB data type column in the table, but it is not included in the EO or VO, nor is it referenced by the stored procedure.
    If a search is performed and no records are returned, the stored procedure inserts the new row and no errors are raised.
    I'm stumped...anybody got any ideas?

    I've fixed it now. I'd missed a } in prepareCall. What a doughball.

  • Multiple stored procedure run across clusters

    Hi there,
    Currently we are having a single Oracle 11g instance. All our stored procedures are run on this database either directly from within the database (DBMS_JOB) or called externally from front-end java web apps.
    The question is we now have to cater for scenarios where there will lot more avenues (other java apps) calling the stored procedure and we want to provision for such scenarios without impacting the performance or agreed upon throughput back to the calling application.
    One option I read was about clustering (RAC) and how this can be configured at the database level to transparently cater to a huge volume of stored procedure calls to the database without affecting (requiring changes on the calling entities). So the java front end apps will only refer to a single database but Oracle RAC configured for the database will handle the heavy load scenario in seamless and transparent fashion across the clusters
    We don't want to split the execution of one single stored procedure run into multiple process for performance we have that part covered with optimizing the queries of the stored procedure
    but we want to provision for a scenario where multiple apps can spawn calls to the stored procedures simultaneously and the database is efficient about handling these parallel stored procedure invocations and does not overwhelm under the pressure of large volume of stored procedure run causing degradation of stored procedure runtime/response time.
    Please provide your thoughts.

    If those stored procedures are making DML calls against more-or-less the same data, you will be introduce contention.
    In a single instance (non-RAC) contention is within the SGA (buffer_cache, shared_pool, latches, enqueues). If the application is not scalable within the single instance, you will likely make performance worse when running it in RAC.
    So, you must first evaluate how it works (or would work) in a single instance database -- find out if it scalable merely by adding hardware. If it is scalable but your current hardware is limited, you can consider RAC. If it is not scalable and you have serialisation or contention, performance would be worse in RAC.
    Hemant K Chitale

  • How to display stored procedure results in SJSC table?

    I have been able to create a cached rowset and debug/watch the results, but do not understand how to transfer those results to a Table component. Can anyone point me in the right direction?
    Details:
    In SessionBean1.java, I declared the stored procedure and rowset along with get/set and update procedures:
    // SLS trying stored procedure 20060412
        private java.sql.CallableStatement spFXRatesStatement; 
        private CachedRowSetXImpl spFXRatesRowSet = new CachedRowSetXImpl();
        public CachedRowSetXImpl getSpFXRatesRowSet() {
            return spFXRatesRowSet;
        public void setSpFXRatesRowSet(CachedRowSetXImpl crsxi) {
            this.spFXRatesRowSet = crsxi;
        public void updateSpFXRatesRowSet(String inDate, String inCcy) {
            try {
                spFXRatesStatement.setString(1, inDate);
                spFXRatesStatement.setString(2, inCcy);
                spFXRatesRowSet.populate(spFXRatesStatement.executeQuery(), 1);
            catch (Exception e) {
                // TODO - write exception code
    // SLS trying stored procedure 20060412I then �prepared� the stored procedure within SessionBean1�s init() procedure:
    // SLS trying a stored proc 20060412
            try {
                javax.naming.Context ctx = new javax.naming.InitialContext();
                javax.sql.DataSource ds = (javax.sql.DataSource)ctx.lookup("java:comp/env/jdbc/bmo_fp");
                java.sql.Connection conn = ds.getConnection();
                // spGetFXRates
                spFXRatesStatement = conn.prepareCall("{call GetFXRates(?, ?)}",
                        java.sql.ResultSet.TYPE_SCROLL_INSENSITIVE, java.sql.ResultSet.CONCUR_READ_ONLY);          
               // next sp...
                // clean up
                ctx.close();
                conn.close();
            catch (Exception e) {
                // TODO - add exception code
    // SLS 20060412 I can see the results in a web page procedure with a �getSessionBean1().getSpFXRatesRowSet().getString(i)� watch.
    try {
                getSessionBean1().updateSpFXRatesRowSet("9/30/2005","EUR");
                getSessionBean1().getSpFXRatesRowSet().first();
                while (getSessionBean1().getSpFXRatesRowSet().isLast() != true) {
                    getSessionBean1().getSpFXRatesRowSet().next();
            catch (Exception e) {
                // TODO - specify error detail
            }Now, how do I transfer these results to a table?

    I think you have to add a CachedRowSetDataProvider to you page been.
    Then initalize it with your getSpFXRatesRowSet() in the init() method.
    Then link you table to the CachedRowSetDataProvider.

Maybe you are looking for