How to execute a stored procedure using Nqcmd

hi everyone,
I am having a stored procedure in Database which i want to execute it from nqcmd. Could anyone pls let me know how to execute it.
Regards

EJB3 JPA does not define stored procedure execution. There is a native query in JPA, but this is mainly for SQL. If you stored procedure has no output parameters you can normally get away with using a native query to execute it (be sure to include BEGIN/END in Oracle).
<p>
In TopLink 11g preview there are JPA extensions for defining stored procedures. You can use the @NamedStoredProcedureQuery for this, and then access the named query by name and execute it. You can also create an instance of a TopLink StoredProcedureCall and set it in your JPA Query through the TopLink Query extension setDatabaseQuery(), or define the named stored procedure query using a DescriptorCustomizer.
<p>
In TopLink Essentials there is no direct stored procedure support, so you would need to use JDBC directly.
<p>
If you are using a DataSource in your application the best way to get a JDBC connection is to use your DataSource directly. If the DataSource is JTA managed this will be the same connection that TopLink writes with.
<p>
If you need to get the connection directly from TopLink you can use,
((oracle.toplink.<essentials>.ejb.cmp3.EntityManager)entityManager.getDelegate()).getUnitOfWork().getConnection();
<p>
You may need to first call, UnitOfWork.beginEarlyTransaction(), (also ensure you release the uow connection).
<p>
<p>---
<p>James Sutherland

Similar Messages

  • How to execute MYSQL stored procedure  using java

    Hello friend
    I am very new to MYSQL stored procedure how to call external stored procedure , from where i got good tutorials about MYSQL stored procedure and JAVA

    If you need help with MYSQL or stored procedures this is not the place. If you need help with JDBC:
    http://java.sun.com/docs/books/tutorial/jdbc/basics/index.html

  • Need an Example for How to call a Stored Procedure using DBAdapter

    Hi
    I am trying to invoke a stored procedure in Oracle Database using DB Adapter. I have successfully invoked and when i try to run it i got the following error.
    oracle.sysman.emSDK.webservices.wsdlapi.SoapTestException: Client received SOAP Fault from server : Exception occured when binding was invoked.
    Exception occured during invocation of JCA binding: "JCA Binding execute of Reference operation 'ExecuteScript' failed due to:
    Stored procedure invocation error.
    Error while trying to prepare and execute the RESONANCEDEMO.SP_QUERY API.
    An error occurred while preparing and executing the RESONANCEDEMO.SP_QUERY API. Cause: java.sql.SQLSyntaxErrorException: ORA-00917: missing comma
    ORA-06512: at "RESONANCEDEMO.SP_QUERY", line 7
    ORA-06512: at line 1
    Check to ensure that the API is defined in the database and that the parameters match the signature of the API.
    This exception is considered not retriable, likely due to a modelling mistake.
    To classify it as retriable instead add property nonRetriableErrorCodes with value "-917" to your deployment descriptor (i.e. weblogic-ra.xml).
    To auto retry a retriable fault set these composite.xml properties for this invoke: jca.retry.interval, jca.retry.count, and jca.retry.backoff.
    All properties are integers.
    I am trying to have a Out Parameter in my Procedure. Please provide me an example on how to invoke a Stored Procedure using Out Paramter using DB Adapter.

    Hi,
    It looks more like an Oracle error and not within the DbAdapter.
    Try to test first your procedure from PL/SQL or other developer you are using.
    Arik

  • How to execute a stored procedure every 5 minutes in biztalk admin console

    Hi 
    how to execute a stored procedure every 5 minutes in biztalk admin console without using biztalk orchestration
    we need to update table data every 5minutes 
    please replay asap...........
    thanks advance....

    WCF adapter is best suited for the same. Use ‘Template’ feature of WCF adapter. Template is mainly used to add wrapper elements around the body of the outgoing message from send port.
    Below mentioned post is perfectly suited for you.
    http://social.technet.microsoft.com/wiki/contents/articles/19845.invoke-a-sql-stored-procedure-on-the-biztalk-wcf-send-port-without-needing-an-orchestration.aspx
    Regards,
    Rachit
    If this answers your question please mark it accordingly. If this post is helpful, please vote as helpful by clicking the upward arrow mark next to my reply.

  • How to execute oracle stored procedure through php as externally?

    hi...
    i am searching for the way that how to execute oracle stored procedure through web service, i am using php and mysql, i have some stored procedures in oracale database, i want to execute them, from php, means the database will be remain mysql, and the stored procedures of oracle will be executed externally...
    Kind regards,
    Wilayat.

    Ok, so first of all this is a kind of strange question. Since Oracle and MYSQL can happily live side by side.
    Make sure you have the oracle client (instant or regular ) installed and OCI_8 is set up and working correctly in PHP. If it is, when you run the phpinfo() routine you will see oci_8 on there. IF PHP connects just fine from the command line yet apache wont connect check permissions and things like the LD_Library Path.
    Then in php, right along with your MySQL statements run Oracle Statements eg:
    <?php
    $OraDB = oci_connect(name,pass,tnsname);
    $MySQLdb = mysql_connect([parms]);
    $oraQueryText = "begin sp_some_proc([some parms]); end;" ;
    $mysqlQuery = " Some mysql Query";
    $oraQuery = oci_parse($OraDB,$oraQueryText );
    oci_execute($oraQuery);
    mysql_execute([parms]);
    ?>
    Use the standard fetch code to get data from either of them.
    If you cannot and I mean absolutely cannot get an admin to link in OCI_8 then you still have recourse although it will be tedious as hell. PHP allows you to exec calls to the OS. You still MUST make sure the Oracle Client is installed and that sqlplus runs from the command line. You will more then likely have to have a shell script written to do this as well, but maybe not as I have never tried it with the exception of capturing the return value of sqlplus and you will have to dig into sqlplus to get it to send its results to a file you can then parse with php.
    Good Luck!

  • How to call a stored procedure using its package name in Oracle

    hi
    we're doing a JDBC scenario where we call a stored procedure(a.prc) using its package name(b)The stored procedure has In /Out/IN-OUT parameter.
    i have got 2 queries:
    1- How to call the stored procedure using it's package.
    2- How to capture the In/Out parameter in the response.

    hi Prateek
    thanks for the reply.
    However when i tried mapping it to Package.procedure, communication channel throws the error saying that Package.proceudre needs to be declared.
    As i said , the procedure has IN-OUT parameter too.In oracle we need to write a block if we want to read the IN-OUT parameter.
    How to get the IN-OUT parameter in XI?

  • How to execute a stored procedure/function in TOAD?

    Hi, All ,
    Can someone please tell me how to execute a stored procedure/function in TOAD?
    I have tired
    EXECUTE PROCEDURENAME(888), but it doesn’t work.
    TOAD give me the error: invalid SQL statement.
    Thanks a lot

    Write PL/SQl block.
    i.e Begin
    Procedure name..
    end;
    Then it will be excuted.
    Ashutosh

  • Is it possible to execute a stored procedure using the JDBC adapter?

    Hi all,
    Can anybody confirm whether we can execute a stored procedure created in a database using the processing parameters of a JDBC adapter of a communication channel?
    If yes, then please let me know how (may be with an example)
    Thanks.

    Yes, that is possible. You have to chose EXECUTE in the action field to execute the stored procedure. Here's a little piece on the JDBC receiver:
    JDBC Receiver
    For writing data to an SQL database you also need to define a strict data type. The general format is like this:
        <ns:MT_RECORDSET>
              <STATEMENT>
                   <TABLE_NAME ACTION="">
                        <TABLE/>
                        <ACCESS>
                             <FIELD1/>
                             <FIELD2/>
                             <FIELDn/>
                        </ACCESS>
                        <KEY>
                             <ID compareOperation=""/>
                             <FIELDx compareOperation=""/>
                        </KEY>
                   </TABLE_NAME>
              </STATEMENT>
    </ns:MT_RECORDSET>
    This recordset represents an SQL statement like "update TABLE1 set FIELD1=123, FIELD2=456, FIELDn='xyz' where ID=12345 and FIELDx is NULL"
    MT_RECORDSET is the name of the Message Type used.
      For the value of the attribute ACTION you can choose from the following values:
         UPDATE : updates the given fields in the table with their new values
         INSERT : insert the given fields as a new row in the table
         UPDATE_INSERT : insert rows in the table when update is not possible
         DELETE : deletes given fields from the table
         SELECT : selects given fields from the table. Note that this option returns a response in the JDBC Sender form!
         EXECUTE : execution of a stored SQL procedure
         SQL_QUERY | SQL_DML : option to transfer more complex SQL statements to the database
      The attribute compareOperation can have the following values:
         EQ : equal
         NEQ : not equal
         LT : less than
         LTEQ : less than or equal to
         GT : greater than
         GTEQ : greater than or equal to
         LIKE : used to compare strings

  • How to execute an Stored procedure in SQLDeveloper?

    Hi
    Thank you for reading my post
    I want to know how i can execute an Stored procedure in SQL developer 1.1.0.21
    for example those sotred procedure from HR schema.
    one of them is add_job_history
    when i click on it and select run i see a new dialog with some sql as follow:
    DECLARE
      P_EMP_ID NUMBER;
      P_START_DATE DATE;
      P_END_DATE DATE;
      P_JOB_ID VARCHAR2(10);
      P_DEPARTMENT_ID NUMBER;
    BEGIN
      P_EMP_ID := NULL;
      P_START_DATE := NULL;
      P_END_DATE := NULL;
      P_JOB_ID := NULL;
      P_DEPARTMENT_ID := NULL;
      HR.ADD_JOB_HISTORY(
        P_EMP_ID => P_EMP_ID,
        P_START_DATE => P_START_DATE,
        P_END_DATE => P_END_DATE,
        P_JOB_ID => P_JOB_ID,
        P_DEPARTMENT_ID => P_DEPARTMENT_ID
    END;I checked the help and it said i should replace =>P_emp_id with some number
    I did that and i get error.
    can some one give me a sample for executing this procedure?
    thanks

    Remove the NULL values with the data you want to use in the SP.
    BEGIN
    P_EMP_ID := 32;
    P_JOB_ID := 'boss';
    For the date you have to chose the approriate string....

  • Executing a stored procedure using a button within a region

    Hello APEX Users:
    I have the task of creating a link within an apex region to execute a stored procedure from another schema using two arguments. What is the best method of executing a procedure in apex using a link or button? Thanks.
    Ben

    Stop posting follow-ups to closed/old threads.
    <li>Other users may ignore the thread as it appears to be closed
    <li>Your assumption that the questions are related may be incorrect, leading to confusion about the nature of the problem and potential solutions.
    <li>Watches on the thread may have expired, so the original participants may be unaware of the new post, or they may no longer be active on the forum
    <li>APEX Phone Test
    <li>You have no ability to mark posts as helpful or correct
    Post your question as a new thread, including the following information:
    <li>APEX version
    <li>DB version and edition
    <li>Web server architecture (EPG, OHS or APEX listener)
    <li>Browser(s) used
    <li>Theme
    <li>Templates
    <li>Region type
    <li>Links to related posts and threads using the methods in the FAQ.
    Your question has NOTHING to do with this thread.
    And update your forum profile with a better handle than "862509".

  • How to call java stored procedure using RMI?

    Is it possible to make a call to java stored procedure using RMI. ?
    How can I run the RMI registry on the Oracle Server ?

    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by Thomas Grounds ([email protected]):
    Is it possible to make a call to java stored procedure using RMI. ?
    In principle it is possible. See the Java-Doc.s of Oracle 8.1.6.
    I have successful granted the java.net.SocketPermissions in my USER_JAVA_POLICY view (see Doc.) Now I was able to use the RMI-Sockets, but following
    failure try to connect to RMI-Object via RMIregistry an Oracle Error occurs
    ORA-03113: end-of-file on communication channel
    and after that my Oracle Connection is closed.
    How can I run the RMI registry on the Oracle Server ?<HR></BLOCKQUOTE>
    I think you do not need the RMI registry on Oracle Server. It should be possible to start the RMI registry wherever you want in your network and access it via the right registry string.
    Ciao
    Margit
    null

  • How to execute a stored procedure with an out parameter ?

    Guys I am struggling with executing a stored procedure from sql plus.I mean my stored procedure has 2 input parameter and 1 out put parameter (status of the execution).
    MY_PROCEDURE(p_name in varchar2,p_age in number,p_status out varchar2)
    end my_procedure;
    When I say
    EXECUTE MY_PROCEDURE('manohar','Shetty');
    i get insufficient parameters errors.
    please help.

    EXECUTE isn't a valid PL/SQL construct. It's a SQL*Plus command. You don't want to put any SQL*Plus commands in a PL/SQL block.
    You can always execute a stored procedure purely through PL/SQL
    begin
      my_stored_procedure( x, y, z );
    end;SQL*Plus happens to give you the execute command so you can avoid the begin and end statements.
    Justin

  • How to execute plsql stored procedure with DbAccess

    sessionInfo object can give DbAccess .through
    which u can use javax.infobus.DbAccess API to
    execute sql satement and stored procedures according to infobus API .iam able to
    execute simple query by using executeCommand() ,executeRetrival() ?. how to execute stored procedures with executeRetrieval() .
    how to take in and out parameters
    suggestions are welcome
    waiting for your suggestions

    I am also looking for the same.
    Did you get any info on this
    Thanks,
    jagan
    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by chandra sekhar ([email protected]):
    sessionInfo object can give DbAccess .through
    which u can use javax.infobus.DbAccess API to
    execute sql satement and stored procedures according to infobus API .iam able to
    execute simple query by using executeCommand() ,executeRetrival() ?. how to execute stored procedures with executeRetrieval() .
    how to take in and out parameters
    suggestions are welcome
    waiting for your suggestions<HR></BLOCKQUOTE>
    null

  • Can't execute Oracle Stored Procedure using JDBC

    Hi all,
    I'm fairly new to JDBC and Oracle, so pardon my ignorance/lack of knowledge in this subject matter. I am trying to call a stored procedure named get_countries that has no parameters using JDBC. I do this by executing the following lines of code:
    CallableStatement cs = con.prepareCall("{call get_countries}");
    ResultSet rs = cs.executeQuery();But I get the following exception thrown:
    Exception in thread "main" java.sql.SQLException: ORA-06550: line 1, column 7:
    PLS-00306: wrong number or types of arguments in call to 'GET_COUNTRIES'
    ORA-06550: line 1, column 7:
    PL/SQL: Statement ignored
    at oracle.jdbc.driver.DatabaseError.throwSqlException(_DatabaseError.java:112_)
    at oracle.jdbc.driver.T4CTTIoer.processError(_T4CTTIoer.java:331_)
    at oracle.jdbc.driver.T4CTTIoer.processError(_T4CTTIoer.java:288_)
    at oracle.jdbc.driver.T4C8Oall.receive(_T4C8Oall.java:745_)
    at oracle.jdbc.driver.T4CCallableStatement.doOall8(_T4CCallableStatement.java:218_)
    at oracle.jdbc.driver.T4CCallableStatement.executeForRows(_T4CCallableStatement.java:969_)
    at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(_OracleStatement.java:1190_)
    at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(_OraclePreparedStatement.java:3370_)
    at oracle.jdbc.driver.OraclePreparedStatement.executeQuery(_OraclePreparedStatement.java:3415_)
    at JDBCTest.main(_JDBCTest.java:44_)
    This makes no sense to me because there are no parameters that I need to pass. So I'm guessing this is something that I don't know about JDBC or about Oracle. I've searched Google for the past hour and a half and still haven't found anything that explains what might be the problem. I've also been following this guide ([http://java.sun.com/docs/books/tutorial/jdbc/basics/sql.html]) and I'm doing it exactly the same way, but for some reason it works for them.
    Anyone know what I'm doing wrong?
    Thanks for your help in advance. I really appreciate it!

    I went to a few forums and asked the same question. The boys down at Oracle Community Forums shed some light on this subject and, with their help, I was able to figure it out. Here is the thread for those who want to read: [My Thread @ Oracle Community Forums|http://forums.oracle.com/forums/thread.jspa?messageID=2721348?].
    THE SOLUTION
    cs = con.prepareCall("{ call get_countries(?) }");
    cs.registerOutParameter(1, OracleTypes.CURSOR);
    cs.execute();
    ResultSet rs = ((OracleCallableStatement) cs).getCursor(1);

  • How to call Oracle Stored Procedure using EDQ

    Can someone tell me how to use Oracle Stored Procedure call in EDQ, sample scripts/steps will be really helpful. Thanks!

    It is also possible to do this using a custom processor in EDQ. The processor needs to do something very similar to the external task above (opens a DB connection, authenticates, runs a stored procedure).
    If you need this, please talk us through the use case so we can determine if it is the best fit. In some ways, an external task is better as logically a stored procedure call is normally divorced from any process logic in EDQ.
    Regards,
    Mike

Maybe you are looking for