Calling a procedure/function in CO using Callable Statement

Hi,
Please help me in understanding this:
__method1__
BEGIN
:1 := Package.Function(
param1 => :2"
,param2 => :3"
,param3 => :4"
,param4 => :5"
END;
method2
BEGIN
Package.Function(:1, :2, :3, :4, :5);"
END;
Whats the significance of using method1?
I have seen the callable statements written as in method1 but, the parameters passed are not in order and not all params are passed.
When i tried writing similar code, I got "Invalid Column Index" exception. Please let me know how to overcome this.
Thanks

Hi,
You can call a function using Callable Statement as
public String checkprimarycontact(String pri_loc_id,String org_id,String party_id)
int p_location_id = 0;
int p_org_id = 0;
int p_party_id = 0;
p_location_id = Integer.parseInt(pri_loc_id);
p_org_id = Integer.parseInt(org_id);
p_party_id = Integer.parseInt(party_id);
String priflag = "";
try
Connection conn1 = getOADBTransaction().getJdbcConnection();
CallableStatement cstmt1 = conn1.prepareCall("{? = call GET_PRIMARY_FUNCTION(?,?,?)}");
cstmt1.registerOutParameter(1,Types.VARCHAR);
cstmt1.setInt(2,p_location_id);
cstmt1.setInt(3,p_org_id);
cstmt1.setInt(4,p_party_id);
cstmt1.execute();
priflag = cstmt1.getString(1);
catch(Exception e1)
e1.printStackTrace();
return priflag;
Thanks,
Gaurav

Similar Messages

  • Calling a procedure/function in forms personalization

    Hi,
    Can any one please help me in calling a procedure/function from the forms personalization? The requirement is to create an attachment when ever a new order line is created in R12. So for this, I created a procedure which calls attachment creation API. And in the forms personalization, I am doing the following.
    Trigger Event: WHEN-VALIDATE-RECORD
    Trigger Object: LINE
    Condition: :LINE.INVENTORY_ITEM_ID is not null
    Action Type: Builtin
    Builtin Type: Execute a Procedure
    Argument: =xx_test_attachment_new(:LINE.LINE_ID,20,'OE_ORDER_LINES',1,'test123')
    This procedure works individually if I call it from TOAD.
    Help is really appreciated?
    Thanks,
    Sri.

    A question for the Forms ?
    Nicolas.

  • Calling Stored Procedure from Oracle DataBase using Sender JDBC (JDBC-JMS)

    Hi All,
    We have requirement to move the data from Database to Queue (Interface Flow: JDBC -> JMS).
    Database is Oracle.
    *Based on Event, data will be triggered into two tables: XX & YY. This event occurs twice daily.
    Take one field: 'aa' in XX and compare it with the field: 'pp' in YY.
    If both are equal, then
         if the field: 'qq' in YY table equals to "Add" then take the data from the view table: 'Add_View'.
         else  if the field: 'qq' in YY table equals to "Modify"  then take the data from the view table: 'Modify_View'.
    Finally, We need to archive the selected data from the respective view table.*
    From each table, data will come differently, means with different field names.
    I thought of call Stored Procedure from Sender JDBC Adapter for the above requirement.
    But I heard that, we cannot call stored procedure in Oracle through Sender JDBC as it returns Cursor instead of ResultSet.
    Is there any way other than Stored Procedure?
    How to handle Data Types as data is coming from two different tables?
    Can we create one data type for two tables?
    Is BPM required for this to collect data from two different tables?
    Can somebody guide me on how to handle this?
    Waiting eagerly for help which will be rewarded.
    Thanks and Regards,
    Jyothirmayi.

    Hi Gopal,
    Thank you for your reply.
    >Is there any way other than Stored Procedure?
    Can you try configuring sender adapter to poll the data in intervals. You can configure Automatic TIme planning (ATP) in the sender jdbc channel.
    I need to select the data from different tables based on some conditions. Let me simplify that.
    Suppose Table1 contains 'n' no of rows. For each row, I need to test two conditions where only one condition will be satisfied. If 1st condition is satisfied, then data needs to be taken from Table2 else data needs to be taken from Table3.
    How can we meet this by configuring sender adapter with ATP?
    ================================================================================================
    >How to handle Data Types as data is coming from two different tables?
    If you use join query in the select statement field of the channel then whatever you need select fields will be returned. This might be fields of two tables. your datatype fields are combination of two diff table.
    we need to take data only from one table at a time. It is not join of two tables.
    ================================================================================================
    Thanks,
    Jyothirmayi.

  • Calling stored procedures with output parameters using RDO and VB

    I have a simple test procedure defined as follows:
    CREATE OR REPLACE PROCEDURE test_sp (inval1 IN VARCHAR2,
    inval2 IN NUMBER, inval3 OUT VARCHAR2, inval4 OUT NUMBER) IS
    BEGIN
    inval3 := 'RETURN TEST';
    inval4 := 10;
    END;
    I am attempting to call this procedure from VB 5.0 using RDO and the Oracle ODBC Driver 8.01.06:
    dim rdoQd as rdoQuery
    dim grdoCn as rdoConnection
    strSQL = "{ call test_sp('SOMETHING',?,?,?) }"
    Set rdoQd = grdoCn.CreateQuery("", strSQL)
    rdoQd(0).Direction = rdParamInput
    ' get error# 40041 at above line
    ' "Object Collection: Couldn't ' find item indicated by text."
    rdoQd(0).Type = rdTypeINTEGER
    rdoQd(0).Value = 5
    rdoQd(1).Direction = rdParamOutput
    rdoQd(1).Type = rdTypeVARCHAR
    rdoQd(2).Direction = rdParamOutput
    rdoQd(2).Type = rdTypeINTEGER
    Set rdoApp = rdoQd.OpenResultset()
    MsgBox (CStr(rdoQd(1)))
    MsgBox (CStr(rdoQd(2)))
    When I run this VB code, I get the above mentioned error. If I use placeholders for all parameters (like "{ call test_sp (?,?,?,?) }" ), no error occurs.
    I really need to use the first type of syntax from above and not have to use placeholders for all parameters. Is there a way to accomplish this?
    TIA,
    Esther

    Are you getting any warning while importing the stored procedure?
    Please check the below datatypes:
    While creating the stored procedure, if you have used varchar(MAX), please ALTER it to varchar(255) and reimport to DS.
    Also, the datatype of $message (global variable or local variable) used inside DS should also be varchar(255)
    Try a print statement in between.
    ADMIN.DBO.SPJOBSUMMARY(69,$message,$rtCode,$rtVal);
    print('Message is '||$message);
    smtp_to('leighattest.com.au', 'Results of ' || job_name(), $rtCode || '//' || $rtVal || '~~' || $message || '//', 0,0);
    and see in the job log if DS is able to retrieve the output from DB.
    Regards,
    Suneer

  • Can I call a C function from Java (using JNI) ??

    hello,
    I need to call one C function from remote device and get its return value(o/p) (for my application it is device SSID ) and display in the client PC.
    Is it possible in java without using SNMP connction?.
    please give me idea about it.
    I need this information as soon as possible.
    Thank you.

    see JNI...
    basically declare a native method in your java class, then run javah on the class thus generating a *.h file. Then implement the c/c++ function. Compile the c/c++ part as a shared library, and make sure its accessible from your LD_LIBRARY_PATH env variable.
    Go through the steps in the JNI docs, and things shoulde be fine... hopefully ;)

  • How to use Callable statements.

    Hi.
    I'm just new in using JSP. I just want to ask how to call stored procedures (ex. from SQL Server) using the Callable statements. A sample code will be very helpful......
    Ex. I have these parameters for my stored proc:
    name = "sentiments"; //value will always vary
    add = "NJ"; //value will always vary
    stored proc name is => usp_updateFile
    Thank you very much for your time.

    See http://developer.java.sun.com/developer/onlineTraining/Database/JDBC20Intro/JDBC20.html#JDBC2013_4

  • How to return Multiple ResultSets Using Callable Statement

    hi everybody,
    while i was working with callable statements i came across a problem of how to fetch Multiple Resultsets by means of Stored Procedures written for tables in Oracle.
    If any one can help me, pls do help me with a detailed explanation, and if possible do get me a example source code too.
    khumaar

    I have a similar problem with oracle and jdbc:
    I want to send a sql query like:
    sqlQuery = "select n1, n2 from table1; select n1, n2
    from table2"
    I used a prepared statement, but when I call
    .execute(sqlQuery)
    oracle doesn't like this,
    can someone help on this?Try putting a begin/end around it. Play with the syntax first in sqlplus.
    You do realize that you MUST extract using the syntax for extracting multiple result sets correct? It will NOT work as one result set.

  • Statement closed when using callable statements with oracle xe

    hi all, i've got this problem with oracle express edition 10g. I am using also oc4j v10.1.2.0.2. When working with a normal oracle database it was working fine (i think the code was the same, it's some time since i last tried, but you can see the code is very simple).
    So i just create a callable statement like this:
    CallableStatement cs = con.prepareCall(sentencia.toString(), ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_UPDATABLE, ResultSet.HOLD_CURSORS_OVER_COMMIT);
    and then when trying to access the statement to register an out parameter like this
    cs.registerOutParameter(1, parámetros[0].getTipo());
    it gives this error:
    java.sql.SQLException: Statement was closed
    It's puzzling me because, as i said before, i think the same code was working ok with a normal oracle database.
    Any idea what can it be?
    cheers

    Ah okay, sorry I've re-read your post.
    I believe you need to create a clob object that encapsulates your xml file.
    I've never done this but I would image it involves creating a class that implements the clob interface and passing an instantiation of this class to the callablestatement.
    Let me know how you get on.

  • How to call stored procedure in SYBASE using callable statement

    Hi all,
    Im using jdbc code to execute a stored procedure in sybase but while running the code i get an error saying
    java.sql.SQLException: JZ0R2: No result set for this query.
    at com.sybase.jdbc2.jdbc.ErrorMessage.raiseError(ErrorMessage.java:506)
    at com.sybase.jdbc2.jdbc.SybStatement.queryLoop(SybStatement.java:1552)
    at com.sybase.jdbc2.jdbc.SybStatement.executeQuery(SybStatement.java:1522)
    at com.sybase.jdbc2.jdbc.SybCallableStatement.executeQuery(SybCallableStatement.java:76)
    but when i execute the same procedure in sybase it returns some result but i know its not in resultset format .I want to know is anyone experienced same problem in their side.
    My question is how to obtain the result which is not in the format result set obtained by executing the stored procedure.
    Thanks n advance
    work machine

    Check this post out:
    http://forum.java.sun.com/thread.jspa?threadID=638768&messageID=3785982
    But I think you should be getting results right? What do you mean you want it in a format other than resultset?

  • Problem calling Stored Procedure returning SETOF UDT (Using Spring)

    I am using Spring's StoredProcedure class to call a stored procedure from a PostgreSql database. It returns a set of user defined data types. I'm having a problem in parsing the results returned.
    The user defined data type :
    CREATE TYPE process_states AS (
    process_name text,
    process_type text
    The stored procedure returns a SET of "process_state" :
    CREATE FUNTION inquire_process_state (.....)
    RETURNS SETOF process_state AS '
    SELECT ....
    I hava a Java class extending the Spring StoredProcedure classs.
    public MyProcStats extends StoredProcedure {
    private class ProcStateCallBackHandler implements RowCallBackHandler {
    public void processRow(ResultSet rs) throws SQLException {
    System.out.println(rs.getString(1));
    public MyProcStats (DataSource ds) {
    super(ds, "inquire_process_state");
    super.setFunction(true);
    declareParameter(new SqlOutparameter("rs", Types.OTHER, new ProcStateCallBackHandler());
    declareParameter(new SqlParameter("family_name", Types.VARCHAR) ;
    While testing this class, I get an errormessage
    "java.sql.SQLException:ERROR: cannot display a value of type record"
    I would appreciate if anyone can point out my mistakes. I tried declaring
    new SqlOutParameter("rs", Types.OTHER, "process_state"), but that didn't help.

    As the related posts suggest, you will need to use direct JDBC code for this.
    Also I'm not sure JDBC supports the RECORD type, so you may need to wrap your stored functions with ones that either flatten the record out, or take OBJECT types.

  • Issue in Calling PL/SQL packages using callable statement

    Hi ,
    I have the requirement of calling two pl/sql packages , After call of first package is successful , i need to pass the output of that first package as input to second package.
    Since i have called both the packages in same method of AM, first package gets executed successfully but second package doesnt get the input values required from first package and results in error.
    Looks like since commit is happening in the single session second package is passed with NULL values.
    Need suggestion for proper way of calling pl/sql packages when second package is dependant on first one:
    Code used inside AM Method:
    if("PENDING_XXX".equals(regVORow.getRegStatus()))
    regVORow.setRegStatus("VENDOR_CREATED");
    getOADBTransaction().commit();
    OracleCallableStatement cStmt = null;
    OADBTransaction dbTxn = getOADBTransaction();
    NUMBER vendor_id = new NUMBER(-1);
    NUMBER vendor_site_id = new NUMBER(-1);
    int vendor_id_value = -2000;
    String vendor_number = null;
    try
    cStmt = (OracleCallableStatement)dbTxn.createCallableStatement("begin *XXB_POS_PVT.create_vendo*r( p_vendor_name => :1, p_supplier_reg_id => :2, p_vendor_id=>:3); end;", 1);
    cStmt.setString(1, regVORow.getSupplierName());
    cStmt.setNUMBER(2, new Number(Integer.parseInt(supplierId)));
    cStmt.registerOutParameter(3, 4);
    cStmt.execute();
    vendor_id = cStmt.getNUMBER(3);
    vendor_id_value = vendor_id.intValue();
    catch(SQLException e)
    throw new OAException(e.getMessage());
    Number vendorId = new Number(vendor_id_value);
    regVORow.setVendorId(vendorId);
    if(vendorId != null)
    vendor_number = getSupplierVendorNumber(vendorId);
    getOADBTransaction().commit();
    AsiPosSupplierOpCosVOImpl regOpCosVO = (AsiPosSupplierOpCosVOImpl)this.getAsiPosSupplierOpCosVO1();
    AsiPosSupplierOpCosVORowImpl row = null;
    int fetchedRowCount = regOpCosVO.getFetchedRowCount();
    RowSetIterator createIter1 = regOpCosVO.createRowSetIterator("createIter1");
    if(fetchedRowCount > 0)
    createIter1.setRangeStart(0);
    createIter1.setRangeSize(fetchedRowCount);
    for(int i = 0; i < fetchedRowCount; i++)
    row = (AsiPosSupplierOpCosVORowImpl)createIter1.getRowAtRangeIndex(i);
    if(row.getApprovalStatus().equalsIgnoreCase("HEAD_APPROVED"))
    try
    oadbtransactionimpl.writeDiagnostics(this,"Creating Site - " + vendor_id_value+" "+row.getSupplierOpcoCode()+" "+supplierId,1);
    cStmt = (OracleCallableStatement)dbTxn.createCallableStatement("begin *XXB_POS_PVT.create_vendor_sites*(p_supplier_reg_id => :1, p_vendor_id=>:2, p_opco_code=>:3, p_vendor_site_id=>:4); end;", 1);
    cStmt.setNUMBER(1, new Number(Integer.parseInt(supplierId)));
    cStmt.setNUMBER(2, new Number(vendor_id_value));
    cStmt.setString(3,row.getSupplierOpcoCode());
    cStmt.registerOutParameter(4, 4);
    cStmt.execute();
    vendor_site_id = cStmt.getNUMBER(4);
    getOADBTransaction().commit();                                    
    catch(SQLException e)
    throw new OAException(e.getMessage());
    createIter1.closeRowSetIterator();

    Hi ,
    There are some validation that can be performed from Entity level ( EO ) , you can go through them in Jdev guide .
    It depends on the business requirement , not all validation can be performed from Entity level .
    Let us know your business requirement , will try to clear your doubt .
    --Keerthi                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Problem with using Callable Statements via JDBC/JSP

    Hi Pals,I have this scenario;
    If a stored procedure has being created for me on Oracle database and i need
    to execute the stored procedure via my JSP ,where i capture some parameters in
    my JSP,send this parameters to the Stored Procedure . Then the Stored procedure decides if its an Update or Insert depending on the PL/SQL(Stored Procedure) code on database.
    How do i go about this using The CallableStatement java API and obviously JDBC.
    All suggestions will be appreciated and codes as well.
    Cheers.

    This is a basic question about how a CallableStatement works in JDBC. Read the documentation on CallableStatement in the JDK. If you are having trouble understanding something in the JDK, come back here and ask a specific question.

  • ArrayIndexOutOfBoundException when using Callable Statement in Weblogic 8.1

    Hi all,
    We recently ported our application from 6.1 to 8.1.
    I have noticed the following exception in 8.1 (which was working fine in 6.1)
    java.lang.ArrayIndexOutOfBoundsException: 7
    [ERROR] nfusion.admin.UpdateBureauLogin.5 131575 2003-10-15 16:21:58,385 Exception
    caught
    java.lang.ArrayIndexOutOfBoundsException: 7
    at oracle.jdbc.dbaccess.DBDataSetImpl._getDBItem(DBDataSetImpl.java:303)
    at oracle.jdbc.dbaccess.DBDataSetImpl._createOrGetDBItem(DBDataSetImpl.java:542)
    at oracle.jdbc.dbaccess.DBDataSetImpl.setBytesBindItem(DBDataSetImpl.java:1642)
    at oracle.jdbc.driver.OraclePreparedStatement.setItem(OraclePreparedStatement.java:745)
    at oracle.jdbc.driver.OraclePreparedStatement.setString(OraclePreparedStatement.java:1083)
    at weblogic.jdbc.wrapper.PreparedStatement.setString(PreparedStatement.java:415)
    at com.ecredit.nfusion.businessobject.bureau.dao.DefaultBureauLoginDao.store(DefaultBureauLoginDao.java:200)
    at com.ecredit.nfusion.businessobject.bureau.BureauManagerBean.updateBureauLogins(BureauManagerBean.java:940)
    at com.ecredit.nfusion.businessobject.bureau.BureauManagerBean.setDetails(BureauManagerBean.java:424)
    at com.ecredit.nfusion.businessobject.bureau.BureauManagerBean_lptk9u_EOImpl.setDetails(BureauManagerBean_lptk9u_EOImpl.java:46)
    at com.ecredit.nfusion.businessservice.admin.UpdateBureauLoginHandler.execute(UpdateBureauLoginHandler.java:73)
    at com.ecredit.nfusion.platform.requestproxy.RequestProxyBean.execute(RequestProxyBean.java:155)
    at com.ecredit.nfusion.platform.requestproxy.RequestProxyBean_vc5299_EOImpl.execute(RequestProxyBean_vc5299_EOImpl.java:46)
    at com.ecredit.nfusion.platform.requestdelegate.AbstractRequestDelegate.invokeProxy(AbstractRequestDelegate.java:135)
    at com.ecredit.nfusion.platform.requestdelegate.HTMLRequestDelegate.execute(HTMLRequestDelegate.java:240)
    at com.ecredit.nfusion.platform.inboundadapter.HTTPInboundAdapter.service(HTTPInboundAdapter.java:184)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(ServletStubImpl.java:1053)
    at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:387)
    at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:305)
    at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:6291)
    at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:317)
    at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:97)
    at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:3575)
    at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2573)
    at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:178)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:151)
    I am not able to figure out why this is happening in WL 8.1 and is working fine
    in 6.1.
    We are using Oracle 8.1.7 database. I have downloaded the thin driver for 8.1.7
    (classes12.zip) and have included it before the weblogic jar files (in the startWeblogic.sh
    file).
    Any help would be greatly appreciated.
    Regards,
    -Rajan

    Rajan Desai wrote:
    I already have classes12.zip for Oracle 8.1.7 in my class path (before weblogic.jar
    file).
    Inspite of that it is giving this error.
    Any other suggestion to resolve this problem?Yes, but just to be sure, would you show us the first 20 or so lines of the server log?
    It should have a line describing the actual java command that starts the server, including
    the class path that the startup script assembles for this line.
    Thanks,
    Joe
    >
    >
    -RD
    Mitesh Patel <[email protected]> wrote:
    In 8.1, default oracle thin driver is changed from 817 to 920. This might
    be bug in new oracle driver.
    Please put classes12.zip file from oracle 817 version, that might resolve
    your problem.
    Thanks,
    Mitesh
    Rajan Desai wrote:
    Hi all,
    We recently ported our application from 6.1 to 8.1.
    I have noticed the following exception in 8.1 (which was working finein 6.1)
    java.lang.ArrayIndexOutOfBoundsException: 7
    [ERROR] nfusion.admin.UpdateBureauLogin.5 131575 2003-10-15 16:21:58,385Exception
    caught
    java.lang.ArrayIndexOutOfBoundsException: 7
    at oracle.jdbc.dbaccess.DBDataSetImpl._getDBItem(DBDataSetImpl.java:303)
    at oracle.jdbc.dbaccess.DBDataSetImpl._createOrGetDBItem(DBDataSetImpl.java:542)
    at oracle.jdbc.dbaccess.DBDataSetImpl.setBytesBindItem(DBDataSetImpl.java:1642)
    at oracle.jdbc.driver.OraclePreparedStatement.setItem(OraclePreparedStatement.java:745)
    at oracle.jdbc.driver.OraclePreparedStatement.setString(OraclePreparedStatement.java:1083)
    at weblogic.jdbc.wrapper.PreparedStatement.setString(PreparedStatement.java:415)
    at com.ecredit.nfusion.businessobject.bureau.dao.DefaultBureauLoginDao.store(DefaultBureauLoginDao.java:200)
    at com.ecredit.nfusion.businessobject.bureau.BureauManagerBean.updateBureauLogins(BureauManagerBean.java:940)
    at com.ecredit.nfusion.businessobject.bureau.BureauManagerBean.setDetails(BureauManagerBean.java:424)
    at com.ecredit.nfusion.businessobject.bureau.BureauManagerBean_lptk9u_EOImpl.setDetails(BureauManagerBean_lptk9u_EOImpl.java:46)
    at com.ecredit.nfusion.businessservice.admin.UpdateBureauLoginHandler.execute(UpdateBureauLoginHandler.java:73)
    at com.ecredit.nfusion.platform.requestproxy.RequestProxyBean.execute(RequestProxyBean.java:155)
    at com.ecredit.nfusion.platform.requestproxy.RequestProxyBean_vc5299_EOImpl.execute(RequestProxyBean_vc5299_EOImpl.java:46)
    at com.ecredit.nfusion.platform.requestdelegate.AbstractRequestDelegate.invokeProxy(AbstractRequestDelegate.java:135)
    at com.ecredit.nfusion.platform.requestdelegate.HTMLRequestDelegate.execute(HTMLRequestDelegate.java:240)
    at com.ecredit.nfusion.platform.inboundadapter.HTTPInboundAdapter.service(HTTPInboundAdapter.java:184)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(ServletStubImpl.java:1053)
    at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:387)
    at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:305)
    at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:6291)
    at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:317)
    at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:97)
    at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:3575)
    at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2573)
    at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:178)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:151)
    I am not able to figure out why this is happening in WL 8.1 and isworking fine
    in 6.1.
    We are using Oracle 8.1.7 database. I have downloaded the thin driverfor 8.1.7
    (classes12.zip) and have included it before the weblogic jar files(in the startWeblogic.sh
    file).
    Any help would be greatly appreciated.
    Regards,
    -Rajan

  • How to pass a array of object to oracle procedure using callable

    Hi,
    I am calling a oracle stored procedure using callable statement which has IN and OUT parameter of same type.
    IN and OUT are array of objects. (ie) IN parameter as Array of Objects and OUT parameter as Array of Objects
    here are the steps i have done as advised from oracle forum. correct me if i am in wrong direction
    ORACLE types and Stored Procedure
    CREATE OR REPLACE
    TYPE APPS.DEPARTMENT_TYPE AS OBJECT (
    DNO NUMBER (10),
    NAME VARCHAR2 (50),
    LOCATION VARCHAR2 (50)
    CREATE OR REPLACE
    TYPE APPS.DEPT_ARRAY AS TABLE OF department_type;
    CREATE OR REPLACE package body APPS.insert_object
    IS
    PROCEDURE insert_object_prc (d IN dept_array, d2 OUT dept_array)
    IS
    BEGIN
    d2 := dept_array ();
    FOR j IN 1 .. d.COUNT
    LOOP
    d2.EXTEND;
    d2 (j) := department_type (d (j).dno, d (j).name, d(j).location);
    END LOOP;
    END insert_object_prc;
    END insert_object;
    JAVA CODE
    Value Object
    package com.custom.vo;
    public class Dep {
    public int empNo;
    public String depName;
    public String location;
    public int getEmpNo() {
    return empNo;
    public void setEmpNo(int empNo) {
    this.empNo = empNo;
    public String getDepName() {
    return depName;
    public void setDepName(String depName) {
    this.depName = depName;
    public String getLocation() {
    return location;
    public void setLocation(String location) {
    this.location = location;
    to call stored procedure
    package com.custom.callable;
    import com.custom.vo.Dep;
    import oracle.jdbc.OracleCallableStatement;
    import oracle.jdbc.OracleConnection;
    import oracle.jdbc.OracleTypes;
    import oracle.jdbc.pool.OracleDataSource;
    import oracle.sql.ARRAY;
    import oracle.sql.ArrayDescriptor;
    import oracle.sql.Datum;
    import oracle.sql.STRUCT;
    import oracle.sql.StructDescriptor;
    public class CallableArrayTryOut {
    private static OracleDataSource odcDataSource = null;
    public static void main(String[] args) {
    OracleCallableStatement callStatement = null;
    OracleConnection connection = null;
    try {
    odcDataSource = new OracleDataSource();
    odcDataSource
    .setURL("......");
    odcDataSource.setUser("....");
    odcDataSource.setPassword("....");
    connection = (OracleConnection) odcDataSource.getConnection();
    } catch (Exception e) {
    System.out.println("DB connection Exception");
    e.printStackTrace();
    Dep[] dep = new Dep[2];
    dep[0] = new Dep();
    dep[0].setEmpNo(100);
    dep[0].setDepName("aaa");
    dep[0].setLocation("xxx");
    dep[1] = new Dep();
    dep[1].setEmpNo(200);
    dep[1].setDepName("bbb");
    dep[1].setLocation("yyy");
    try {
    StructDescriptor structDescriptor = new StructDescriptor(
    "APPS.DEPARTMENT_TYPE", connection);
    STRUCT priceStruct = new STRUCT(structDescriptor, connection, dep);
    STRUCT[] priceArray = { priceStruct };
    ArrayDescriptor arrayDescriptor = ArrayDescriptor.createDescriptor(
    "APPS.DEPT_ARRAY", connection);
    ARRAY array = new ARRAY(arrayDescriptor, connection, priceArray);
    callStatement = (OracleCallableStatement) connection
    .prepareCall("{call insert_object.insert_object_prc(?,?)}");
    ((OracleCallableStatement) callStatement).setArray(1, array);
    callStatement.registerOutParameter(2, OracleTypes.ARRAY,
    "APPS.DEPT_ARRAY");
    callStatement.execute();
    ARRAY outArray = callStatement.getARRAY(2);
    Datum[] datum = outArray.getOracleArray();
    for (int i = 0; i < datum.length; i++) {
    oracle.sql.STRUCT os = (oracle.sql.STRUCT) datum[0];
    Object[] a = os.getAttributes();
    for (int j = 0; j < a.length; j++) {
    System.out.print("Java Data Type :"
    + a[j].getClass().getName() + "Value :" + a[j]
    + "\n");
    connection.commit();
    callStatement.close();
    } catch (Exception e) {
    System.out.println("Mapping Error");
    e.printStackTrace();
    THE ERROR
    Mapping Errorjava.sql.SQLException: Inconsistent java and sql object types
    at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134)
    at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:179)
    at oracle.jdbc.dbaccess.DBError.check_error(DBError.java:1130)
    at oracle.sql.StructDescriptor.toOracleArray(StructDescriptor.java:823)
    at oracle.sql.StructDescriptor.toArray(StructDescriptor.java:1735)
    at oracle.sql.STRUCT.<init>(STRUCT.java:136)
    at com.custom.callable.CallableArrayTryOut.main(CallableArrayTryOut.java:48)

    You posted this question in the wrong forum section. There is one dedicated to Java that was more appropriate.
    Anyway here is a link that describes what you should do.
    http://download.oracle.com/docs/cd/B19306_01/java.102/b14355/oraarr.htm#i1049179
    Bye Alessandro

  • Function call in Callable statement

    Hi,
    I have a function in pl/sql.
    Am trying to use that using callable statement.
    How to fetch the return value of the function?
    Moreover, is it a good practise to use the function or is there
    any other way in OAF
    Thank you.
    kumar

    This would help.
    Re: calling funcntions from OA Framework
    Thanks
    Tapash

Maybe you are looking for

  • Dump : COMPUTE_INT_PLUS_OVERFLOW

    Hi experts, I am getting a dump COMPUTE_INT_PLUS_OVERFLOW in a report. its at the line: z1 = z1 + z1. Dump says: "Using + or 'ADD' to add the values 2060095488 and 2060095488 resulted in a value greater than 2147483647 or samller than -2147483648. Th

  • Sun One / Win ME / Mandrake Linux

    Okay, this is driving me nuts. I am running Windows ME on one partition on my box. I used to have forte installed a while ago, btu for some reason I got rid of it. Now I am doing something that I would like to use it as a resource for and I come to f

  • Application Server 10g r2 (Replication)

    Hello All, We are planning to migrate from single instance DB to RAC in a few days, As far as my DB server is concerned once oracle clusterware is installed and configured my DB should failover to next node in case of any failures, but how do i make

  • ITunes 11.4 stops working. What do I do

    I have Win7 The update 11.4 stopps after 10secs I have worked thru the diagnostics suggested in iTunes for Windows Vista, Windows 7, or Windows Languages English 8: Fix unexpected quits or launch issues and iin iTunes: Troubleshooting issues with thi

  • Where is my copy of Project?

    I thought that I had installed a 60 day evaluation copy of Project on my Windows 8.1 PC this morning, but although a message said that the download had completed, I can find no trace of the files on my PC at all. There are no icons on the Metro scree