Accessing a sys refcursor as a plsql out parameter

The 11g jdbc guide gives and example of how to access a pl/sql function RETURNING a cursor. We have a stored proc that returns about 5 out parameters one of which is a SYS_REFCURSOR. This is different from RETURNING a ref cursor. Can someone please help me with how to pass a resultset object to the stored proc. I presume the same java declaration is required:
ResultSet cursor;
pass this as a parameter to the stored proc. I have listed the 11g JDBC sample code below:
import oracle.jdbc.*;
CallableStatement cstmt;
ResultSet cursor;
// Use a PL/SQL block to open the cursor
********** HIMANSHU reaplce this with the name of my stored proc dennis1.pkg_snapitall ****************
cstmt = conn.prepareCall
("begin open ? for select ename from emp; end;");
cstmt.registerOutParameter(1, OracleTypes.CURSOR);
cstmt.execute();
cursor = ((OracleCallableStatement)cstmt).getCursor(1);
// Use the cursor like a standard ResultSet
while (cursor.next ())
{System.out.println (cursor.getString(1));}
In the preceding example:
•     A CallableStatement object is created by using the prepareCall method of the connection class.
•     The callable statement implements a PL/SQL procedure that returns a REF CURSOR.
•     As always, the output parameter of the callable statement must be registered to define its type. Use the type code OracleTypes.CURSOR for a REF CURSOR.
•     The callable statement is run, returning the REF CURSOR.
•     The CallableStatement object is cast to OracleCallableStatement to use the getCursor method, which is an Oracle extension to the standard JDBC API, and returns the REF CURSOR into a ResultSet object.

public void readSysRef() throws SQLException {
try {
OracleCallableStatement stmt = (OracleCallableStatement)
// both are ok.
//NOTE: when using call, add ";" after get_empployees() will fail
//connect.prepareCall("{ call ? := get_employees( ? ) }");
connect.prepareCall("begin ? := get_employees( ? ); end;");
stmt.registerOutParameter(1, OracleTypes.CURSOR);
stmt.setInt( 2, 10000);
stmt.execute();
OracleResultSet rs = (OracleResultSet) stmt.getCursor(1);
while (rs.next()) {
System.out.format("Employee %1$s has salary %2$d.%n",
rs.getString(1), rs.getInt(2));
} catch (SQLException e) {
throw e;
}

Similar Messages

  • OUT parameter with NOCOPY hint of type SYS_REFCURSOR

    Hi,
    I am having a procedure which returns a set of 100+ records (each record having 10+ columns) through a OUT parameter of type SYS_REFCURSOR.
    These output records are used in JAVA code for fecthing the resultset and process data.
    Will it make any difference in performance if I use NOPCOPY compiler hint in this procedure (especially I am interested in the interaction between JAVA and PLSQL, with and without NOCOPY parameter).
    Thanks.
    Edited by: user2946813 on Mar 25, 2012 9:15 PM

    user2946813 wrote:
    Hi RP,
    Thanks for the answer.
    So the PLSQL OUT parameter of type SYS_REFCURSOR would be passing just a reference (memory address) to JAVA.
    This behavior is same with or without NOCOPY. Is my understanding correct?
    Thanks.Yes. A ref cursor is just a pointer to a query, not a result set of data. Using NOCOPY or not is pointless (excuse the pun) because, no matter how much data is going to get returned, the pointer itself is no smaller or larger in size, and thus using NOCOPY won't improve performance or save resources.
    {thread:id=886365}

  • On iPhoto, I can no longer access the 'Classic' option which would lay out my photos on the page. It will send them as attachments only. I need the page layout for my work. Any thoughts as to why this has changed?

    On iPhoto, I can no longer access the 'Classic' option which would lay out my photos on the page. It will send them as attachments only. I need the page layout for my work. Any thoughts as to why this has changed? It used to fully lay out the photos so I could add notes and detailed information before I sent them. I am thinking it is something simple that I have just missed...

    The "Photos" view has been replaced by the Media Browser.
    Most applications will show you the Photos icon in the Sidebar, when you need to select photos in a file chooser dialoge. Mail, Safari, the iWork apps. See Terence Devlin's User Tip: How to Access Files in iPhoto
    For example, in the File > Open dialogue in Preview I am seeing this in the sidebar.

  • ICloud storage space used up by old data from 1st gen iPad I traded in nearly 2 yrs ago for an iPad Mini. Can't backup any info for mini or new 6 plus. How can I access this old data to clear it out?

    My iCoud storage space is being used up by old data from a 1st  generation iPad I traded in nearly 2 yrs ago for an iPad Mini. The people at the sprint store where I made my trade were supposed to transfer everything over from my old iPad to the new Mini once they backed up the old device to iCloud. Well, long story short, none of the data ever got transferred to the new iPad, but it all got backed to iCloud, eating up all my storage space. Here I am almost 2 years later, and I've never been able to back-up my iPad mini. What's worse, My iPhone 4 wasn't backed up that whole time, and now I can't back-up my data from my new iPhone 6 Plus to iCloud either. Trying to find creative ways to store and save my information and data between all my devices is getting to be ridiculous. I don't want to upgrade my storage space though...just want to clear out a great deal of what is already being stored. How can I access this old data to clear it out?

    The only way to access data from an iCloud backup is to restore it to your device.  You could, for example, back up your iPad mini to your computer using iTunes (by connecting it, opening iTunes, then going to File>Devices>Back Up and choosing to back up apps and transfer purchases when prompted), then erase it and restore the old iPad backup (as explained here: iCloud: Restore or set up your iOS device from iCloud), save any recovered data you want to keep, then restore your iTunes backup back to your iPad mini (by connecting it to your computer, opening iTunes, then going to File>Devices>Restore from Backup).
    Once you're done with the old backup, delete it from your account to free up the space.

  • Statement in resumable session 'SYS.SYS_IMPORT_FULL_01.1' was timed out

    I am working on Oracle 10.2.0.2 database on Solaris 10.
    I am trying to import a schema into the database but the datapump job was hanging due to resumable timeout. Temp tablespace ran out of space.
    Alert log
    ORA-01652: unable to extend temp segment by 128 in tablespace TEMP
    Wed Sep 22 07:38:24 2010
    statement in resumable session 'SYS.SYS_IMPORT_FULL_01.1' was timed out
    Wed Sep 22 08:00:52 2010
    alter database tempfile '/u01/oradata/DATA/temp01.dbf' autoextend on next 400M maxsize 16G
    Wed Sep 22 08:00:53 2010
    Completed: alter database tempfile '/u01/oradata/DATA/temp01.dbf' autoextend on next 400M maxsize 16G
    Import log
    Processing object type SCHEMA_EXPORT/TABLE/GRANT/OWNER_GRANT/OBJECT_GRANT
    Processing object type SCHEMA_EXPORT/TABLE/INDEX/INDEX
    The status of the job is executing.
    Worker 1 Status:
    State: EXECUTING
    Object Schema: TAINT
    Object Name: AALTAINT_IDX0
    Object Type: SCHEMA_EXPORT/TABLE/INDEX/INDEX
    Completed Objects: 160
    Worker Parallelism: 1
    Now I have increased the size of the temp file and want the datapump job to continue. Will I be able to force it or should I wait for the datapump job to retry after the timeout period?
    Edited by: user11971085 on 22-Sep-2010 00:18

    Hi,
    1) After resumable timeout , it will be resumed
    2) You can use one more option
    impdp>help
    impdp> start_job jobname
    It will resume the paused job
    Hope this answers your question
    Kind Regards,
    Rakesh jayappa

  • Grant access to SYS.V$TEMP_SPACE_HEADER view - how to?

    Hi,
    I created a user. I am trying to give select access on some of the System tables and views to this user to retrieve some information about the database.
    When I try
    grant select on sys.v$temp_space_header to usr1;
    I am getting the following error
    grant select on sys.v$temp_space_header to usr1
    ERROR at line 1:
    ORA-02030: can only select from fixed tables/views
    I am getting the same error when I try to give select access to SYS.V$TEMPSTAT view also.
    Does anyone know why this error is coming? Please let me know how I can grant select access to the user for these views.

    Hi,
    This two views are synonyms.
    SQL> grant select on sys.V$TEMPSTAT to scott;
    grant select on sys.V$TEMPSTAT to scott
    ERREUR à la ligne 1 :
    ORA-02030: une sélection n'est autorisée que depuis des tables fixes/vues
    SQL> grant select on sys.V$TEMP_SPACE_HEADER to scott;
    grant select on sys.V$TEMP_SPACE_HEADER to scott
    ERREUR à la ligne 1 :
    ORA-02030: une sélection n'est autorisée que depuis des tables fixes/vues
    SQL> select synonym_name,table_name
    2 from dba_synonyms
    3 where synonym_name in ('V$TEMP_SPACE_HEADER','V$TEMPSTAT');
    SYNONYM_NAME TABLE_NAME
    V$TEMPSTAT V_$TEMPSTAT
    V$TEMP_SPACE_HEADER V_$TEMP_SPACE_HEADER
    SQL> grant select on sys.V_$TEMPSTAT to scott;
    Autorisation de privilèges (GRANT) acceptée.
    SQL> grant select on sys.V_$TEMP_SPACE_HEADER to scott;
    Autorisation de privilèges (GRANT) acceptée.
    Nicolas.

  • Call from Java Plsql Procedure with VArray as Out Parameter

    Hi,
    I have a Java web application(Tomcat server) that call a plsql procedure with Varray as OUT parameter.
    The Plsql code is perfectly compiled.
    When i run the application, I get the following error msg in my Tomcat window:
    java.sql.SQLException: ORA-06530: Reference to uninitialized composite
    ORA-06512: at "SEMS1.PACK_SEMSADMIN_OFFEREDJOBS", line 102
    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:109
    3)
    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(OraclePreparedStat
    {color:#0000ff}
    Doubt: Do I need to declare ArrayDescriptors to retrieve the VArray from the Plsql procedure.
    I think the below statement is enough; we need ArrayDescriptors only when we we wish to send a Plsql Object or Varray from Java code to the procedure. Plz correct me if not so.
    dbCallableStatement.execute();
    ARRAY SimpleOUTArray = (ARRAY) ((OracleCallableStatement) dbCallableStatement).
    getObject(Integer.parseInt(arlParameterOutIndex.get(i).toString()));{color}
    I am unable to realize where the mistake is?
    {color:#800000}
    {color}{color:#800000}
    VARRAY AND PROC DETAILS:
    TYPE STRUCT_JOB_DETAILS AS OBJECT
    APPL_NO NUMBER (10),
    S_FNAME VARCHAR2 (32 Byte),
    S_MI VARCHAR2 (32 Byte),
    S_LNAME VARCHAR2 (32 Byte),
    APPL_DATE DATE,
    DESCRIPTION VARCHAR2 (100 Byte),
    S_UCID VARCHAR2 (8 Byte)
    TYPE VARRAY_JOB_DETAILS IS VARRAY(100) OF STRUCT_JOB_DETAILS;{color}
    {color:#800000}PROCEDURE:{color}
    {color:#800000}CREATE OR REPLACE PACKAGE PACK_SEMSADMIN_OFFEREDJOBS
    AS
    TYPE Generic_Cursor_Type IS REF CURSOR;
    --TYPE varray_job_detail is VARRAY(100) OF STRUCT_JOB_DETAILS;
    --va_varray_job_detail varray_job_detail := varray_job_detail();
    va_varray_job_detail VARRAY_JOB_DETAILS := VARRAY_JOB_DETAILS();
    PROCEDURE Admin_Jobs_Offered_Rtr
    ic_status IN VARCHAR2,
    or_offered_jobs OUT Generic_Cursor_Type,
    va_varray_job_detail OUT VARRAY_JOB_DETAILS
    CREATE OR REPLACE PACKAGE BODY PACK_SEMSADMIN_OFFEREDJOBS
    AS
    PROCEDURE Admin_Jobs_Offered_Rtr
    ic_status IN VARCHAR2,
    or_offered_jobs OUT Generic_Cursor_Type,
    va_varray_job_detail OUT VARRAY_JOB_DETAILS
    AS
    vc_query VARCHAR2(15000) := '';
    vc_query_1 VARCHAR2(15000) := '';
    counter NUMBER := 1;
    vc_no NUMBER := 0;
    or_applicants_list Generic_Cursor_Type;
    TYPE type_appln_list IS RECORD
    job_no NUMBER(10),
    job_title VARCHAR2(50 BYTE),
    account_no VARCHAR2(10 BYTE),
    head_fname VARCHAR2(32 BYTE),
    head_minitial VARCHAR2(10 BYTE),
    head_lname VARCHAR2(32 BYTE),
    num NUMBER
    vn_appln_list type_appln_list;
    TYPE type_job_offered IS RECORD
    APPL_NO NUMBER (10),
    S_FNAME VARCHAR2 (32),
    S_MI VARCHAR2 (32),
    S_LNAME VARCHAR2 (32),
    APPL_DATE DATE,
    DESCRIPTION VARCHAR2 (100),
    S_UCID VARCHAR2 (8)
    vn_job_offered type_job_offered;
    BEGIN
    vc_query := vc_query || ' SELECT jobs.job_no,job_title, account_no, head_fname, head_minitial, head_lname, num';
    vc_query := vc_query || ' FROM jobs, ( ' ;
    vc_query := vc_query || ' SELECT jobs.job_no,count(*) as num' ;
    vc_query := vc_query || ' FROM student_apps ,jobs ' ;
    vc_query := vc_query || ' WHERE jobs.job_no = student_apps.job_no' ;
    vc_query := vc_query || ' AND (student_apps.status in (''o'',''t'')) '; --|| ic_status || ')' ;
    vc_query := vc_query || ' AND jobs.status not in (''z'', ''Z'')' ;
    vc_query := vc_query || ' GROUP BY jobs.job_no' ;
    vc_query := vc_query || ' ) no_apps_off' ;
    vc_query := vc_query || ' WHERE jobs.job_no = no_apps_off.job_no' ;
    dbms_output.put_line('Executed Query_1');
    va_varray_job_detail := VARRAY_JOB_DETAILS();
    va_varray_job_detail.extend(100);
    OPEN or_offered_jobs FOR vc_query;
    LOOP
    FETCH or_offered_jobs INTO vn_appln_list;
    EXIT WHEN or_offered_jobs%NOTFOUND;
    vc_query_1 := '';
    vc_query_1 := vc_query_1 || ' SELECT stud_apps.appl_no APPL_NO, stud_apps.s_fname S_FNAME, ';
    vc_query_1 := vc_query_1 || ' stud_apps.s_mi S_MI, stud_apps.s_lname S_LNAME, ';
    vc_query_1 := vc_query_1 || ' stud_apps.appl_date APPL_DATE, look_up.description DESCRIPTION, ' ;
    vc_query_1 := vc_query_1 || ' stud_apps.s_ucid S_UCID ' ;
    vc_query_1 := vc_query_1 || ' FROM student_apps stud_apps,jobs jbs,lookup look_up' ;
    vc_query_1 := vc_query_1 || ' WHERE stud_apps.status in (''o'',''t'') '; --(' || ic_status || ') ' ;
    vc_query_1 := vc_query_1 || ' AND jbs.job_no = stud_apps.job_no' ;
    vc_query_1 := vc_query_1 || ' AND jbs.status not in (''z '', ''Z'')' ;
    vc_query_1 := vc_query_1 || ' AND stud_apps.status = look_up.code ' ;
    vc_query_1 := vc_query_1 || ' AND look_up.type = ''st''' ;
    vc_query_1 := vc_query_1 || ' AND stud_apps.job_no = ''' || vn_appln_list.job_no || ''' ' ;
    vc_query_1 := vc_query_1 || ' ORDER BY appl_date' ;
    dbms_output.put_line('Executed Query_2');
    OPEN or_applicants_list FOR vc_query_1;
    LOOP
    FETCH or_applicants_list INTO vn_job_offered;
    EXIT WHEN or_applicants_list%NOTFOUND;
    va_varray_job_detail(counter).APPL_NO := vn_job_offered.APPL_NO;
    va_varray_job_detail(counter).S_FNAME := vn_job_offered.S_FNAME;
    va_varray_job_detail(counter).S_MI := vn_job_offered.S_MI;
    va_varray_job_detail(counter).S_LNAME := vn_job_offered.S_LNAME;
    va_varray_job_detail(counter).APPL_DATE := vn_job_offered.APPL_DATE;
    va_varray_job_detail(counter).DESCRIPTION := vn_job_offered.DESCRIPTION;
    va_varray_job_detail(counter).S_UCID := vn_job_offered.S_UCID;
    counter := counter + 1;
    END LOOP; --end of FOR
    CLOSE or_applicants_list;
    END LOOP; -- end of FETCH
    END Admin_Jobs_Offered_Rtr;
    END PACK_SEMSADMIN_OFFEREDJOBS;
    /{color}
    Reqire help plzzzz !!!
    Thanks.

    Originally posted by JDBC Development Team:
    It's very similar to other datatype except that it uses OracleTypes.ARRAY typecode and the value is mapped to a oracle.sql.ARRAY instance. The code looks as follows --
    cstmt.registerOutParameter (idx, OracleTypes.ARRAY, "VARRAY_TYPE_NAME_HERE");
    cstmt.execute ();
    ARRAY array = (ARRAY) cstmt.getObject (idx);
    Thanks for your reply.
    I have to use:-
    OracleCallableStatement cs1 = (OracleCallableStatement )conn.prepareCall
    ( "{call proj_array(?)}" ) ;
    for retrieving a collection as an OUT parameter.
    This gives me the errors:-
    C:\jdbc\VarraySQL.java:0: The method oracle.jdbc2.Blob getBlob(int) declared in class oracle.jdbc.driver.OracleCallableStatement cannot override the method of the same signature declared in interface java.sql.CallableStatement. They must have the same return type.
    import java.sql.*;
    ^
    C:\jdbc\VarraySQL.java:0: The method oracle.jdbc2.Array getArray(int) declared in class oracle.jdbc.driver.OracleCallableStatement cannot override the method of the same signature declared in interface java.sql.CallableStatement. They must have the same return type.
    import java.sql.*;
    ^
    C:\jdbc\VarraySQL.java:0: The method oracle.jdbc2.Clob getClob(int) declared in class oracle.jdbc.driver.OracleCallableStatement cannot override the method of the same signature declared in interface java.sql.CallableStatement. They must have the same return type.
    import java.sql.*;
    ^
    C:\jdbc\VarraySQL.java:0: The method oracle.jdbc2.Ref getRef(int) declared in class oracle.jdbc.driver.OracleCallableStatement cannot override the method of the same signature declared in interface java.sql.CallableStatement. They must have the same return type.
    import java.sql.*;
    ^
    How do I get rid of these errors?
    null

  • HT4796 I did all of the above and the migration was successful, but I don't know where the files are.  It says they're under a different user, 'owner' .  I tried to access via sys pref/system/users&groups, but it asks for a password for owner which I don'

    Migration Assit , PC to MAC - The migration was successful, but I don't know where the files are.  It says they're under a different user, 'owner' .  I tried to access via sys pref/system/users&groups, but it asks for a password for owner which I don't have.  What must I do to access my files?
    My experience is with MS PC's I'm new with the MAC Book Pro.

    Then, see if this works:
    Mac OS X 10.6 Help- If you forget your administrator password
    If you are running Lion or Mountain Lion you may need to do the following to access the same utility:
    Boot to the Recovery HD:
    Restart the computer and after the chime press and hold down the COMMAND and R keys until the menu screen appears. Alternatively, restart the computer and after the chime press and hold down the OPTION key until the boot manager screen appears. Select the Recovery HD and click on the downward pointing arrow button.
    When the menubar appears select Terminal from the Utilities menu. Enter resetpassword at the prompt and press RETURN. Follow instructions in the dialog window that will appear.
    Or see Reset a Mac OS X 10.7 Lion Password and OS X Lion- Apple ID can be used to reset your user account password.

  • Access to sys and system accounts

    How to determine who can access sys and system accounts?
    we have oracle 10.2.0.4. I want to know which users can access sys and system accounts?
    Please advise
    Thanks
    S.

    ski123 wrote:
    How to determine who can access sys and system accounts?That depends... access to SYS can be done via o/s - no need to compromise the db instance. Only the o/s account running it.
    Even inside Oracle, it is possible to logon as SCOTT and execute SQL and PL/SQL code as SYS - without having any DBA like privs or access to the password for SYS (possible by using a compromised DBMS_SYS_SQL package).
    Bottom line is, you cannot just look at privs inside Oracle to determine who has SYS access. Security and hardening are more complex than that.

  • SYS REFCURSOR return via Function - Procedure

    Hi
    SYS REF CURSOR can be returned back to calling program using a Function and Stored Procedure OUT parameter.
    (1) What is the difference ?
    (2) If the number of rows returned back is large ( assume 1 million ) and the calling program is a Java Program then what is advisable so that the calling program does not run out of memory ?
    Thanks
    Hiren Pandya

    I think this is the matter of choice and a taste. The programming concepts say that procedures doesn’t return a result, only perform some tasks. The functions are the things that return something to the calling program. And the OUT parameters could be very convenient when the returned value is optional. In case of functions you must always read the result or you will get an error.
    And about the difference between returning SYS REF CURSOR via a function or as OUT parameter in Stored Procedure, I don’t think there would be much difference, not regarding the performance, nor convenience.

  • When I tried to access into safari the ipod kicked me out back to the main screen, what is the problem? what i need to do? Help me please...!!!

    When I tried to access into safari the ipod kicked me out back to the main screen, what is the problem? what i need to do? Help me please...!!!

    Try:
    - Reset:
    Reset iPod touch:  Press and hold the On/Off Sleep/Wake button and the Home
    button at the same time for at least ten seconds, until the Apple logo appears.
    - Going to Settings>Safari and deleting cache, history and cookies.

  • PL/SQL Entity Object - Accessing Out parameter values in insertRow method

    Hi,
    I have the following pl/sql code which takes 4 input parameter and 1 out parameter.
    create or replace procedure xxfwk_emp_create(p_person_id IN NUMBER, p_first_name IN VARCHAR2, p_last_name IN VARCHAR2, p_sal IN NUMBER) is
    cursor c1 is select EMPLOYEE_ID from fwk_tbx_employees;
    v_status varchar2(1) := 's';
    BEGIN
    for v_c1 in c1 loop
    if v_c1.employee_id = p_person_id then
    p_error_msg:= 'Person with this id already exist';
    v_status := 'e';
    end if;
    exit when c1%notfound OR v_status='e' ;
    end loop;
    if v_status = 'e' then
    goto error;
    end if;
    INSERT INTO FWK_TBX_EMPLOYEES(EMPLOYEE_ID,
    FIRST_NAME,
    LAST_NAME,
    FULL_NAME,
    SALARY,
    CREATION_DATE,
    CREATED_BY,
    LAST_UPDATE_DATE,
    LAST_UPDATED_BY,
    LAST_UPDATE_LOGIN)
    VALUES(p_person_id,
    p_first_name,
    p_last_name,
    P_first_name||' '||p_last_name,
    p_sal,
    sysdate,
    fnd_global.user_id,
    sysdate,
    fnd_global.user_id,
    fnd_global.login_id);
    <<error>>
    null;
    END xxfwk_emp_create;
    I have following code in EO Impl class
    public void insertRow()
    try
    OADBTransactionImpl oadbTrans = (OADBTransactionImpl)getDBTransaction();
    String s = "begin xxfwk_emp_create(p_person_id=>:1, p_first_name=>:2, p_last_name=>:3, p_sal=>:4, p_error_msg=>:5);end;";
    OracleCallableStatement oraCall = (OracleCallableStatement)oadbTrans.createCallableStatement(s,-1);
    oraCall.setNUMBER(1,getEmployeeId());
    oraCall.setString(2,getFirstName());
    oraCall.setString(3,getLastName());
    oraCall.setNUMBER(4,getSalary());
    *< How to access Out Parameter from The procedure >*
    oraCall.execute();
    catch(SQLException sqlException)
    throw OAException.wrapperException(sqlException);
    catch(Exception exception)
    throw OAException.wrapperException(exception);
    In this insertRow i want to get the error message (out param) and throw this message as exception in OA page.
    What changes i need to do in my page?
    Regards,
    Ram

    Thanks sumit..
    I changed the code as below still i am not getting the error message on the page.
    In jdeveloper i am successfully printing the error message.
    here is the code..
    try
    OADBTransactionImpl oadbTrans = (OADBTransactionImpl)getDBTransaction();
    String s = "begin xxfwk_emp_create(p_person_id=>:1, p_first_name=>:2, p_last_name=>:3, p_sal=>:4, p_error_msg=>:5);end;";
    OracleCallableStatement oraCall = (OracleCallableStatement)oadbTrans.createCallableStatement(s,-1);
    oraCall.setNUMBER(1,getEmployeeId());
    oraCall.setString(2,getFirstName());
    oraCall.setString(3,getLastName());
    oraCall.setNUMBER(4,getSalary());
    String p_error_msg = null;
    System.out.println("Error message before call "+p_error_msg);
    Types OracleTypes;
    oraCall.registerOutParameter(5,OracleTypes.VARCHAR);
    if (p_error_msg!=null)
    throw new OAException(p_error_msg,OAException.ERROR);
    oraCall.execute();
    p_error_msg = oraCall.getString(5);
    System.out.println("Error message after call "+p_error_msg);
    catch(SQLException sqlException)
    throw OAException.wrapperException(sqlException);
    catch(Exception exception)
    throw OAException.wrapperException(exception);
    Regards,
    Ram

  • Problem in Mapping RefCursors(in/out parameter) and Collections(in/out)

    Hi,
    Can anyone help to solve the proble listed below as it is affecting the business process
    The API for A is listed below. It takes Oracle Object types as input/output.
    PROCEDURE A(
    p_serviceOrder IN ServiceOrder,
    p_serviceID IN OUT p_sm_type.ServiceID,
    p_serviceOrderID OUT p_sm_type.ServiceOrderID,
    returnStatus OUT CallStatus);
    The ServiceOrder and CallStatus are Oracle Object types.
    The wrapper procedure for this api would be something like the example with pseudo-code below.
    PROCEDURE B(
    p_serviceOrder IN REF CURSOR,
    p_serviceID IN OUT p_sm_type.ServiceID,
    p_serviceOrderID OUT p_sm_type.ServiceOrderID,
    returnStatus OUT REF CURSOR) {
    Map from REF CURSOR p_serviceOrder To Oracle Object for ServiceOrder;
    Map from other data types to local variables;
    Call A(pass the parameters here and get output…);
    Map output CallStatus to its equivalent REF CURSOR variable;
    Return CallStatus (and other OUT parameters if any) as REF CURSORs;
    It will be highly needful for the solution as it is affecting the business flow requirement.
    Regards
    Saugata

    Hi,
    i think you must set the value for this parameter and additional you must
    register this parameter as out parameter.
    I hope it works.

  • OAF - Missing In or Out Parameter at Index Error

    Hello,
    Here below is my requirement
    I have developed a custom OAF page which queries a list of suppliers from a custom table. I have a button at the bottom of the table which. when clicked should query the SEEDED supplier page (this page is same as the supplier page accessed from the Payables Manager responsibility -> Suppliers -> Supplier Entry/Inquiry -> query any supplier -> the first page that shows up is the QuickUpdatePG). I want to pass parameters to this seeded QuickUpdatePG page with the values selected in my custom OAF Page. I am using SetForwardURL with little luck. Here below is the code I have tried to use and this code is in the CO of my custom page (ProcessFormRequest)
    -- The below code works but doesn't query the supplier in the destination page
    pageContext.setForwardURL(
    "POS_HT_SP_B_QUK_UPD" //"AP_APXVDMVD"
    ,OAWebBeanConstants.KEEP_MENU_CONTEXT
    ,null
    ,h
    ,true
    ,OAWebBeanConstants.ADD_BREAD_CRUMB_NO
    ,OAWebBeanConstants.IGNORE_MESSAGES);
    StringBuffer whereclause = new StringBuffer(100);
    OAViewObject suppview = (OAViewObject)am.findViewObject("SuppSummVO");
    SuppSummVOImpl suppvo = (SuppSummVOImpl)am.getSuppSummVO1();
    SuppSummVORowImpl suppvorow = (SuppSummVORowImpl)suppvo.getCurrentRow();
    whereclause.append( "1=1 and Vendor_name="+"'"vorow.getSupplierName()"'");
    whereclause.append(" and segment1 = "+"'"vorow.getSupplierNumber()"'");
    suppvo.setWhereClause(whereclause.toString());
    System.out.println ("Query is "+suppvo.getQuery());
    suppvo.executeQuery();
    suppvo.createRow();
    suppvo.setCurrentRow(suppvorow);
    -- I searched forums and also the OAF Dev Guide and have tried this code below. This raises the error as "Missing IN or OUT parameter at index:: 2" I am unable to find a fix for this
    pageContext.setForwardURL(
    "POS_HT_SP_B_QUK_UPD" //"AP_APXVDMVD"
    ,OAWebBeanConstants.KEEP_MENU_CONTEXT
    ,null
    ,h
    ,true
    ,OAWebBeanConstants.ADD_BREAD_CRUMB_NO
    ,OAWebBeanConstants.IGNORE_MESSAGES);
    Vector parameters = new Vector (1);
    int bindCount = 0;
    int clauseCount = 0;
    OAViewObject suppliervo = (OAViewObject)am.getVendorsVO1();
    suppliervo.setWhereClauseParams(null);
    StringBuffer whereclause = new StringBuffer(100);
    whereclause.append("Vendor_id = :");
    whereclause.append(++bindCount);
    parameters.addElement(vorow.getVendorId());
    clauseCount++;
    suppliervo.setWhereClause(whereclause.toString());
    if (bindCount > 0){
    Object[] params = new Object[1];
    params.toString();
    parameters.copyInto(params);
    System.out.println("value again is "+parameters.get(0));
    suppliervo.setWhereClauseParams(params);
    } else {
    System.out.println("");
    suppliervo.executeQuery();
    The seeded page takes 1 parameter (Vendor ID) to query the details. I am passing the details of Vendor ID using Vector and setWhereClauseParams. The where clause of the page is as below
    select co1, col2, col3.....from po_vendors pv, ap_awt_groups aag,
    ap_awt_groups pay_aag
    , rcv_routing_headers rcpt
    , fnd_currencies_tl fct
    , fnd_currencies_tl pay
    , fnd_lookup_values pay_group
    , ap_terms_tl terms
    , po_vendors parent
    , per_employees_current_x emp
    , hz_parties hp
    , AP_INCOME_TAX_TYPES aptt
    , per_all_people_f papf
    where pv.vendor_id = :1
    and pv.party_id = hp.party_id
    and pv.parent_vendor_id = parent.vendor_id
    and pv.awt_group_id = aag.group_id
    and pv.pay_awt_group_id = pay_aag.group_id
    and pv.RECEIVING_ROUTING_ID = rcpt.ROUTING_HEADER_ID(+)
    and fct.language = userenv('lang')
    and pay.language (+)= userenv('lang')
    and pv.invoice_currency_code = fct.currency_code
    and pv.payment_currency_code = pay.currency_code
    and
    pv.pay_group_lookup_code = pay_group.lookup_code
    and pay_group.lookup_type (+)='PAY GROUP'
    and pay_group.language (+)=userenv('lang')
    and pv.terms_id = terms.term_id
    and terms.language = userenv('LANG')
    and terms.enabled_flag ='Y'
    and pv.employee_id = emp.employee_id
    and pv.employee_id = papf.person_id
    and pv.type_1099 = aptt.income_tax_type (+)) QRSLT WHERE (Vendor_id = :1)
    My doubt is should the :1 have the actual value passed or is the query built righly. At the end of this query is the error that says "java.sql.SQLException: Missing IN or OUT parameter at index:: 2"
    Any help is highly appreciated.
    Please let me know if any additional information is needed to have a better idea about the issue I am facing.
    Thanks,
    Sudhamsu

    Hi Sudhamsu,
    This error is coming becoz ur using same bind variable :1 in the VO query.
    extend the VO and use different bind variabale like (:1,:2);
    and pass the parameters using setWhereClauseParames in CO..it will fix the issue.
    Thanks
    GK

  • Reg: Need help to call a Stored Procedure - Out Parameter using DBAdapter

    HI
    I have created a procedure with Out Parameter, using DBAdapater i have invoked it. I have assigned the out parameter also. But while running i am getting this error.
    My Procedure is shown below. It executes successfully when its run in database.
    create or replace
    PROCEDURE SP_QUERY(s_string in varchar2, retCodeString out varchar2)
    AS
    l_sql_stmt varchar2(1000);
    BEGIN
    l_sql_stmt := s_string;
    EXECute immediate l_sql_stmt;
    commit;
    if SQLCODE = 0 then
    retCodeString := 'OK';
    end if;
    END;
    java.lang.Exception: oracle.sysman.emSDK.webservices.wsdlapi.SoapTestException:
    Client received SOAP Fault from server : Exception occured when binding was invoked.
    Exception occured during invocation of JCA binding: "JCA Binding execute of Reference operation 'ExecuteScript' failed due to:
    Stored procedure invocation error. Error while trying to prepare and execute the SOADEMO.SP_QUERY API.
    An error occurred while preparing and executing the SOADEMO.SP_QUERY API.
    Cause: java.sql.SQLException: ORA-06550: line 1, column 15:
    PLS-00904: insufficient privilege to access object SOADEMO.SP_QUERY ORA-06550: line 1, column 7:
    PL/SQL: Statement ignored Check to ensure that the API is defined in the database and that the parameters match the signature of the API.
    This exception is considered not retriable, likely due to a modelling mistake.
    To classify it as retriable instead add property nonRetriableErrorCodes with value "-6550" to your deployment descriptor (i.e. weblogic-ra.xml).
    To auto retry a retriable fault set these composite.xml properties for this invoke: jca.retry.interval, jca.retry.count, and jca.retry.backoff.
    All properties are integers. ". The invoked JCA adapter raised a resource exception. Please examine the above error message carefully to determine a resolution.
    at oracle.sysman.emas.model.wsmgt.WSTestModel.invokeOperation(WSTestModel.java:808) at oracle.sysman.emas.view.wsmgt.WSView.invokeOperation(WSView.java:384)
    Please help me in this issue.

    Hi
    Right now i geeting the below error
    java.lang.Exception: oracle.sysman.emSDK.webservices.wsdlapi.SoapTestException: Client received SOAP Fault from server : oracle.fabric.common.FabricException:
    oracle.fabric.common.FabricInvocationException: java.lang.RuntimeException: java.sql.SQLSyntaxErrorException: ORA-00942: table or view does not exist :
    java.lang.RuntimeException: java.sql.SQLSyntaxErrorException: ORA-00942: table or view does not exist
    at oracle.sysman.emas.model.wsmgt.WSTestModel.invokeOperation(WSTestModel.java:808) at oracle.sysman.emas.view.wsmgt.WSView.invokeOperation(WSView.java:384)
    at oracle.sysman.emas.view.wsmgt.WSView.invokeOperation(WSView.java:301) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.
    invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at com.sun.el.parser.AstValue.invoke(Unknown Source)
    at com.sun.el.MethodExpressionImpl.invoke(Unknown Source) at org.apache.myfaces.trinidadinternal.taglib.util.MethodExpressionMethodBinding.
    invoke(MethodExpressionMethodBinding.java:53) at org.apache.myfaces.trinidad.component.UIXComponentBase.broadcastToMethodBinding(UIXComponentBase.java:1256)
    at org.apache.myfaces.trinidad.component.UIXCommand.broadcast(UIXCommand.java:183) at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent$1.
    run(ContextSwitchingComponent.java:92) at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent._processPhase(ContextSwitchingComponent.java:361)
    at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent.broadcast(ContextSwitchingComponent.java:96) at oracle.adf.view.rich.component.fragment.
    UIXInclude.broadcast(UIXInclude.java:102) at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent$1.run(ContextSwitchingComponent.java:92)
    at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent._processPhase(ContextSwitchingComponent.java:361) at oracle.adf.view.rich.component.
    fragment.ContextSwitchingComponent.broadcast(ContextSwitchingComponent.java:96) at oracle.adf.view.rich.component.fragment.UIXInclude.
    broadcast(UIXInclude.java:96) at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:475) at javax.faces.component.UIViewRoot.
    processApplication(UIViewRoot.java:756) at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._invokeApplication(LifecycleImpl.java:889) at
    oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._executePhase(LifecycleImpl.java:379) at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl.
    execute(LifecycleImpl.java:194) at javax.faces.webapp.FacesServlet.service(FacesServlet.java:265) at weblogic.servlet.internal.
    StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227) at weblogic.servlet.internal.StubSecurityHelper.
    invokeServlet(StubSecurityHelper.java:125) at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:300)
    at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26) at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
    at oracle.sysman.emSDK.license.LicenseFilter.doFilter(LicenseFilter.java:101) at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
    at oracle.adf.model.servlet.ADFBindingFilter.doFilter(ADFBindingFilter.java:205) at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56) at oracle.adfinternal.view.faces.webapp.rich.RegistrationFilter.doFilter(RegistrationFilter.java:106) at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:446) at oracle.adfinternal.view.faces.activedata.AdsFilter.doFilter(AdsFilter.java:60) at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:446) at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._doFilterImpl(TrinidadFilterImpl.java:271) at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl.doFilter(TrinidadFilterImpl.java:177) at org.apache.myfaces.trinidad.webapp.TrinidadFilter.doFilter(TrinidadFilter.java:92) at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56) at oracle.help.web.rich.OHWFilter.doFilter(Unknown Source) at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56) at oracle.sysman.emas.fwk.MASConnectionFilter.doFilter(MASConnectionFilter.java:41) at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56) at oracle.adf.library.webapp.LibraryFilter.doFilter(LibraryFilter.java:179) at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56) at oracle.sysman.eml.app.AuditServletFilter.doFilter(AuditServletFilter.java:179) at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56) at oracle.sysman.eml.app.EMRepLoginFilter.doFilter(EMRepLoginFilter.java:203) at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56) at oracle.sysman.core.model.targetauth.EMLangPrefFilter.doFilter(EMLangPrefFilter.java:158) at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56) at oracle.sysman.core.app.perf.PerfFilter.doFilter(PerfFilter.java:141) at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56) at oracle.sysman.eml.app.ContextInitFilter.doFilter(ContextInitFilter.java:542) at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56) at oracle.security.jps.ee.http.JpsAbsFilter$1.run(JpsAbsFilter.java:119) at java.security.AccessController.doPrivileged(Native Method) at oracle.security.jps.util.JpsSubject.doAsPrivileged(JpsSubject.java:315) at oracle.security.jps.ee.util.JpsPlatformUtil.runJaasMode(JpsPlatformUtil.java:442) at oracle.security.jps.ee.http.JpsAbsFilter.runJaasMode(JpsAbsFilter.java:103) at oracle.security.jps.ee.http.JpsAbsFilter.doFilter(JpsAbsFilter.java:171) at oracle.security.jps.ee.http.JpsFilter.doFilter(JpsFilter.java:71) at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56) at oracle.dms.servlet.DMSServletFilter.doFilter(DMSServletFilter.java:139) at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56) at weblogic.servlet.internal.RequestEventsFilter.doFilter(RequestEventsFilter.java:27) at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56) at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.wrapRun(WebAppServletContext.java:3715) at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3681) at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321) at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120) at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2277) at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2183) at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1454) at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209) at weblogic.work.ExecuteThread.run(ExecuteThread.java:178) Caused by: oracle.sysman.emSDK.webservices.wsdlapi.SoapTestException: Client received SOAP Fault from server : oracle.fabric.common.FabricException: oracle.fabric.common.FabricInvocationException: java.lang.RuntimeException: java.sql.SQLSyntaxErrorException: ORA-00942: table or view does not exist : java.lang.RuntimeException: java.sql.SQLSyntaxErrorException: ORA-00942: table or view does not exist at oracle.sysman.emSDK.webservices.wsdlapi.dispatch.DispatchUtil.invoke(DispatchUtil.java:362) at oracle.sysman.emSDK.webservices.wsdlparser.OperationInfoImpl.invokeWithDispatch(OperationInfoImpl.java:1004) at oracle.sysman.emas.model.wsmgt.PortName.invokeOperation(PortName.java:750) at oracle.sysman.emas.model.wsmgt.WSTestModel.invokeOperation(WSTestModel.java:802) ... 79 more Caused by: oracle.j2ee.ws.client.jaxws.JRFSOAPFaultException: Client received SOAP Fault from server : oracle.fabric.common.FabricException: oracle.fabric.common.FabricInvocationException: java.lang.RuntimeException: java.sql.SQLSyntaxErrorException: ORA-00942: table or view does not exist : java.lang.RuntimeException: java.sql.SQLSyntaxErrorException: ORA-00942: table or view does not exist at oracle.j2ee.ws.client.jaxws.DispatchImpl.throwJAXWSSoapFaultException(DispatchImpl.java:1040) at oracle.j2ee.ws.client.jaxws.DispatchImpl.invoke(DispatchImpl.java:826) at oracle.j2ee.ws.client.jaxws.OracleDispatchImpl.synchronousInvocationWithRetry(OracleDispatchImpl.java:235) at oracle.j2ee.ws.client.jaxws.OracleDispatchImpl.invoke(OracleDispatchImpl.java:106) at oracle.sysman.emSDK.webservices.wsdlapi.dispatch.DispatchUtil.invoke(DispatchUtil.java:358) ... 82 more

Maybe you are looking for

  • Runtime engine 8.6.1 on Labview 11

    Hello, I have upgraded labview 10 to Lv 11. A program that used to work on Lv 10 is giving problems now. It asks for runtime engine 8.6 ( usually gets stucked preparing the installation ). Once i cancel this process, it loads all the vi's, and it see

  • Aironet 350BR failed VxWorks to IOS conversion

    I have tried to upgrade VxWorks to IOS and by mistake uploaded AP-Upgrade-Image. After restart it gives me the following: Cisco IOS automatic field upgrade image, ESC to terminate ..10....9....8....7....6....5....4....3....2....1.. upgrade: Compare o

  • Bridge CS6 - Smart Collections Different Result Everytime

    I recently was using a Smart Collection to review selects and I would come up with different results as I openend and closed folders that were a part of Smart Collection file base. Its as if my files hadn't been correctlty indexed or were not being i

  • IPhoto 8- Pictures import as black square

    Have encountered a problem when importing (2) jpg images to Iphoto 8. Images have been saved on desktop and then imported to Iphoto with result a black square. Have tried importing images to other photo albums as well as to a PC with no problem. Can

  • Auto-start OC4J process after Linux reboot

    Oracle 11gR2, OC4J 10g (10.1.3.5.0), RHEL5 64 bit Hi All, I am trying to figure out how to get my oc4j process start at boot time. I already have a dbora script setup. I tried adding the following line to my dbora/dbstart script but it did not do any