Registering boolean Out parameter

Hi all,
Im trying to register a boolean out parameter in a callable statement. I went through a thread which said boolean types are not supported by JDBC. Is it the same case with my scenario?
Thanks.

If your attribute is defined as Boolean, you should be able to use oracle callablablestatement as follows... oraclecallablestatement.setBoolean(12,getAttribute());
Here's some sample code from my EO. Is your syntax similar?
public class AcctMapEOImpl extends  OAPlsqlEntityImpl
public void insertRow()
try
OADBTransactionImpl oadbtransactionimpl = (OADBTransactionImpl)getDBTransaction();
String s = "begin spl_jdev_api_account_map.spl_create_acct(p_cont_cd=>:1,p_consolidate_cd=>:2,     p_customer=>:3,p_req_asn=>:4,     p_sonic_label=>:5,p_req_conversion_date=>:6,p_override_asn=>:7,p_vendor_name=>:8,p_building =>:9,p_revision =>:10,     p_acct_lookup_use_whse_flag =>:11,p_asn_under_rcpt_tolerance=>:12,p_asn_over_rcpt_tolerance=>:13,p_created_by=>:14,p_creation_date=>:15,p_last_updated_by=>:16,p_last_update_date=>:17,p_cancel_asn_yn=>:18,";
String t = "p_use_flex_valueset=>:19,p_po_asn_yn=>:20,p_prepaid_ups_flag=>:21,p_eia_label=>:22,p_exe_flag=>:23,p_header_label_template=>:24,p_line_label_template=>:25,p_all_lpns=>:26,p_internal_asn=>:27,p_print_pickslip =>:28,p_replace_asn_flag =>:29,p_get_line_ref_flag=>:30,p_commercial_inv_flag=>:31,p_req_asn_search =>:32,p_asn_ship_days =>:33,p_asn_receipt_days=>:34,p_asn_creation_days =>:35,p_asn_conversion_flag =>:36,p_min_shelf_life_days=>:37,p_restrict_expired_pick =>:38,";
String u = "p_ars_rules=>:39,p_restock_ord_tgt_oms=>:40,p_attribute_category =>:41,p_attribute1 =>:42,p_attribute2 =>:43,p_attribute3 =>:44,p_attribute4 =>:45,p_attribute5=>:46,p_attribute6=>:47,p_attribute7 =>:48,p_attribute8=>:49,p_attribute9=>:50,p_attribute10=>:51,p_attribute11 =>:52,p_attribute12 =>:53,p_attribute13 =>:54,p_attribute14 =>:55,p_attribute15 =>:56,p_header_label_template1 => :57,p_header_label_template2 =>:58,p_header_label_template3 => :59,";
String v = "p_header_label_template4 => :60,p_header_label_template5 =>:61,p_header_label_template6 => :62,p_header_label_template7 => :63,p_header_label_template8 =>:64,p_header_label_template9 => :65,p_header_label_template10 => :66,p_header_label_template11 =>:67,p_header_label_template12 => :68,p_header_label_template13 => :69,p_header_label_template14 =>:70,p_header_label_template15 => :71,p_line_label_template1 => :72,p_line_label_template2 => :73," ;
String w = "p_line_label_template3 => :74,p_line_label_template4 => :75,p_line_label_template5 => :76,p_line_label_template6 => :77,p_line_label_template7 => :78,p_line_label_template8 => :79,p_line_label_template9 => :80,p_line_label_template10 => :81,p_line_label_template11 => :82,p_line_label_template12 => :83,p_line_label_template13 => :84,p_line_label_template14 => :85,p_line_label_template15 => :86); end;";
String x = (s+t+u+v+w);
OracleCallableStatement oraclecallablestatement = (OracleCallableStatement)oadbtransactionimpl.createCallableStatement(x, -1);
oraclecallablestatement.setString(1,getContCd());
oraclecallablestatement.setString(2,getConsolidateCd());
oraclecallablestatement.setString(3,getCustomer());
oraclecallablestatement.setString(4,getReqAsn());
oraclecallablestatement.setString(5,getSonicLabel());
oraclecallablestatement.setDATE(6,getReqConversionDate());
oraclecallablestatement.setString(7,getOverrideAsn());
oraclecallablestatement.setString(8,getVendorName());
oraclecallablestatement.setString(9,getBuilding());
oraclecallablestatement.setString(10,getRevision());
oraclecallablestatement.setString(11,getAcctLookupUseWhseFlag());
oraclecallablestatement.setNUMBER(12,getAsnUnderRcptTolerance());
oraclecallablestatement.setNUMBER(13,getAsnOverRcptTolerance());
oraclecallablestatement.setNUMBER(14,getCreatedBy());
oraclecallablestatement.setDATE(15,getCreationDate());
oraclecallablestatement.setNUMBER(16,getLastUpdatedBy());
oraclecallablestatement.setDATE(17,getLastUpdateDate());
oraclecallablestatement.setString(18,getCancelAsnYn());
oraclecallablestatement.setString(19,getUseFlexValueset());
oraclecallablestatement.setString(20,getPoAsnYn());
oraclecallablestatement.setString(21,getPrepaidUpsFlag());
oraclecallablestatement.setString(22,getEiaLabel());
oraclecallablestatement.setString(23,getExeFlag());
oraclecallablestatement.setString(24,getHeaderLabelTemplate());
oraclecallablestatement.setString(25,getLineLabelTemplate());
oraclecallablestatement.setString(26,getAllLpns());
oraclecallablestatement.setString(27,getInternalAsn());
oraclecallablestatement.setString(28,getPrintPickslip());
oraclecallablestatement.setString(29,getReplaceAsnFlag());
oraclecallablestatement.setString(30,getGetLineRefFlag());
oraclecallablestatement.setString(31,getCommercialInvFlag());
oraclecallablestatement.setString(32,getReqAsnSearch());
oraclecallablestatement.setNUMBER(33,getAsnShipDays());
oraclecallablestatement.setNUMBER(34,getAsnReceiptDays());
oraclecallablestatement.setNUMBER(35,getAsnCreationDays());
oraclecallablestatement.setString(36,getAsnConversionFlag());
oraclecallablestatement.setNUMBER(37,getMinShelfLifeDays());
oraclecallablestatement.setString(38,getRestrictExpiredPick());
oraclecallablestatement.setString(39,getArsRules());
oraclecallablestatement.setString(40,getRestockOrdTgtOms());
oraclecallablestatement.setString(41,getAttributeCategory());
oraclecallablestatement.setString(42,getAttribute1());
oraclecallablestatement.setString(43,getAttribute2());
oraclecallablestatement.setString(44,getAttribute3());
oraclecallablestatement.setString(45,getAttribute4());
oraclecallablestatement.setString(46,getAttribute5());
oraclecallablestatement.setString(47,getAttribute6());
oraclecallablestatement.setString(48,getAttribute7());
oraclecallablestatement.setString(49,getAttribute8());
oraclecallablestatement.setString(50,getAttribute9());
oraclecallablestatement.setString(51,getAttribute10());
oraclecallablestatement.setString(52,getAttribute11());
oraclecallablestatement.setString(53,getAttribute12());
oraclecallablestatement.setString(54,getAttribute13());
oraclecallablestatement.setString(55,getAttribute14());
oraclecallablestatement.setString(56,getAttribute15());
oraclecallablestatement.setString(57,getReferencename1());
oraclecallablestatement.setString(58,getReferencename2());
oraclecallablestatement.setString(59,getReferencename3());
oraclecallablestatement.setString(60,getReferencename4());
oraclecallablestatement.setString(61,getReferencename5());
oraclecallablestatement.setString(62,getReferencename6());
oraclecallablestatement.setString(63,getReferencename7());
oraclecallablestatement.setString(64,getReferencename8());
oraclecallablestatement.setString(65,getReferencename9());
oraclecallablestatement.setString(66,getReferencename10());
oraclecallablestatement.setString(67,getReferencename11());
oraclecallablestatement.setString(68,getReferencename12());
oraclecallablestatement.setString(69,getReferencename13());
oraclecallablestatement.setString(70,getReferencename14());
oraclecallablestatement.setString(71,getReferencename15());
oraclecallablestatement.setString(72,getLnrefname1());
oraclecallablestatement.setString(73,getLnrefname2());
oraclecallablestatement.setString(74,getLnrefname3());
oraclecallablestatement.setString(75,getLnrefname4());
oraclecallablestatement.setString(76,getLnrefname5());
oraclecallablestatement.setString(77,getLnrefname6());
oraclecallablestatement.setString(78,getLnrefname7());
oraclecallablestatement.setString(79,getLnrefname8());
oraclecallablestatement.setString(80,getLnrefname9());
oraclecallablestatement.setString(81,getLnrefname10());
oraclecallablestatement.setString(82,getLnrefname11());
oraclecallablestatement.setString(83,getLnrefname12());
oraclecallablestatement.setString(84,getLnrefname13());
oraclecallablestatement.setString(85,getLnrefname14());
oraclecallablestatement.setString(86,getLnrefname15());
oraclecallablestatement.execute();
catch(SQLException sqlexception)
throw OAException.wrapperException(sqlexception);
catch(Exception exception)
throw OAException.wrapperException(exception);
}

Similar Messages

  • Registering the out parameter

    how to register an out parameter in java which is of %rowtype in pl/sql procedure

    Hi,
    Which version of Weblogic and JDBC driver do you use?
    Regards,
    Slava Imeshev
    "chaat" <[email protected]> wrote in message
    news:3c02da3a$[email protected]..
    >
    Hi,
    I'm using weblogic-jdriver driver, on Invoking a stored procedure(which
    returns a Record) by registering the OUT parameter as
    callableStatement.registerOutParameter(1, Types.ARRAY);
    the code compiles, @run time gives the following exception..
    java.sql.SQLException: Unknown type: 2003
    Exception Object info ==>[[The error code = 0 and  sql state = null ]].
    Any insights are greatly appreciated.

  • Cursor bound to out parameter with Connection Pool

    Is it possible to retrieve a cursor bound to an out parameter when using the thin
    driver to establish the connection pool to the database? I am currently using
    the JDriver to connect create the pool and the pool driver to connect from the
    app to the connection pool. We'd like to avoid using the Oracle client if possible.
    Currently I register the out parameter as java.sql.Types.OTHER, then call getResultSet(1)
    on the weblogic.jdbc.pool.CallableStatement object. But it breaks when I change
    the connection pool to use the thin driver. The error is at the bottom of this
    post.
    I think I could possibly get the current pool driver to work if can find some
    documentation on these two methods:
    void registerOutParameter(int i, int j, int k, int l)
    void registerOutParameter(int i, int sqlType, java.lang.String typeName)
    I have no idea what to put in for the ints in the first method or for sqlType
    or typeName. Can anyone point me to where I can find this documentation?
    E-docs mentions this class: weblogic.jdbc.vendor.oracle.OracleCallableStatement.
    (http://edocs.bea.com/wls/docs61/jdbc/thirdparty.html#1023867). Should I consider
    this? If so where is it?
    Thanks a lot,
    Matt Savino
    <<< error when using thin driver >>>
    preparing callable stmt
    callable stmt prepared, java.sql.Types.OTHER = 1111
    java.sql.SQLException: Invalid column type
    at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:168)
    at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:210)
    at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:273)
    at oracle.jdbc.driver.OracleStatement.get_internal_type(OracleStatement.java:4560)
    at oracle.jdbc.driver.OracleCallableStatement.registerOutParameter(OracleCallableStatement.java:225)
    at oracle.jdbc.driver.OracleCallableStatement.registerOutParameter(OracleCallableStatement.java:350)
    at weblogic.jdbc.pool.Statement.registerOutParameter(Statement.java:617)
    at jsp_servlet._reportmanager.__thin_outputresultset._jspService(__thin_outputresultset.java:145)
    at weblogic.servlet.jsp.JspBase.service(JspBase.java:27)
    at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:263)
    at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:200)
    at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:2390)
    at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:1959)
    at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:137)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)

    Thanks Joe, your answer pointed me in the right direction. Just in case anyone
    wants to know, the solution took two changes:
    CHANGE
    cStat.registerOutParameter(1, java.sql.Types.OTHER);
    TO
    cStat.registerOutParameter(1, oracle.jdbc.driver.OracleTypes.CURSOR);
    (cStat is an instance of weblogic.jdbc.pool.CallableStatement)
    AND
    rs = cStat.getResultSet(1);
    TO
    rs = cStat.getCursor(1);
    Thanks again,
    Matt
    Joseph Weinstein <[email protected]> wrote:
    Hi Matt.
    Look at the Oracle thin driver documentation to determine what type you
    should define in the registerOutParameter call. We use 'OTHER', but
    their driver may use something else for CURSOR output parameters.
    joe
    Matt Savino wrote:
    Is it possible to retrieve a cursor bound to an out parameter whenusing the thin
    driver to establish the connection pool to the database? I am currentlyusing
    the JDriver to connect create the pool and the pool driver to connectfrom the
    app to the connection pool. We'd like to avoid using the Oracle clientif possible.
    Currently I register the out parameter as java.sql.Types.OTHER, thencall getResultSet(1)
    on the weblogic.jdbc.pool.CallableStatement object. But it breaks whenI change
    the connection pool to use the thin driver. The error is at the bottomof this
    post.
    I think I could possibly get the current pool driver to work if canfind some
    documentation on these two methods:
    void registerOutParameter(int i, int j, int k, int l)
    void registerOutParameter(int i, int sqlType, java.lang.String typeName)
    I have no idea what to put in for the ints in the first method or forsqlType
    or typeName. Can anyone point me to where I can find this documentation?
    E-docs mentions this class: weblogic.jdbc.vendor.oracle.OracleCallableStatement.
    (http://edocs.bea.com/wls/docs61/jdbc/thirdparty.html#1023867). Should
    I consider
    this? If so where is it?
    Thanks a lot,
    Matt Savino
    <<< error when using thin driver >>>
    preparing callable stmt
    callable stmt prepared, java.sql.Types.OTHER = 1111
    java.sql.SQLException: Invalid column type
    at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:168)
    at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:210)
    at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:273)
    at oracle.jdbc.driver.OracleStatement.get_internal_type(OracleStatement.java:4560)
    at oracle.jdbc.driver.OracleCallableStatement.registerOutParameter(OracleCallableStatement.java:225)
    at oracle.jdbc.driver.OracleCallableStatement.registerOutParameter(OracleCallableStatement.java:350)
    at weblogic.jdbc.pool.Statement.registerOutParameter(Statement.java:617)
    at jsp_servlet._reportmanager.__thin_outputresultset._jspService(__thin_outputresultset.java:145)
    at weblogic.servlet.jsp.JspBase.service(JspBase.java:27)
    at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:263)
    at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:200)
    at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:2390)
    at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:1959)
    at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:137)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
    PS: Folks: BEA WebLogic is expanding rapidly, with both entry and advanced
    positions
    for people who want to work with Java, XML, SOAP and E-Commerce infrastructure
    products.
    We have jobs at Nashua NH, Liberty Corner NJ, San Francisco and San Jose
    CA.
    Send resumes to [email protected]

  • ORABPEL-11809 - call a stored procedure - error in OUT parameter

    Hi all.
    I have a problem in a BPEL process that calls a stored procedure.
    I create a Partner Link that calls a stored procedure in the database. That procedure returns a type that is a table (is defined as a type of the database).
    When I deploy the process I have the following error:
    <messages>
    - <input>
    - <WC01_Pesquisa_Ut_InputVariable>
    - <part xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="InputParameters">
    - <InputParameters xmlns="http://xmlns.oracle.com/pcbpel/adapter/db/IGIF/WC01/PESQUISA_UT/">
    <P_NIR xmlns="">
    165968274
    </P_NIR>
    <P_NOME_COMPLETO xmlns="">
    carla diogo
    </P_NOME_COMPLETO>
    <P_SEXO xmlns="">
    Feminino
    </P_SEXO>
    <P_DATA_NASC xmlns="">
    2007-03-01
    </P_DATA_NASC>
    <P_NATURALIDADE xmlns=""/>
    </InputParameters>
    </part>
    </WC01_Pesquisa_Ut_InputVariable>
    </input>
    - <fault>
    - <remoteFault xmlns="http://schemas.oracle.com/bpel/extension">
    - <part name="code">
    <code>
    17002
    </code>
    </part>
    - <part name="summary">
    <summary>
    file:/oracle/product/10.1.3/SOA/Integration10131/bpel/domains/default/tmp/.bpel_SaudeIdentificarCidadao_5.0_e3768f57d137443e1ba52d4a6d809426.tmp/WC01_Pesquisa_Ut.wsdl [ WC01_Pesquisa_Ut_ptt::WC01_Pesquisa_Ut(InputParameters,OutputParameters) ] - WSIF JCA Execute of operation 'WC01_Pesquisa_Ut' failed due to: Error registering an out parameter.
    An error occurred when registering parameter PESQUISA_UT as an out parameter of the IGIF.WC01.PESQUISA_UT API. Cause: java.sql.SQLException: Io exception: Connection reset [Caused by: Io exception: Connection reset]
    ; nested exception is:
         ORABPEL-11809
    Error registering an out parameter.
    An error occurred when registering parameter PESQUISA_UT as an out parameter of the IGIF.WC01.PESQUISA_UT API. Cause: java.sql.SQLException: Io exception: Connection reset [Caused by: Io exception: Connection reset]
    Check to ensure that the parameter is a valid IN/OUT or OUT parameter of the API. Contact oracle support if error is not fixable.
    </summary>
    </part>
    - <part name="detail">
    <detail>
    Internal Exception: java.sql.SQLException: Io exception: Connection resetError Code: 17002
    </detail>
    </part>
    </remoteFault>
    </fault>
    </messages>
    The code of the XSD created when I create the partner link is:
    <schema targetNamespace="http://xmlns.oracle.com/pcbpel/adapter/db/IGIF/WC01/PESQUISA_UT/" xmlns="http://www.w3.org/2001/XMLSchema" xmlns:db="http://xmlns.oracle.com/pcbpel/adapter/db/IGIF/WC01/PESQUISA_UT/"
    elementFormDefault="unqualified" attributeFormDefault="unqualified">
    <element name="InputParameters">
    <complexType>
    <sequence>
    <element name="P_NIR" type="decimal" db:index="1" db:type="NUMBER" minOccurs="0" nillable="true"/>
    <element name="P_NOME_COMPLETO" type="string" db:index="2" db:type="VARCHAR2" minOccurs="0" nillable="true"/>
    <element name="P_SEXO" type="string" db:index="3" db:type="VARCHAR2" minOccurs="0" nillable="true"/>
    <element name="P_DATA_NASC" type="dateTime" db:index="4" db:type="DATE" minOccurs="0" nillable="true"/>
    <element name="P_NATURALIDADE" type="string" db:index="5" db:type="VARCHAR2" minOccurs="0" nillable="true"/>
    </sequence>
    </complexType>
    </element>
    <element name="OutputParameters">
    <complexType>
    <sequence>
    <element name="PESQUISA_UT" type="db:TABELA_DE_IDS" db:index="0" db:type="Array" minOccurs="0" nillable="true"/>
    </sequence>
    </complexType>
    </element>
    <complexType name="TABELA_DE_IDS">
    <sequence>
    <element name="PESQUISA_UT_ITEM" type="decimal" db:type="NUMBER" minOccurs="0" maxOccurs="unbounded" nillable="true"/>
    </sequence>
    </complexType>
    </schema>
    Any ideia?
    Thanks in advance.
    Carla

    I'd suggest that you turn on xml validation on the bpel boundaries to make sure that the xml being passed to the adapter is valid. You do this by logging in to bpel console, go to Manage Domain, at the bottom of the Configuration tab, set validateXml to true.
    Then see if it is an xml validation issue - in which case you will have to fix your maps to make sure it is valid indeed.
    Assuming your XML is valid and you are still seeing this error, couple of follow up questions:
    - are you using synonyms ?
    -- note that synonyms are not supported completely by the adapter at this time.
    - could you spell out where your types/sp-pkg resides and what are you connecting as at runtime ?
    -- just to keep things simple enough to debug, i'd do everything as just one user and slowly go to a scheme that you desire.
    HTH

  • Callable statement: out parameter type issue

    Hello again.
    My question is:
    how can I register the out parameter of a callable statement so that it may contain an oracle Cursor?
    Whether I register it to Types.OTHER (Types from the java.sql package) or OracleTypes.CURSOR (OracleTypes from the oracle.jdbc.driver package) it still says :
    PLS-00382: expression is of wrong type
    when trying to execute a statement that returns a cursor.
    I am using the com.sap.portals.jdbc.oracle package for the driver and such.
    If I change to use the oracle.jdbc.driver.OracleDriver and register the out parameter to OracleTypes.CURSOR, then it works.
    Thanks in advance,
    Silviu Lipovan Oanca
    Message was edited by: Silviu Lipovan Oanca

    more detailed
    1) i have write some java code using as usual my IDE:
    public class P141_JAVABridge
    public static void execute()
    String databaseDriver = "oracle.jdbc.driver.OracleDriver";
    String databaseUrl = "jdbc:oracle:thin:@xxx:1521:orcl";
    String databaseUsername = "xxx";
    String databasePassword = "xxx";
    ods.setDriverType(databaseDriver);
    ods.setURL(databaseUrl);
    ods.setUser(databaseUsername);
    ods.setPassword(databasePassword);
    connection = ods.getConnection();
    .... some code
    map.put("custom_T",Custom_T_SQLData.class);
    CallableStatement call = connection.prepareCall("call P141(?,?)");
    call.setObject(1,inputObjectReference);
    call.registerOutParameter(2,OracleTypes.STRUCT,"custom_T");
    call.execute();
    .... some code
    2) i run this code - wooha! it works
    3) i have changed
    connection = ods.getConnection();
    to
    connection = DriverManager.getConnection("jdbc:default:connection:");
    4) compile and load class into oracle
    5) i have linked P141_JAVABridge.execute() with P141_JB
    create or replace PROCEDURE P141_JB () IS LANGUAGE JAVA NAME 'x.y.z.P141_JAVABridge.execute()';
    6) then i executed P141_JB
    SET SERVEROUTPUT ON;
    BEGIN
    ...some code
    P141_JB();
    ...some code
    END;
    and got NullPointerException at
    ((Custom_T_SQLData)call.getObject(2)).responseStatus

  • Registering a bool out parameter in callable statement

    Hi all..
    Can we register a bool type as a out parameter.in oraclecallablestatement.....
    Class definition says only char varchar long raw longraw can be registered as out parameters..
    if we cant.. what how can we capture a bool o/p from a function....please help

    user21786,
    We discussed this issue just a few days ago. Boolean is not a supported native type in oraclecallablestatement. Check the thread for workarounds.
    --Shiv                                                                                                                                                                                                                                                                                                                                                   

  • Hi i want to use boolean type in a procedure as out parameter !!

    Hi
    I need to use Boolean type as out parameter in my procedure which return true if the SELECT query in procedure returns any row otherwise it should return false
    please HELP !!

    I need to use Boolean type as out parameter in my procedure which return true if the SELECT query in procedure returns any row otherwise it should return false
    Sounds like basic PL/SQL stuff.
    What problem are you experiencing?
    Are you looking for something like this?
    create or replace procedure check_emp (p_empno in number, p_result out boolean) is
      dummy  pls_integer;
    begin
      select 1
      into dummy
      from scott.emp
      where empno = p_empno;
      p_result := true;
    exception
      when no_data_found then
        p_result := false;
    end;
    SQL> declare
      2    emp_exists  boolean;
      3  begin
      4    check_emp(7839, emp_exists);
      5    if emp_exists then
      6      dbms_output.put_line('Employee exists');
      7    else
      8      dbms_output.put_line('Employee does not exist');
      9    end if;
    10  end;
    11  /
    Employee exists
    PL/SQL procedure successfully completed

  • Cannot get OUT parameter from stored procedure

    Hi,
    I am new to stored procedure programming. I wrote a simple java stored procedure as follows:
    package fvt;
    import java.sql.*;
    import java.io.*;
    public class FVTProcedures
    extends COM.ibm.db2.app.StoredProc {
    public void addRecord(int id, String name, int status)
    throws SQLException {
    java.sql.Statement stmt = null;
    java.sql.Connection con = null;
    PrintWriter pw = null;
    try {
    status =3;
    pw = new PrintWriter(new FileWriter("c:/temp/fvtproc.txt"));
    pw.println("starting...");
    // get connection
    con =getConnection();
    pw.println("Got connection");
    stmt = con.createStatement();
    stmt.execute("INSERT INTO cmtest (id, name) values (" + id + ",'"+name+"')");
    pw.println("Inserted the record");
    if (!con.getAutoCommit()) {
    con.commit();
    pw.println("Committed the connection");
    catch (SQLException sqle) {
    pw.println(sqle.getMessage());
    catch (Exception e) {
    pw.println(e.getMessage());
    finally {
    status =2;
    pw.close();
    try {
    if (stmt != null) {
    stmt.close();
    catch (SQLException sqle) {}
    try {
    if (con != null) {
    con.close();
    catch (SQLException sqle) {}
    Then I use the following sql command to create this stored procedure, especially register status as OUT parameter.
    CREATE PROCEDURE addRecord (IN id INT, IN name VARCHAR(20), OUT status INTEGER)
    FENCED LANGUAGE JAVA EXTERNAL NAME 'fvt.FVTProcedures!addRecord' PARAMETER
    STYLE DB2GENERAL
    My java program calling this stored proc is as follows:
    import java.sql.*;
    import javax.sql.*;
    public class CallableStmtTest {
         COM.ibm.db2.jdbc.DB2ConnectionPoolDataSource ds = null;
         public static void main(String args[]) {
              CallableStmtTest dt = new CallableStmtTest();
              try {
                   dt.test();
              } catch (Exception e) {
                   e.printStackTrace(System.out);
         public CallableStmtTest() {
              ds = new COM.ibm.db2.jdbc.DB2ConnectionPoolDataSource();
              ds.setUser("username");
              ds.setPassword("password");
              ds.setDatabaseName("database");
    public void test() {
    java.sql.Connection conn = null;
    CallableStatement cs = null;
    String sql = "CALL ADDRECORD(?, ?, ?)" ;
    try {
    conn = ds.getPooledConnection().getConnection();
    conn.setAutoCommit(false);
    System.out.println("Got the connection");
    cs = conn.prepareCall( sql ) ; /* con is the connection */
    System.out.println("Callable statement is prepared");
    cs.registerOutParameter(3, java.sql.Types.INTEGER);
    cs.setInt(1, 1001 );
    cs.setString(2, "1001");
    cs.execute() ;
    System.out.println("Callable statement is executed, return status: "+cs.getInt(3));
    conn.commit();
    catch(SQLException sqle) {
    sqle.printStackTrace();
    finally {
    try {
    if (cs!=null) {cs.close();}
    catch (SQLException sqle1) {
    try {
    if (conn!=null) {conn.close();}
    catch (SQLException sqle1) {
    However, the out put is always
    Callable statement is executed, return status: 0
    while i expect to be
    Callable statement is executed, return status: 2
    Can anyone tell me what's wrong with that?
    thansk,
    JST

    public void addRecord(int id, String name, int status)
    throws SQLException {
    status =3;In regular java you are never going to see this value (3) outside of that method. Java doesn't work that way.
    So unless java inside the DB works really differently from regular java, you are going to have to pass something else.

  • Errer when, Call from java to pl sql procedure with table out parameter

    Hi ,
    Please help me ? It's urgent for me .....
    My Oracle Code is like this ,
    CREATE TABLE TEST_TABLE ( DATE1 DATE, VALUE_EXAMPLE VARCHAR2(20 BYTE), VALUE2_EXAMPLE VARCHAR2(20 BYTE), VALUE3_EXAMPLE NUMBER ); CREATE OR REPLACE TYPE TONERECORDTEST AS OBJECT ( DATE1 DATE, VALUE_EXAMPLE VARCHAR2(20), VALUE2_EXAMPLE VARCHAR2(20), VALUE3_EXAMPLE NUMBER ); CREATE OR REPLACE TYPE TTESTTABLE IS TABLE OF TONERECORDTEST; CREATE OR REPLACE PACKAGE test_collection_procedures AS PROCEDURE testCallProcedureFromJava(start_time IN DATE, end_time IN DATE, table_data OUT TTesttable); END test_collection_procedures; / CREATE OR REPLACE PACKAGE BODY test_collection_procedures AS PROCEDURE testCallProcedureFromJava(start_time IN DATE, end_time IN DATE, table_data OUT TTesttable) IS BEGIN SELECT TONERECORDTEST(date1, value_example, value2_example, value3_example) BULK COLLECT INTO table_data FROM TEST_TABLE WHERE DATE1>=start_time AND DATE1<=end_time; END testCallProcedureFromJava; END test_collection_procedures;
    And my Java Code is like
    import java.sql.Connection; import java.sql.DriverManager; import oracle.jdbc.OracleCallableStatement; import oracle.jdbc.OracleTypes; import oracle.sql.ARRAY; import oracle.sql.ArrayDescriptor; import oracle.sql.STRUCT; import oracle.sql.StructDescriptor; public class testPLCollectionType { public static void main(java.lang.String[] args) { try{ //Load the driver Class.forName ("oracle.jdbc.driver.OracleDriver"); // Connect to the database Connection conn = DriverManager.getConnection ("jdbc:oracle:thin:@serverbd:1521:squema1","user", "password"); // First, declare the Object arrays that will store the data (for TONERECORDTEST OBJECT TYPE) Object [] p2recobj; Object [] p3recobj; Object [] p4recobj; // Declare the Object Arrays to hold the STRUCTS (for TTESTTABLE TYPE) Object [] p2arrobj; // Declare two descriptors, one for the ARRAY TYPE // and one for the OBJECT TYPE. StructDescriptor desc1=StructDescriptor.createDescriptor("TONERECORDTEST",conn); ArrayDescriptor desc2=ArrayDescriptor.createDescriptor("TTESTTABLE",conn); // Set up the ARRAY object. ARRAY p2arr; // Declare the callable statement. // This must be of type OracleCallableStatement. OracleCallableStatement ocs = (OracleCallableStatement)conn.prepareCall("{call test_collection_procedures.testCallProcedureFromJa va(?,?,?)}"); // Declare IN parameters. Realize that are 2 DATE TYPE!!! Maybe your could change with setDATE ocs.setString(1,"01-JAN-04"); ocs.setString(2,"10-JAN-05"); // Register OUT parameter ocs.registerOutParameter(3,OracleTypes.ARRAY,"TTESTTABLE"); // Execute the procedure ocs.execute(); // Associate the returned arrays with the ARRAY objects. p2arr = ocs.getARRAY(3); // Get the data back into the data arrays. //p1arrobj = (Object [])p1arr.getArray(); p2arrobj = (Object [])p2arr.getArray(); System.out.println("Number of rows="+p2arrobj.length); System.out.println("Printing results..."); for (int i=0; i<p2arrobj.length; i++){ Object [] piarrobj = ((STRUCT)p2arrobj).getAttributes();
    System.out.println();
    System.out.print("Row "+i);
    for (int j=0; j<4; j++){
    System.out.print("|"+piarrobj[j]);
    }catch (Exception ex){
    System.out.println("Exception-->"+ex.getMessage());
    Actually when i running the java program it is showing error
    Exception-->ORA-06550: line 1, column 58:
    PLS-00103: Encountered the symbol "VA" when expecting one of the following:
    := . ( @ % ;
    The symbol ":=" was substituted for "VA" to continue.
      I am not getting the error .Please help me out Dhabas Edited by: Dhabas on Jan 12, 2009 3:49 PM                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

    // Declare the callable statement.
    // This must be of type OracleCallableStatement.
    ..."{call test_collection_procedures.testCallProcedureFromJa va(?,?,?)}");Looks like Ja divorced va.

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

  • Calling an Oracle stored procedure and retrieving result from OUT parameter

    Hello,
    I have a stored procedure that returns a string in an OUT parameter after receiving 6 IN parameters. I have tested the procedure in PL/SQL and it's producing the right output there. The problem is when I call the stored procedure from my Java method. I then get an error message telling me that I have the wrong number or types of arguments in my procedure call. I have checked that the method receives and sends the correct data in the correct order and I'm not sure what else the error message can relate to...?
    The exception is called on my second try statement but I haven't been able to find out what I have done wrong there. Does anyone have any suggestions? Thanks.
    the error message
    java.sql.SQLException: ORA-06550: line 1, column 13: PLS-00306: wrong number or types of arguments in call to 'P_SET_GIVEN_ANSWER' ORA-06550: line 1, column 7: PL/SQL: Statement ignored
    the procedure
    CREATE OR REPLACE PROCEDURE p_set_given_answer(
    strfeedback OUT VARCHAR2,
    intpi_id IN INTEGER,
    intquestion_id IN INTEGER,
    intgivenanswer IN INTEGER,
    strgivenprefix IN VARCHAR2,
    strgivenunit IN VARCHAR2,
    strgu_id IN VARCHAR2) AS
    -- some declarations
    BEGIN
    -- some processing and then returns the string below indicating the outcome
    strfeedback = 'result';
    END
    the java method (the class is called dbUtil and the database connection is created in the method called getDbConnection() )
    public void setGivenAnswer(int intPi_id, int intQuestion_id, int intGivenAnswer, String strGu_id, String strGivenPrefix, String strGivenUnit) {
    java.sql.Connection con = null;
    String query = "{call ? := p_set_given_answer(?,?,?,?,?,?)}";
    try {
    con = dbUtil.getDbConnection();
    } catch(Exception e) {
    dbConnectionExceptionMessage = "error 1:"+e.toString();
    try{
    CallableStatement stmt = con.prepareCall(query);
    // register the type of the out param - an Oracle specific type
    stmt.registerOutParameter(1, OracleTypes.VARCHAR);
    // set the in params
    stmt.setInt(2, intPi_id);
    stmt.setInt(3, intQuestion_id);
    stmt.setInt(4, intGivenAnswer);
    stmt.setString(5, strGivenPrefix);
    stmt.setString(6, strGivenUnit);
    stmt.setString(7, strGu_id);
    // execute the stored procedure
    stmt.execute();
    // retrieve the results
    strFeedback = stmt.getString(1);
    } catch (java.sql.SQLException e) {
    dbConnectionExceptionMessage = "error 2:"+e.toString();
    try {
    con.close();
    } catch (java.sql.SQLException e) {
    dbConnectionExceptionMessage = "error 3:"+e.toString();
    ----------------------------------------

    Looks like you are declaring a procedure, but you are calling it like a function. A procedure has no return value, it has only parameters: "{call p_set_given_answer(?,?,?,?,?,?,?)}"

  • Pass a record type vaiable in out parameter of a function in a package

    Hi All,
    1.I have created a ecod inside a package.
    2.Then created a function which has a out parameter of the above record.
    3.Now package body i'm creating a dynamic cursor .
    4.My equirement is to fetch this dynamic cursor's value into the out parameter of the function.
    I have created the below code for 1,2 and 3 but not getting how to achive the point 4.
    create package pkg
    type t_rec is recod (id number,id_name varchar2(10));
    type t_data is table of t_rec index by binary_integer;
    act_data t_data;
    funcion return_data is (dept in number,region in number,o_rec out t_data) return boolean;
    end pkg;
    create package body pkg
    funcion return_data is (dept in number,region in number,o_rec out t_data) return boolean is
    p_cur sys_refcursor;
    l_text varchar2(100);
    begin
    -- As per my requirement i have built a dynamic l_text which contains where clause by taking dept and region values.In actual i have nearly 10 in paramaters with >which i'm building a dynamic where clause in l_text. So i'm using a ref cursor.
    open p_cur for 'select id,id_name from tab1'||l_text';
    fetch p_cur bulk collect into act_data;
    exception ....
    end pkg;Now as per the code snippet i could fetch all the rows returned by p_cur into act_data.
    But how i will pass it though out parameter in the function which i will use somewhere in front end to show data.
    Please help me in this.
    Thanks in advance.

    bp wrote:
    i need to create the where clause one the basis of the values of IN parameters.Sometimes i need to take count of the data on the basis of the IN parameters and if one of the conditions return value i will build where clause with those parameters.Please google and read up on the importance of creating shareable SQL - which needs to be done using bind variables.
    The ref cursor interface in PL/SQL only support a static/fixed number of bind variables. So if you want to create cursors with variable number of bind values, you need to use conditional processing. E.g.
    SQL> create or replace procedure EmpFilter( c OUT sys_refcursor, nameFilter varchar2, jobFilter varchar2 ) is
      2          sqlSelect       varchar2(32767);
      3  begin
      4          --// we pretend to built a dynamic SQL statement - so the table
      5          --// name and so on is "unknown"
      6          sqlSelect := 'select * from emp ';
      7          case
      8                  when nameFilter is null and jobFilter is null then
      9                          open c for sqlSelect;
    10
    11                  when nameFilter is null and jobFilter is not null then
    12                          sqlSelect := sqlSelect||'where job like :filter';
    13                          open c for sqlSelect  using jobFilter;
    14
    15                  when nameFilter is not null and jobFilter is null then
    16                          sqlSelect  := sqlSelect||'where ename like :filter';
    17                          open c for sqlSelect  using nameFilter;
    18
    19                  when  nameFilter is not null and jobFilter is not null then
    20                          sqlSelect  := sqlSelect||'where ename like :filter1 and job like :filter2';
    21                          open c for sqlSelect  using nameFilter, jobFilter;
    22
    23          end case;
    24
    25          DBMS_OUTPUT.put_line( 'Dynamic SQL: '||sqlSelect );
    26  end;
    27  /
    Procedure created.
    SQL>
    SQL>
    SQL> var c refcursor
    SQL> begin
      2          EmpFilter( :c, 'A%', null );
      3  end;
      4  /
    Dynamic SQL: select * from emp where ename like :filter
    PL/SQL procedure successfully completed.
    SQL> print c
         EMPNO ENAME      JOB              MGR HIREDATE                   SAL       COMM     DEPTNO
          7499 ALLEN      SALESMAN        7698 1981/02/20 00:00:00       1600        300         30
          7876 ADAMS      CLERK           7788 1987/05/23 00:00:00       1100                    20
    SQL>
    SQL> begin
      2          EmpFilter( :c, null, 'ANALYST' );
      3  end;
      4  /
    Dynamic SQL: select * from emp where job like :filter
    PL/SQL procedure successfully completed.
    SQL> print c
         EMPNO ENAME      JOB              MGR HIREDATE                   SAL       COMM     DEPTNO
          7788 SCOTT      ANALYST         7566 1987/04/19 00:00:00       3000                    20
          7902 FORD       ANALYST         7566 1981/12/03 00:00:00       3000                    20
    SQL>And this approach is for external clients - where a Visual Basic or Java client program calls the database, executes the stored procedure, and receives a cursor handle in turn. And the client then fetches the output of this cursor and process it.
    There is no need to return a record type of any sorts. The client wants the cursor handle as that is the optimal and best interface for the client to receive database data.
    If the caller is not an external client, but another PL/SQL procedure, then this approach does not make much sense.
    It is important that you understand basic Oracle concepts and fundamentals. What a cursor is. What the best way is to process Oracle data. How to best use the basic features of Oracle. Without that basic understanding, you as good as a low hour Cessna pilot getting into an Airbus A400M - where the Cessna pilot would not even be able to start a single engine, never mind get the plane in the air.
    Likewise, without a basic understanding of Oracle cursors and fundamentals, you will be unable to code even a single line of sensible code. Not because you are a bad programmer. Even the best programmer in the world will be unable to write decent code, if the programmer has no idea how the environment works, what the concepts and fundamentals are. But it is fair to expect that a good programmer will no write such code, understand that there is a lack of knowledge, and address that accordingly.

  • Call PL/SQL Procedure in/out parameter

    Hi !!
    I need some help please.
    This example illustrates an IN parameter:
    OADBTransaction txn = getDBTransaction();
    CallableStatement cs =
    txn.createCallableStatement("begin dbms_application_info.set_module(:1, :2);
    end;");
    try{
    cs.setString(1, module);
    cs.setString(2, action);
    cs.execute();
    cs.close();
    catch (SQLException sqle){
    try { cs.close } catch (Exception(e) {}
    throw OAException.wrapperException(sqle);
    This example illustrates an OUT parameter:
    DBTransaction txn = getDBTransaction();
    String sql = "BEGIN :1 := FND_MESSAGE.GET; END;";
    CallableStatement cs = txn.createCallableStatement(sql, 1);
    String messageBuffer = "";
    try {
    ((OracleCallableStatement)cs.registerOutParameter(1, Types.VARCHAR, 0, 2000);
    cs.execute();
    messageBuffer = cs.getString(1);
    cs.close();
    catch (SQLException sqle) {
    try { cs.close } catch (Exception(e) {}
    throw OAException.wrapperException(sqle);
    but, How to call a procedure with an IN/OUT parameter ?
    Thanks in advance....
    Jairo

    Thank u for the reply.
    I thought that, thanks for confirm it; I also found on metalink some examples:
    https://metalink.oracle.com/metalink/plsql/f?p=130:14:709875901216485933::::p14_database_id,p14_docid,p14_show_header,p14_show_help,p14_black_frame,p14_font:NOT,118821.1,1,1,1,helvetica
    Doc ID: Note:118821.1
    // Call a procedure with an IN/OUT prameter
    CallableStatement procinout = conn.prepareCall ("begin procinout (?); end;");
    procinout.registerOutParameter (1, Types.VARCHAR);
    procinout.setString (1, "testing");
    procinout.execute ();
    dumpTestTable (conn);
    System.out.println
    ("Out argument is: " + procinout.getString (1));
    I've been making some test following that example, I created a procedure that accepts an in-out parameter:
    OADBTransactionImpl dbTx = (OADBTransactionImpl)getTransaction();
    String sql = "xgpv_utl_cot.test(:1); end;";
    cs = dbTx.createCallableStatement(sql, OADBTransactionImpl.DEFAULT);
    try{ // call statement
    cs.setString(1, "dummyString");
    cs.registerOutParameter(1, OracleTypes.VARCHAR);
    cs.execute();
         String status = ocs.getString(11);
    if ( !("1".equals(status)) ){
         ... do someting
    but when I call it I get this error:
    ## Detail 0 ##
    java.sql.SQLException: ORA-00900: invalid SQL statement
         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:583)
         at oracle.jdbc.ttc7.TTC7Protocol.doOall7(TTC7Protocol.java:1986)
         at oracle.jdbc.ttc7.TTC7Protocol.parseExecuteFetch(TTC7Protocol.java:1144)
         at oracle.jdbc.driver.OracleStatement.executeNonQuery(OracleStatement.java:2176)
         at oracle.jdbc.driver.OracleStatement.doExecuteOther(OracleStatement.java:2050)
         at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:2959)
         at oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePreparedStatement.java:650)
         at oracle.jdbc.driver.OraclePreparedStatement.execute(OraclePreparedStatement.java:726)
         at gpv.oracle.apps.ak.cotizador.server.CotizadorAMImpl.insertExpenseCommission(CotizadorAMImpl.java:1020)
         at gpv.oracle.apps.ak.cotizador.server.CotizadorAMImpl.insertQuotation(CotizadorAMImpl.java:669)
         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:324)
         at oracle.apps.fnd.framework.server.OAUtility.invokeMethod(OAUtility.java:190)
         at oracle.apps.fnd.framework.server.OAApplicationModuleImpl.invokeMethod(OAApplicationModuleImpl.java:686)
         at gpv.oracle.apps.ak.cotizador.webui.TreeCenterFrmCO.processRequest(TreeCenterFrmCO.java:305)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequest(OAWebBeanHelper.java:581)
         at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processRequest(OAWebBeanContainerHelper.java:247)
         at oracle.apps.fnd.framework.webui.OAPageLayoutHelper.processRequest(OAPageLayoutHelper.java:1134)
         at oracle.apps.fnd.framework.webui.beans.layout.OAPageLayoutBean.processRequest(OAPageLayoutBean.java:1569)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequestChildren(OAWebBeanHelper.java:937)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequestChildren(OAWebBeanHelper.java:904)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequest(OAWebBeanHelper.java:640)
         at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processRequest(OAWebBeanContainerHelper.java:247)
         at oracle.apps.fnd.framework.webui.beans.form.OAFormBean.processRequest(OAFormBean.java:385)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequestChildren(OAWebBeanHelper.java:937)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequestChildren(OAWebBeanHelper.java:904)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequest(OAWebBeanHelper.java:640)
         at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processRequest(OAWebBeanContainerHelper.java:247)
         at oracle.apps.fnd.framework.webui.beans.OABodyBean.processRequest(OABodyBean.java:353)
         at oracle.apps.fnd.framework.webui.OAPageBean.processRequest(OAPageBean.java:2297)
         at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:1710)
         at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:501)
         at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:422)
         at OA.jspService(OA.jsp:40)
         at com.orionserver.http.OrionHttpJspPage.service(OrionHttpJspPage.java:56)
         at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:317)
         at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:465)
         at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:379)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:727)
         at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:306)
         at com.evermind.server.http.ServletRequestDispatcher.forward(ServletRequestDispatcher.java:209)
         at com.evermind.server.http.GetParametersRequestDispatcher.forward(GetParametersRequestDispatcher.java:189)
         at com.evermind.server.http.EvermindPageContext.forward(EvermindPageContext.java:199)
         at OA.jspService(OA.jsp:45)
         at com.orionserver.http.OrionHttpJspPage.service(OrionHttpJspPage.java:56)
         at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:317)
         at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:465)
         at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:379)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:727)
         at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:306)
         at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:767)
         at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:259)
         at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:106)
         at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:803)
         at java.lang.Thread.run(Thread.java:534)
    Also in my project I've executed without problems others procedures using in-parameters and out-parameters, but this one causes me some problems:
    OADBTransactionImpl dbTx = (OADBTransactionImpl)getTransaction();
    String sql = "xgpv_utl_cot.get_expense_commission(:1, :2, :3, :4, :5, :6, :7, :8, :9, :10, :11); end;";
    // create statement defining prefetch DEFAULT num rows
    cs = dbTx.createCallableStatement(sql, OADBTransactionImpl.DEFAULT);
    try{ // call statement
    // register the type of the out param - an Oracle specific type
    cs.setInt(1, cotizacionId );
    cs.setString(2, yes);
    cs.setInt(3, esqFinId);
    cs.setString(4, estadoCivil);
    cs.setDouble(5, valorBase);
    cs.setDouble(6, anticipo );
    cs.setDouble(7, capacidadCompraNeta);
    cs.setDouble(10, totalCredito);          //IN-OUT param
    cs.registerOutParameter(8, OracleTypes.DOUBLE);
    cs.registerOutParameter(9, OracleTypes.DOUBLE);
    cs.registerOutParameter(10, OracleTypes.DOUBLE); //IN-OUT param
    cs.registerOutParameter(11, OracleTypes.LONGVARCHAR);
    cs.execute();
    ocs = (OracleCallableStatement)cs;
    String status = ocs.getString(11);
    if ( !("1".equals(status)) ){
    ... do someting
    Error:
    ## Detail 0 ##
    java.lang.NullPointerException
         at oracle.jdbc.ttc7.TTCAdapter.newTTCType(TTCAdapter.java:300)
         at oracle.jdbc.ttc7.TTCAdapter.createNonPlsqlTTCColumnArray(TTCAdapter.java:270)
         at oracle.jdbc.ttc7.TTCAdapter.createNonPlsqlTTCDataSet(TTCAdapter.java:231)
         at oracle.jdbc.ttc7.TTC7Protocol.doOall7(TTC7Protocol.java:1940)
         at oracle.jdbc.ttc7.TTC7Protocol.parseExecuteFetch(TTC7Protocol.java:1144)
         at oracle.jdbc.driver.OracleStatement.executeNonQuery(OracleStatement.java:2176)
         at oracle.jdbc.driver.OracleStatement.doExecuteOther(OracleStatement.java:2050)
         at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:2959)
         at oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePreparedStatement.java:650)
         at oracle.jdbc.driver.OraclePreparedStatement.execute(OraclePreparedStatement.java:726)
         at gpv.oracle.apps.ak.cotizador.server.CotizadorAMImpl.insertExpenseCommission(CotizadorAMImpl.java:1010)
         at gpv.oracle.apps.ak.cotizador.server.CotizadorAMImpl.insertQuotation(CotizadorAMImpl.java:669)
         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:324)
         at oracle.apps.fnd.framework.server.OAUtility.invokeMethod(OAUtility.java:190)
         at oracle.apps.fnd.framework.server.OAApplicationModuleImpl.invokeMethod(OAApplicationModuleImpl.java:686)
         at gpv.oracle.apps.ak.cotizador.webui.TreeCenterFrmCO.processRequest(TreeCenterFrmCO.java:305)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequest(OAWebBeanHelper.java:581)
         at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processRequest(OAWebBeanContainerHelper.java:247)
         at oracle.apps.fnd.framework.webui.OAPageLayoutHelper.processRequest(OAPageLayoutHelper.java:1134)
         at oracle.apps.fnd.framework.webui.beans.layout.OAPageLayoutBean.processRequest(OAPageLayoutBean.java:1569)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequestChildren(OAWebBeanHelper.java:937)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequestChildren(OAWebBeanHelper.java:904)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequest(OAWebBeanHelper.java:640)
         at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processRequest(OAWebBeanContainerHelper.java:247)
         at oracle.apps.fnd.framework.webui.beans.form.OAFormBean.processRequest(OAFormBean.java:385)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequestChildren(OAWebBeanHelper.java:937)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequestChildren(OAWebBeanHelper.java:904)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequest(OAWebBeanHelper.java:640)
         at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processRequest(OAWebBeanContainerHelper.java:247)
         at oracle.apps.fnd.framework.webui.beans.OABodyBean.processRequest(OABodyBean.java:353)
         at oracle.apps.fnd.framework.webui.OAPageBean.processRequest(OAPageBean.java:2297)
         at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:1710)
         at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:501)
         at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:422)
         at OA.jspService(OA.jsp:40)
         at com.orionserver.http.OrionHttpJspPage.service(OrionHttpJspPage.java:56)
         at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:317)
         at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:465)
         at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:379)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:727)
         at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:306)
         at com.evermind.server.http.ServletRequestDispatcher.forward(ServletRequestDispatcher.java:209)
         at com.evermind.server.http.GetParametersRequestDispatcher.forward(GetParametersRequestDispatcher.java:189)
         at com.evermind.server.http.EvermindPageContext.forward(EvermindPageContext.java:199)
         at OA.jspService(OA.jsp:45)
         at com.orionserver.http.OrionHttpJspPage.service(OrionHttpJspPage.java:56)
         at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:317)
         at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:465)
         at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:379)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:727)
         at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:306)
         at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:767)
         at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:259)
         at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:106)
         at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:803)
         at java.lang.Thread.run(Thread.java:534)
    I was thinking that maybe the in-out parameter might been causing this error, maybe I didn't declarated it correctly.
    Can you help me?
    Thanks in advance....
    Jairo

  • Oracle API - Standard IN and OUT parameter

    Hi,
    I need to use the standard Oracle API to load bulk data into required table in Oracle HRMS. However, I am confuse on the IN and OUT parameter. For example the below standard Oracle API:
    procedure Create_category
    (p_validate in boolean default false
    ,p_effective_date in date
    ,p_business_group_id in number
    ,p_category in varchar2
    ,p_type in     varchar2
    ,p_description in varchar2
    ,p_parent_cat_usage_id in     number
    ,p_synchronous_flag in     varchar2
    ,p_online_flag in     varchar2 default null
    ,p_attribute_category in varchar2 default null
    ,p_attribute1 in varchar2 default null
    ,p_attribute2 in varchar2 default null
    ,p_attribute3 in varchar2 default null
    ,p_attribute4 in varchar2 default null
    ,p_attribute5 in varchar2 default null
    ,p_attribute6 in varchar2 default null
    ,p_attribute7 in varchar2 default null
    ,p_attribute8 in varchar2 default null
    ,p_attribute9 in varchar2 default null
    ,p_attribute10 in varchar2 default null
    ,p_attribute11 in varchar2 default null
    ,p_attribute12 in varchar2 default null
    ,p_attribute13 in varchar2 default null
    ,p_attribute14 in varchar2 default null
    ,p_attribute15 in varchar2 default null
    ,p_attribute16 in varchar2 default null
    ,p_attribute17 in varchar2 default null
    ,p_attribute18 in varchar2 default null
    ,p_attribute19 in varchar2 default null
    ,p_attribute20 in varchar2 default null
    ,p_data_source in varchar2 default null
    ,p_start_date_active in date
    ,p_end_date_active in date default null
    ,p_category_usage_id out nocopy number
    ,p_object_version_number out nocopy number
    ,p_comments in varchar2 default null
    Appreciate clarification on the below:
    1. What does the standard IN and OUT parameter mean?
    2. Is there any other parameter besides IN and OUT?
    My objective is to identify what are the mandatory/required/optional fields based on the API's parameters.
    Thanks and Regards,
    SC

    Hi;
    All APIs are listed in Oracle Integration Repository. I suggest check below notes:
    http://irep.oracle.com/index.html
    API User Notes - HTML Format [ID 236937.1]
    R12.0.[3-4] : Oracle Install Base Api / Open Interface Setup Test [ID 427566.1]
    Oracle Trading Community Architecture API User Notes, June 2003 [ID 241320.1]
    Technical Uses of Customer Interface and TCA-API [ID 269121.1]
    Pelase also check below:
    Api's in EBS
    Re: Api's in EBS
    http://sairamgoudmalla.blogspot.com/2009/05/script-to-find-oracle-apis-for-any.html
    API
    Fixed Asset API
    List of API
    Re: List of APIs
    Oracle Common Application Components API Reference Guide
    download.oracle.com/docs/cd/B25284_01/current/acrobat/jta115api.pdf
    List of APIs and open interface R12
    Re: List of APIs and open interface R12
    Regard
    Helios

  • Error while calling a stored procedure with OUT parameter.

    Hi,
    I am trying to call a Stored Procedure(SP) with an OUT parameter(Ref Cursor) from a third party tool. It is called using OLE-DB Data provider. In one database the procedure works fine but when I change the database the procedure call is giving following error.
    Distribution Object:     COM Error. COM Source: OraOLEDB. COM Error message: IDispatch error #3092. COM Description: ORA-06550: line 1, column 7:
         PLS-00306: wrong number or types of arguments in call to 'TEST1'
         ORA-06550: line 1, column 7:
         PL/SQL: Statement ignored.
    I am not able to find as to why is this happening. Please let me know any clues /help to solve this problem.
    Thanks in advance.

    If you're using Oracle Provider for OLE DB (OraOLEDB) to execute this stored procedure, you need to set PLSQLRSet attribute. This attribute can be set in registry, connection string, or command object. Please refer to User Documentation for more information.

Maybe you are looking for

  • How do i get photos from computer to iPhone?

    how do i get photos from my macbook onto my iphone5.  i transferred iphone photos to iphoto, and now they disappeared from my phone!  something went wrong!

  • FFT from XY array

    Hi, i cant handle with FFT from 2d array. I am converting data from excel. In labview it is a 2 columns with 10000 rows array. Then i am plotting XY graph from this array(using 'build XY graph') and it is well plotted. Now i need to use FFT on this a

  • Pointer turned into a link hand, and I cannot click anything

    I cannot seem to find the keyboard hotkey that will allow my cursor to become an arrow again. My dog stepped on my computer and it's permanently a hand pointer (link pointer). No idea how to fix it without a reboot - but I don't want to do that yet.

  • Adobe Application Manager reinstall problem

    I've removed LR from my suite of programs (from my Macbook Pro). Now I would like to reinstall but the App Manager simply tells me that the LR 4.4 is up to date. Any ideas how I might redownload LR back to my laptop? Thanks

  • 1G shuffle problems

    I cannot get my new ipod to go into the "play in order" mode. No matter what I have done it will shuffle only. I am loading my own CDs from discs through RealPlayer