Calling PL\SQL procedures

What's the best way to invoke a PL\SQL procedure using Java?
I am hoping to use the values passed from the JSP into the database for computations but don't know how to call the procedure after the commit.
Any ideas?
Thanks a lot!

Example follows for a PL/SQL proc call from a Java application that returns a result set and displays it in a scrolling pane. Hope it helps you:
setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
try
CallableStatement call =
OpenDBConnections.myJdbcConnection.prepareCall
("{? = call MY_PLSQL_PROC(?)}");
call.registerOutParameter(1,OracleTypes.CURSOR);
call.setString(2,partNumber_tf.getText().toString());
call.execute();
OracleResultSet rset=(OracleResultSet)call.getObject(1);
/* use caching result set cuz it is non scrollable stored proc result */
model = new CachingResultSetTableModel(rset);
result_tbl = new JTable(model);
status_tf.setText(result_tbl.getRowCount()+" matching Rows found.");
jScrollPane1.getViewport().add(result_tbl, null);
rset.close();
call.close();
setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
catch (SQLException esql)
System.out.println(esql.toString());
}

Similar Messages

  • How to Call PL/SQL Procedure

    Hi
    I am trying to call PL/SQL Procedure in OCI but i didn't get success, Please answer,
    Thank you in advance
    null

    Here is a very short sample. Hope it helps
    char SQLStatemen[] ="BEGIN spFoo (:P_Name);END;";
    /* Initialize everything */
    OCIBindByName (CommandHandler, &OCIBindName, ErrorHandler, (text *) ":P_Name", -1, (dvoid *) Name, strlen(Name) +1, SQLT
    _STR, (dvoid *) 0,(ub2 *) 0, (ub2 *) 0, (ub4) 0, (ub4 *) 0, OCI_DEFAULT) == OCI_ERROR);
    OCIStmtExecute (ServiceContext, CommandHandler,ErrorHandler, 1, 0, (OCISnapshot *) NULL,(OCISnapshot *) NULL, OC
    I_DEFAULT);
    /* if P_Name is an out parameter, at this point, it has the value it got from the database */
    /* logoff and close everything */

  • How to call pl/sql procedure/function from XML

    Hi,
    I have a requirement to call pl/sql function/procedure from the RTF template. How can I do this?

    Hi,
    I have got the same requirement. We need to call the store PL/SQL procedure from the XML template to generate the fixedwidth files. Could you tell me if you are able to call PL/SQL procedure from XML template?
    Thanks,
    Ram

  • Calling PL/SQL procedures from a Windows CMD script

    Hello,
    I am writing a Windows CMD script. From this script I want to call procedures from a PL/SQL package which selects, inserts or deletes rows from the database.
    How do I go about logging into the database from the cmd script and calling PL/SQL procedures from there?
    Does anyone have any examples of such scripts? Thanks in advance.

    No, it is not a job that needs to be scheduled.
    The script will be used when needed to select info from a certain table and also to insert or delete certain info into/from this table (so, it is just simple sql statements which I have put into a package), but I'm sure how to log into the database and execute the procedures from this package in a cmd script.

  • Calling PL/Sql Procedure in Jdeveloper 11g

    Hi All,
    How to call PL/Sql Procedure in Jdeveloper 11G. Here my procedure prints some statements in procedure using "dbms.output.put_line" . Here I want to call that procedure using button (or) ImageLink and print all the statements in pl/sql procedure in Jdeveloper Environment.
    Can anybody help on this .
    Thanks in Advance .
    Edited by: u41411 on Sep 28, 2009 7:18 AM

    Her is what I use to call Oracle DB procedure:
    procCall = "BEGIN " + YOUR_PROC_NAME + "(); END;";
    returned = am.getTransaction().executeCommand(procCall);
    where am is my application Module
    Hope this help.
    Jack

  • Calling PL/SQL Procedures from Java

    Hello,
    I want to know, if it is possible to call PL/SQL Procedures from
    SQLJ(which uses htp.print from the Package web toolkit ).
    Though, it is possible to call normal procedures but if I want
    to call PL/SQL procedures with htp.print then I get I error.
    For example:
    #sql{Call html_test()};
    Can you give me a advice?
    Your help is much appreciated!
    M|ller

    Oracle's htp packages are develop to be work with
    mod_plsql/OAS/OWS webserver.
    If you are trying to use htp packages first need to instanciate
    some enviroment vars for htp packages, for example first you has
    to call to owa.initialize procedure, populate owa.cgi array and
    so on.
    If you need more information about how this toolkit works you
    could get the source of DB Prism at
    http://www.plenix.com/dbprism/ this open source framework
    includes backward compatibility with mod_plsql application and
    then includes settings of this values from Java code.
    Best regards, Marcelo.

  • DB Adapter calling PL/SQL Procedure gives error

    Created partner link, calling pl/sql procedure with one in variable and one out variable. Invoke works fine. Assigning pl/sql return value to output is causing run time error. "Rebuild" and "Deploy" works file.
    Here is the error:
    Assign_2
    [2007/08/03 14:18:06]
    Error in evaluate <from> expression at line "93". The result is empty for the XPath expression : "/ns3:OutputParameters/ns3:OUT_STATUS_CODE".
    oracle.xml.parser.v2.XMLElement@ba1893
    Copy details to clipboard
    [2007/08/03 14:18:06]
    "{http://schemas.xmlsoap.org/ws/2003/03/business-process/}selectionFailure" has been thrown.
    - <selectionFailure xmlns="http://schemas.xmlsoap.org/ws/2003/03/business-process/">
    - <part name="summary">
    <summary>
    empty variable/expression result.
    xpath variable/expression expression "/ns3:OutputParameters/ns3:OUT_STATUS_CODE" is empty at line 93, when attempting reading/copying it.
    Please make sure the variable/expression result "/ns3:OutputParameters/ns3:OUT_STATUS_CODE" is not empty.
    </summary>
    </part>
    </selectionFailure>
    Any input would be appreciated..
    Thanks.

    Thanks, it works.
    In the “Assign Variables”
    Changed from:
    <copy>
    <from variable="Invoke_1_ASNDBTest103_OutputVariable"
    part="OutputParameters" query="/ns3:OutputParameters/ns3:OUT_STATUS_CODE"/>
    <to variable="outputVariable" part="payload"
    query="/ns2:ASNReturnStatus102"/>
    </copy>
    Changed to:
    <copy>
    <from variable="Invoke_1_ASNDBTest103_OutputVariable"
    part="OutputParameters" query="/ns3:OutputParameters"/>
    <to variable="outputVariable" part="payload"
    query="/ns2:ASNReturnStatus102"/>
    </copy>
    So far so good, but one question, compiler gives warning…but everything works well.
    Warning(97):
    [Error ORABPEL-10041]: Trying to assign incompatible types
    [Description]: in line 97 of "C:\HOME\jdevOAExt3\jdevhome\jdev\mywork\ASNTest101\BPELProcess1\bpel\BPELProcess1.bpel", <from> value type "{http://xmlns.oracle.com/pcbpel/adapter/db/APPS/XRX_BPEL_INSERT_ASN_TMP102/}OutputParameters anonymous type" is not compatible with <to> value type "{http://www.thiscompany.com/ns/sales}ASNReturnStatus102".
    [Potential fix]: Please make sure that the return value of from-spec query is compatible with the to-spec query.
    Also, instead of direct variable to variable copy, used expression to variable copy and it works. You can avoid the warning from the compiler.
    Does not work ==> bpws:getVariableData('Invoke_1_ASNDBTest103_OutputVariable','payload','/ns3:OutputParameters/ns3:OUT_STATUS_CODE')
    Works ==> bpws:getVariableData('Invoke_1_ASNDBTest103_OutputVariable','payload','/ns3:OutputParameters’)
    So, why the compiler warning?

  • Call PL/SQL procedure from JDeveloper

    Is that possible to call PL/SQL procedure from JDeveloper?
    What's the setup and coding requirements?
    Thanks for any input.

    This is the Code:_
    package oracle.e1.bssv.J594101;
    import java.util.Hashtable;
    import javax.naming.NamingException;
    import java.sql.Connection;
    import java.sql.SQLException;
    import javax.naming.InitialContext;
    import javax.naming.Context;
    import javax.naming.NamingEnumeration;
    import javax.sql.*;
    public class CallSQLProcedure3 {
    public CallSQLProcedure3() {
    public static void main(String[] args) {
    // try {
    Hashtable env = new Hashtable();
    env.put(Context.INITIAL_CONTEXT_FACTORY,
    "com.evermind.server.rmi.RMIInitialContextFactory");
    // env.put(Context.PROVIDER_URL,
    "ormi\\://localhost\\:23891/current-workspace-app");
    // env.put(Context.PROVIDER_URL,
    "ormi://localhost:23791/E1Services-LOCALDEV");
    env.put(Context.PROVIDER_URL, "ormi://localhost:23791");
    // env.put(Context.PROVIDER_URL,
    "ormi://localhost\\:23791/current-workspace-app");
    env.put(Context.SECURITY_PRINCIPAL, "oc4jadmin");
    env.put(Context.SECURITY_CREDENTIALS, "welcome");
    Context ctx3 = null;
    try {
    ctx3 = new InitialContext(env);
    } catch (NamingException e) {
    // TODO
    // Context ctx = null;
    try {
    // NamingEnumeration n= ctx3.list("ormi://localhost:23791");
    // System.out.println(n.hasMore());
    Hashtable h = ctx3.getEnvironment();
    // while(h.elements().hasMoreElements())
    System.out.println(" name " +
    h.elements().nextElement().toString());
    // InitialContext initialContext = new InitialContext();
    // javax.sql.DataSource ds =
    (javax.sql.DataSource)initialContext.lookup("jdbc/DBConnection1DS");
    // javax.sql.DataSource ds =
    (javax.sql.DataSource)ctx3.lookup("jdbc/DBConnection1DS");
    // javax.sql.DataSource ds =
    (javax.sql.DataSource)ctx3.lookup("jdbc/OracleDS");
    javax.sql.DataSource ds =
    (javax.sql.DataSource)ctx3.lookup("jdbc/DBConnection1DS");
    java.sql.Connection conn;
    try {
    conn = ds.getConnection();
    } catch (SQLException e) {
    // TODO
    // ctx = new InitialContext();
    Context initCtx = new InitialContext();
    Context envCtx = (Context)initCtx.lookup("java:comp/env");
    // Hashtable h = envCtx.getEnvironment();
    // while(h.elements().hasMoreElements())
    // System.out.println(" name " + h.elements().nextElement().toString());
    DataSource ds2 = (DataSource)envCtx.lookup("DBConnection1DS");
    // Connection conn;
    // try {
    // conn = ds.getConnection();
    // } catch (SQLException e) {
    // TODO
    // } catch (NamingException e) {
    // // TODO
    // DataSource dataSource = null;
    // } catch (NamingException ne) {
    // try {
    // dataSource = (DataSource)ctx.lookup("jdbc/DBConnection1DS");
    // } catch (NamingException e) {
    // e.printStackTrace();
    // String myError1="Error occured with Initial Context";
    Connection conn2;
    try {
    conn2 = ds2.getConnection();
    // conn = ds.getConnection();
    } catch (SQLException e) {
    // TODO
    } catch (NamingException e) {
    // TODO
    e.printStackTrace();
    System.out.println("Error looking up " +e);
    This is the Error:_
    error message from executing a code ds.getConnection();
    D:\oracle\jdevstudio10133\jdk\bin\javaw.exe -client -classpath
    D:\e812\ETDV812\Java\classes;D:\oracle\jdevstudio10133\webservices\lib\jaxrpc-api.jar;D:\oracle\jdevstudio10133\webservices\lib\wsclient.jar;D:\oracle\jdevstudio10133\webservices\lib\wsserver.jar;D:\oracle\jdevstudio10133\webservices\lib\wssecurity.jar;D:\oracle\jdevstudio10133\webservices\lib\wsdl.jar;D:\oracle\jdevstudio10133\webservices\lib\orasaaj.jar;D:\oracle\jdevstudio10133\webservices\lib\saaj-api.jar;D:\oracle\jdevstudio10133\webservices\lib\orawsdl.jar;D:\oracle\jdevstudio10133\webservices\lib\orawsrm.jar;D:\oracle\jdevstudio10133\webservices\lib\jaxr_api.jar;D:\oracle\jdevstudio10133\webservices\lib\orajaxr.jar;D:\oracle\jdevstudio10133\webservices\lib\relaxngDatatype.jar;D:\oracle\jdevstudio10133\webservices\lib\jaxb-impl.jar;D:\oracle\jdevstudio10133\webservices\lib\jaxb-libs.jar;D:\oracle\jdevstudio10133\webservices\lib\xsdlib.jar;D:\oracle\jdevstudio10133\webservices\lib\mdds.jar;D:\oracle\jdevstudio10133\jlib\jaxen.jar;D:\oracle\jdevstudio10133\jlib\oraclepki!
    .jar;D:\oracle\jdevstudio10133\jlib\ojpse.jar;D:\oracle\jdevstudio10133\jlib\osdt_core.jar;D:\oracle\jdevstudio10133\jlib\osdt_cert.jar;D:\oracle\jdevstudio10133\jlib\osdt_xmlsec.jar;D:\oracle\jdevstudio10133\jlib\osdt_wss.jar;D:\oracle\jdevstudio10133\jlib\osdt_saml.jar;D:\oracle\jdevstudio10133\jlib\repository.jar;D:\oracle\jdevstudio10133\jlib\ojmisc.jar;D:\oracle\jdevstudio10133\j2ee\home\lib\http_client.jar;D:\oracle\jdevstudio10133\j2ee\home\jazncore.jar;D:\oracle\jdevstudio10133\j2ee\home\oc4jclient.jar;D:\oracle\jdevstudio10133\rdbms\jlib\xdb.jar;D:\oracle\jdevstudio10133\diagnostics\lib\ojdl2.jar;D:\e812\ETDV812\ini\sbf;D:\e812\System\Classes\Base_JAR.jar;D:\e812\System\Classes\BizLogicContainer_JAR.jar;D:\e812\System\Classes\BusinessLogicServices_JAR.jar;D:\e812\System\Classes\Connector.jar;D:\e812\System\Classes\EventProcessor_JAR.jar;D:\e812\System\Classes\Generator_JAR.jar;D:\e812\System\Classes\JdbjBase_JAR.jar;D:\e812\System\Classes\JdbjInterfaces_JAR.jar;D:\!
    e812\System\Classes\JdeNet_JAR.jar;D:\e812\System\Classes\Maf2Base_JAR
    .jar;D:\e812\System\Classes\mafsecurity.jar;D:\e812\System\Classes\Metadata.jar;D:\e812\System\Classes\MetadataInterface.jar;D:\e812\System\Classes\PMApi_JAR.jar;D:\e812\System\Classes\SBFFoundation_JAR.jar;D:\e812\System\Classes\Spec_JAR.jar;D:\e812\System\Classes\System_JAR.jar;D:\e812\System\Classes\SystemInterfaces_JAR.jar;D:\e812\System\Classes\castor.jar;D:\e812\System\Classes\log4j.jar;D:\e812\System\Classes\xerces.jar;D:\e812\System\Classes\xml-apis.jar;D:\e812\System\Classes\Rijndael.jar;D:\e812\System\Classes\ManagementAgent_JAR.jar;D:\e812\System\Classes\commons-logging.jar;D:\e812\System\Classes\commons-codec-1.3.jar;D:\e812\System\Classes\commons-httpclient-3.0.jar;D:\e812\System\Classes\jmxremote.jar;D:\e812\System\Classes\jmxremote_optional.jar;D:\e812\System\Classes\jmxri.jar;D:\e812\System\Classes\rmissl.jar;D:\e812\misc\ojdbc5.jar;D:\e812\misc\mssqlserver.jar;D:\e812\misc\msutil.jar;D:\e812\misc\msbase.jar;D:\e812\misc\db2java.zip;D:\e812\misc\jt400.jar;D:\!
    e812\misc\sqljdbc.jar;D:\oracle\jdevstudio10133\lib\xmlparserv2.jar;D:\oracle\jdevstudio10133\lib\xml.jar
    oracle.e1.bssv.J594101.CallSQLProcedure3
    name com.evermind.server.rmi.RMIInitialContextFactory
    Exception in thread "main" java.lang.NoClassDefFoundError:
    org/apache/bcel/generic/Instruction
    at
    oracle.oc4j.sql.spi.ConnectionHandle.getConnectionHandle(ConnectionHandle.java:725)
    at
    oracle.oc4j.sql.spi.ManagedConnectionImpl.getConnectionHandle(ManagedConnectionImpl.java:273)
    at
    oracle.oc4j.sql.spi.ManagedConnectionImpl.getConnection(ManagedConnectionImpl.java:255)
    at
    com.evermind.server.connector.ApplicationConnectionManager.createConnectionHandle(ApplicationConnectionManager.java:1786)
    at
    com.evermind.server.connector.ApplicationConnectionManager.allocateConnection(ApplicationConnectionManager.java:1472)
    at
    oracle.j2ee.connector.OracleConnectionManager.unprivileged_allocateConnection(OracleConnectionManager.java:238)
    at
    oracle.j2ee.connector.OracleConnectionManager.allocateConnection(OracleConnectionManager.java:192)
    at
    oracle.oc4j.sql.ManagedDataSource.getConnection(ManagedDataSource.java:272)
    at
    oracle.oc4j.sql.ManagedDataSource.getConnection(ManagedDataSource.java:200)
    at
    oracle.oc4j.sql.ManagedDataSource.getConnection(ManagedDataSource.java:142)
    at
    oracle.oc4j.sql.ManagedDataSource.getConnection(ManagedDataSource.java:127)
    at
    oracle.e1.bssv.J594101.CallSQLProcedure3.main(CallSQLProcedure3.java:70)
    Process exited with exit code 1.

  • Got Call pl/sql procedure in C#

    Hi Experts,
    I tried to call a pl/sql procedure TEST_COMP from a .NET app in C# and got the following error, but the same code worked in VB, any advice?
    Thanks,
    James
    ORA-06550: line 1, column 7:
    PLS-00201: identifier 'UTIL_PKG.TEST_COMP' must be declared
    ORA-06550: line 1, column 7:
    UTIL_PKG is the name of package, I logged in as the owner of the package.
    Here is the C# code, that gets an error:
    string cmdString = "UTIL_PKG.TEST_COMP";
    OracleCommand cmd = new OracleCommand(cmdString,con);
    cmd.CommandType = CommandType.StoredProcedure;
    try
    cmd.ExecuteNonQuery();
    catch (Exception ex)
    Console.WriteLine(ex.Message);
    Here is the VB code that works:
    Dim cmdString As String = "UTIL_PKG.TEST_COMP"
    Dim cmd As OracleCommand = New OracleCommand(cmdString)
    cmd.Connection = con
    cmd.CommandType = CommandType.StoredProcedure
    Try
    cmd.ExecuteNonQuery()
    Catch ex As Exception
    Console.WriteLine(ex.Message)

    Double post:
    Re: Got PLS-00201 error when call ps/sql procedure from .NET app in C#
    The bottom line is it should work in both. So either you aren't telling us all the details, or something has changed and you don't even know it.

  • How to call PL/SQL procedure from Jdeveloper

    hai
    i am using JDeveloper 10g version 10.1.3. i am working on Web Application[JSF,ADF BC]. i had commit button in one form. when i click that button a PL/SQL procedure can be invoked.( the procedure is to check for primary key)
    how to do this
    thanks in advance
    C.R

    There are already some threads about calling PL/SQL from Java. E.g.: adf bc jsf application and database stored procedure
    Ronald

  • Call PL/SQL procedure from htmldb_delete_message Javascript

    Hi Guys,
    I am a bit of a novice when it come to JavaScript; I have written a PL/SQL procedure that deletes multiple records based on a primary key:
    PROCEDURE clear_alterations (p_eco IN VARCHAR2)
    IS
    BEGIN
    DELETE FROM xxmel_apex_eco_alterations
    WHERE eco = p_eco;
    END clear_alterations;
    I can run that straight from a normal button, but I want the htmldb_delete_message dialog box to pop up to confirm whether to delete or not. When the user clicks 'OK' I want the record to be deleted and if cancel, do nothing.
    I have managed to get the confirmation box to appear but cant see how to call the PLSQL based on the 'OK' button being pressed.
    Any help would be great,
    Thanks
    Chris

    Hi Cashy,
    By using Ajax you can call that process. Create that process as a application process. If you are using ApEx4.0 you can create that process as page level.
    This stuff you can call on the population of the delete message...check for the id through javascript then call the function.
    Thanks and Regards
    Maheswara

  • Returning Multiple Rows From DBAdapter Calling PL/SQL Procedure

    Oracle XE 10g Express Edition
    JDeveloper 11.1.1.2.0
    WebLogic Server 11g
    Guys,
    I have a table of orders, which I need to interrogate, and pass back any matching rows which meet certain criteria (e.g. status = 'OPEN').
    However, rather than create a DBAdapter using an Operation Type of "Peform an Operation on a Table/Select", I need to use an Operation Type of "Call a Stored Procedure or Function".
    I therefore need the procedure to return all the matching rows, rather than a single row.
    I have looked at declaring return parameters for the procedure of the following types:
    RECORD - is good because it allows me to return the elements of the row with their correct datatypes, but does not meet my needs because it will only support the return of a single row.
    VARRAY - good because it can contain many row elements, but not good because it only supports a single row return, and also because all elements of the VARRAY must be of the same data type.
    TABLE - good because it can contain many rows, but bad because each row can contain only two elements - the index element and the data element.
    I think I could first define a RECORD (to hold a row), and then define a TABLE, with the data element being the RECORD, but I have found JDeveloper very fussy indeed when dealing with 'non-standard' data types in the DBAdapter.
    Apologies if I am missing something obvious, but can anyone suggest a way of doing this?
    Many thanks in advance.
    Edited by: user2541290 on 17-Feb-2010 02:48

    Hi, I've been able to create process that seems to work. My platform is a but different but I don't think this is important for your question.
    Here is the PL/SQL code. Just make Db Adapter for Calling stored procedure and it returns all rows!
    Be aware of possible limitations on how manyrows you could return in one select! This can have severe impact on performance.
    Succes.
    Jos Baan
    CREATE OR REPLACE PACKAGE lab2_multiple_rows IS
    -- Author : 801455
    -- Created : 18-2-2010 8:05:52
    -- Purpose :
    -- Public type declarations
    TYPE rrows IS RECORD(
    mutdat DATE,
    opmerking VARCHAR2(20));
    TYPE trows IS TABLE OF rrows INDEX BY BINARY_INTEGER;
    -- Public constant declarations
    -- Public variable declarations
    -- Public function and procedure declarations
    FUNCTION retrows RETURN trows;
    END lab2_multiple_rows;
    CREATE OR REPLACE PACKAGE BODY lab2_multiple_rows IS
    -- Private type declarations
    -- Private constant declarations
    -- Private variable declarations
    -- Function and procedure implementations
    FUNCTION retrows RETURN trows IS
    lrows trows;
    lidx binary_integer := 1;
    BEGIN
    FOR rsql IN (SELECT t.* FROM jba_transactions t ORDER BY t.mutdat)
    LOOP
    lrows(lidx).mutdat := rsql.mutdat;
    lrows(lidx).opmerking := rsql.opmerking;
    lidx := lidx + 1;
    END LOOP;
    RETURN(lrows);
    END;
    BEGIN
    -- Initialization
    NULL;
    END lab2_multiple_rows;
    Edited by: Baan, Jos on 18-feb-2010 8:53

  • Jdbc NullPointerException calling pl/sql procedure from java

    Hi.
    Getting the following exception calling a plsql procedure from jdbc.
    - Jdbc version is 10.2.0.2, but it also happens running several other variants, including 10.1.0.5.0.
    - Application is running in Weblogic 8.1.3 (8.1 SP 3).
    The procedure call itself has 2 in/out parameters which are tables (actually just 1 dimensional arrays), which I'm suspecting has something to do with the problem. I can successfully call this procedure using a plsql developer tool with the same bind parameters.
    Any ideas?
    Exception encountered while executing PL/SQL procedure MVT_Web_Inquiry.ShowInquiry:
    java.lang.NullPointerException at oracle.jdbc.driver.T4CTTIiov.processRXD([Loracle.jdbc.driver.Accessor;I[B[C[SILoracle.jdbc.driver.DBConversion;[B[B[[Ljava.io.InputStream;[[[B[[Loracle.jdbc.oracore.OracleTypeADT;Loracle.jdbc.driver.OracleStatement;[B[C[S)[Loracle.jdbc.driver.Accessor;(T4CTTIiov.java:139)
    at oracle.jdbc.driver.T4C8Oall.receive()V(T4C8Oall.java:521)
    at oracle.jdbc.driver.T4CCallableStatement.doOall8(ZZZZ)V(T4CCallableStatement.java:215)
    at oracle.jdbc.driver.T4CCallableStatement.executeForRows(Z)V(T4CCallableStatement.java:1119)
    at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout()V(OracleStatement.java:1278)
    at oracle.jdbc.driver.OraclePreparedStatement.executeInternal()I(OraclePreparedStatement.java:3446)
    at oracle.jdbc.driver.OraclePreparedStatement.execute()Z(OraclePreparedStatement.java:3552)
    at oracle.jdbc.driver.OracleCallableStatement.execute()Z(OracleCallableStatement.java:5261)
    at weblogic.jdbc.wrapper.PreparedStatement.execute()Z(PreparedStatement.java:70)
    at
    [snip]

    OK... I figured it out.
    Apparently, this error happens when you forget to register the output part of an in/out parameter. I would have hoped for better error messaging, but oh well.
    -ed-

  • How to call Pl/sql procedure from form ?

    Hi all,
    I need to call a procedure from form after the user has pressed the button to invoke the sql procedure, can anyone please advise me on how to do it ?
    Thanks.
    Lim

    Hi,
    Thanks for your reply.
    yes, I have include in when-button-pressed trigger as
    AIC_PROC_AR_CCID_UPD;
    Below is my procedure :-
    CREATE OR REPLACE PROCEDURE AIC_PROC_AR_CCID_UPD(errbuf out Varchar2,
              retcode out Number ) is
    VAR_BUF VARCHAR2(240);
    Cursor C1 is
    SELECT CONCATENATED_SEGMENTS ACCT,
    SEGMENT5 SEG5
    FROM AIC_GL_COA AGC
    WHERE AGC.CODE_COMBINATION_ID IS NULL;
    Rec1 C1%RowType;
    BEGIN
    FOR Rec1 IN C1 LOOP
         BEGIN
         UPDATE AIC_GL_COA A SET ( DESCRIPTION, CODE_COMBINATION_ID, SEGMENT5 )=
         ( SELECT FFVT.DESCRIPTION, GLA.CODE_COMBINATION_ID, GLA.SEGMENT5
         FROM GL_CODE_COMBINATIONS_KFV GLA,
         FND_FLEX_VALUES_TL FFVT,
         FND_FLEX_VALUES FFV
         WHERE GLA.CONCATENATED_SEGMENTS = REC1.ACCT
         AND FFV.FLEX_VALUE = REC1.SEG5
         AND FFV.FLEX_VALUE_ID = FFVT.FLEX_VALUE_ID
         AND FFV.FLEX_VALUE_SET_ID = 1002673 )
         WHERE A.SEGMENT5 = REC1.SEG5 ;
         EXCEPTION
         WHEN NO_DATA_FOUND THEN
         FND_FILE.PUT_LINE(FND_FILE.OUTPUT, 'NO RECORD UPDATE !!');     
         END;
    END LOOP;
    COMMIT;
    RETURN;
    END;
    However, when I try to compile it, error prompt :-
    Error 306 at line 1, column 1
    wrong number or types of arguments in call to 'AIC_PROC_AR_CCID_UPD'
    Error 0 at line 1, column 1
    statement ignored.
    By the way, my form 6i is running at client site and connection to procedure in unix server. Will this is ok ?
    Thanks
    Rgds
    Lim

  • How to call PL/SQL procedure from PERL

    I have a requirement to create a PERL wrapper for few PL/SQL procedure.
    Can any one tell me how to call the procedures from PERL ?
    Thanks in advance.
    ....srini

    A quick Google search shows:
    http://www.saturn5.com/~jwb/dbi-examples.html#ora_sp

  • Calling PL/SQL procedure that returns boolean in java

    Hi All,
    Was not sure weather to post this on Java forum threads or PL/SQL forum threads. So posting at both locations.
    I have to call a PL/SQL procedure from java. This PL/SQL has IN/OUT parameters as well as return a Boolean value.
    The procedure definition is as follows:
    FUNCTION GET_NEXT(O_error_message IN OUT VARCHAR2,
    IO_item_no IN OUT ITEM_MASTER.ITEM%TYPE,
    I_item_type IN ITEM_MASTER.ITEM_NUMBER_TYPE%TYPE)
    return BOOLEAN;
    END ITEM_NUMBER_TYPE_SQL;
    And the java function I am using is as follows:
    This is in the ADF Application module impl code
    public String callNextItem(){
    CallableStatement callableStmt = null;
    String rmsUser = getDBTransaction().getConnectionMetadata().getUserName();
    String callableStatement = "begin ? := ITEM_NUMBER_TYPE_SQL.VALIDATE_FORMAT(?,?,?); end;";
    System.out.println("callableStatement "+callableStatement);
    try{
    callableStmt = getDBTransaction().createCallableStatement(callableStatement,0);
    callableStmt.registerOutParameter(1, Types.*BIT*);
    callableStmt.registerOutParameter(2, Types.VARCHAR);
    callableStmt.registerOutParameter(3, Types.VARCHAR);
    callableStmt.registerOutParameter(4, Types.VARCHAR);
    callableStmt.setBoolean(1, false);
    callableStmt.setString(2, "");
    callableStmt.setString(3, "");
    callableStmt.setString(4, "UPC-A");
    callableStmt.executeUpdate();
    System.out.println("STATUS : " + callableStmt.getString(3));
    System.out.println("ERROR : " + callableStmt.getString(2));
    String status = "";
    getDBTransaction().commit();
    System.out.println("commited ");
    callableStmt.close();
    return status;
    }catch(SQLException e){
    System.out.println("Error:" +e);
    throw new JboException(e);
    But this function never works. Throws "not valid expression type" error.
    I have called several PL/SQL procedures before, only difference being
    they never used to return any value. Particularly I feel the cause of the
    error is the Boolean type that is returned from the procedure.
    If you have any idea, please help.

    http://www.oracle.com/technology/tech/java/sqlj_jdbc/htdocs/jdbc_faq.html#34_05

Maybe you are looking for