Execute a Store procedure using Database scheduler.

Hello Experts,
I want to create a Database schedule job that will trigger a stored procedure after say 60 mins
Please provide any pointers or help to accomplish this.
thanks

Hi,
Please try like this.....!!!
SQL>CONN SYS/PASSWORD  AS SYSDBA;
CONNECTED
SQL> ED SAMPLE;
CREATE OR REPLACE PROCEDURE SAMPLE AS
BEGIN
UPDATE SCOTT.EMP SET SAL= SAL+300 WHERE ENAME='ALLEN';
COMMIT;
END;
SQL> ED JOB;
declare
begin
  DBMS_SCHEDULER.create_job (
    job_name        => 'SA',
    job_type        => 'STORED_PROCEDURE',
    job_action      => 'SAMPLE',
    start_date      => SYSTIMESTAMP,
    repeat_interval => 'freq=Hourly; INTERVAL=60',
    end_date        => NULL,
    enabled         => TRUE,
    comments        => 'Job defined entirely by the CREATE JOB procedure.');
end;KPR

Similar Messages

  • How to use ADO(Microsoft ActiveX Data Objective 2.8 Library) to execute the store procedure of database in SQL server

    how to use ADO(Microsoft ActiveX Data Objective 2.8 Library) to execute the store procedure of database in SQL server?
    Does any body can tell me about this?
    thanks
    [email protected]

    Hi 
    Did you succeed to execute the procedure?
    How ?
    Thanks
    Shimon Zerbib

  • Execute ORACLE STORE PROCEDURE from DATABASE

    Hi Everyone...
    i have a store procedure, it has a 5 params, 3 are IN parameters and 2 left are OUT parameters, I need execute this store procedure using a SQL Intruction like this
    DECLARE integracion_sia_kac PROCEDURE FOR KACTUS.SP_SIAKAC_NMDHODO
    :ll_horario,
    :ll_ide_doc,
    :ls_con_kac,
    @PINDREGI=:ls_ind_registro output, @PVALERRO=:ls_error_int output
    USING gt_kactus;
    i think this function is using from MSSQL Server, this has a three IN params but the declaration of the OUT params I don't understand.
    HELP ME!!!!!.... I need know way to execute the SP
    Thanks

    Well it is very simple!
    example:
    CREATE OR REPLACE PROCEDURE PROC1 (P1 IN NUMBER, P2 IN NUMBER, P3 OUT NUMBER) IS
    BEGIN
    P3 := P1 + P2;
    END;
    This is how to use PROC1 from, say, PROC2 :
    CREATE OR REPLACE PROCEDURE SomeShema.PROC2 IS
    Var1 NUMBER(15,2);
    Var2 NUMBER(15,2);
    ReturnParamFromPROC1 NUMBER(15,2);
    BEGIN
    Select SomeField INTO Var1 from Table1 where Table1.ID = 10;
    Select SomeField INTO Var2 from Table2 where Table2.ID = 20;
    PROC1(Var1, Var2, ReturnParamFromPROC1);
    DBMS_OUTPUT.PUT_LINE('Returned value from PROC1 is : '||ReturnParamFromPROC1);
    END;

  • HOW TO EXECUTE A STORE PROCEDURE THAT RETURN MULTIPLE ROWS FROM A QUERY

    I NEED TO CREATE AND USE A STORE PROCEDURE THAT IS GOING TO DO A SELECT STATEMENT AN THE RESULT OF THE SELECT STATEMENT IS RETURN IN SOME WAY TO THE REQUESTER.
    THIS CALL IS MADE BY AN EXTERNAL LANGUAGE, NOT PL/SQL OR FORMS APPLICATION. USING FOR EXAMPLE ODBC AND VISUAL BASIC. WHAT I NEED TO DO IS ADD A DATA ACCESS LAYER TO MY APPLICATION AND I ALREADY HAVE IT DONE FOR MS SQL SERVER, BUT I NEED THE SAME FUNCTIONALITY ACCESSING AN ORACLE DATABASE.
    FLOW:
    1. VB CREATE A ODBC CONNECTION TO A ORACLE DATABASE
    2. VB EXECUTE A STORE PROCEDURE
    3. THE STORE PROCEDURE RETURNS TO THE VB APPLICATION THE RESULT OF THE QUERY THAT IS INSIDE OF THE STORE PROCEDURE.(I.E. THE STORE PROCEDURE IS A BASIC SELECT, NOTHING COMPLEX)
    4. VB DISPLAY THE RESULT IN A GRID
    FOR SURE I CAN DO THE SELECT DIRECTLY TO ORACLE, BUT FOR PERFORMANCE REASONS AND SCALABILITY, I'LL LIKE IT TO DO IT USING A STORE PROCUDURES
    IS THIS POSIBLE?, HOW?
    THANKS

    Certainly, it's possible. First, define a stored procedure that includes an OUT parameter which is a REF CURSOR. Then, call the stored procedure via ODBC omitting the OUT parameter from the list of parameters. IT will automatically be returned as a result set. Syntax for both is below...
    CREATE PROCEDURE foo (inParam in varchar2, resultSet OUT REF CURSOR )
    In ODBC:
    {call foo( 'someData' )}
    Justin

  • Can't execute Sybase store procedure

    Hi All,
    I'm trying to execute sybase store procedure, but somehow the procedure not executing. if any body what's the problem? I'm using JBoss server
    Code:
    public void deleteRigMapSP(String pMappingID, String rigid, String date,String pPhysicalDel, String database) throws DataAccessException {
    GregorianCalendar val = new GregorianCalendar();
    DateFormatter dateform = new DateFormatter();
    String deletiondate = dateform.convertGregorianToString(val);
    query = new StringBuffer("EXECUTE spRR_STAT_DeleteMapping ");
    query.append("'"+pMappingID + "',");
    query.append(null + ",");
    query.append(null + ",");
    query.append(null + ",");
    query.append(null + ",");
    query.append(null + ",");
    query.append(null + ",");
    query.append("'"+deletiondate + "',");
    query.append(pPhysicalDel);
    System.out.println("query: "+query);
    try {
         getDBConnection(ServiceLocator.getInstance().getDataSource(database));
         CallableStatement cs = dbConnection.prepareCall(query.toString());
    if (cs.execute()) {
              System.out.println("deleted");
         } else {
              System.out.println("not deleted");
    When I try to execute the method it's run fine, but it not executing the procedure.
    Any help will be greately appreciated.

    How do you know it's not executing? Maybe you're in manual transaction mode and you're not committing the transaction before you close the connection and it gets rolled back.
    And why on earth are you using CallableStatement if you're embedding the parameters into the SQL query rather than using placeholders and the setXXX() methods?
    Alin.

  • I want to know the top 10-20 Store procedures used in the table.

    Hello All, 
    There are total 3500+ Store procedures created in the server. So,  I want to know the top 10-20 Store procedures used in the table. Like which store procedures are important and what are they, is there any code to find them? 
    I think the question might be very silly, but i don't know which store procedure to look at it. 
    Please help me on this issue.
    Thanks.
    Thanks, Shyam.

    By what? CPU? Memory? Execution count?
    Glenn Berry wrote this
    -- HIGH CPU ************
          -- Get Top 100 executed SP's ordered by execution count
          SELECT TOP 100 qt.text AS 'SP Name', qs.execution_count AS 'Execution Count',  
          qs.execution_count/DATEDIFF(Second, qs.creation_time, GetDate()) AS 'Calls/Second',
          qs.total_worker_time/qs.execution_count AS 'AvgWorkerTime',
          qs.total_worker_time AS 'TotalWorkerTime',
          qs.total_elapsed_time/qs.execution_count AS 'AvgElapsedTime',
          qs.max_logical_reads, qs.max_logical_writes, qs.total_physical_reads, 
          DATEDIFF(Minute, qs.creation_time, GetDate()) AS 'Age in Cache'
          FROM sys.dm_exec_query_stats AS qs
          CROSS APPLY sys.dm_exec_sql_text(qs.sql_handle) AS qt
          WHERE qt.dbid = db_id() -- Filter by current database
          ORDER BY qs.execution_count DESC
          -- HIGH CPU *************
          -- Get Top 20 executed SP's ordered by total worker time (CPU pressure)
          SELECT TOP 20 qt.text AS 'SP Name', qs.total_worker_time AS 'TotalWorkerTime', 
          qs.total_worker_time/qs.execution_count AS 'AvgWorkerTime',
          qs.execution_count AS 'Execution Count', 
          ISNULL(qs.execution_count/DATEDIFF(Second, qs.creation_time, GetDate()), 0) AS 'Calls/Second',
          ISNULL(qs.total_elapsed_time/qs.execution_count, 0) AS 'AvgElapsedTime', 
          qs.max_logical_reads, qs.max_logical_writes, 
          DATEDIFF(Minute, qs.creation_time, GetDate()) AS 'Age in Cache'
          FROM sys.dm_exec_query_stats AS qs
          CROSS APPLY sys.dm_exec_sql_text(qs.sql_handle) AS qt
          WHERE qt.dbid = db_id() -- Filter by current database
          ORDER BY qs.total_worker_time DESC
    Best Regards,Uri Dimant SQL Server MVP,
    http://sqlblog.com/blogs/uri_dimant/
    MS SQL optimization: MS SQL Development and Optimization
    MS SQL Consulting:
    Large scale of database and data cleansing
    Remote DBA Services:
    Improves MS SQL Database Performance
    SQL Server Integration Services:
    Business Intelligence

  • How to execute a store procedure automatically every day

    NT4 and Oracle816,I wanna let Oracle execute a store procedure automatically every day.
    How to do it?
    Thanx.

    There are a few ways to do this: first of all you could write a script file and schedule it to run every night.
    Another solution is to use the DBMS_JOB package. Refer to the documentation to see how it is used

  • 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 load and define Java Store Procedures using Consolidator Manager??

    Hi,
    I am trying to create a store procedure with a very easy example and I can not succeed. i am a bit new with OLite and I will appreciate any help from your side. I am quite lost now regarding of using java with OLite and it is becoming quite urgent for me. Thanks a lot in advanced.
    Those are the steps that I follow:
    - Creating the java class
    I create the java file MYUPPER.java with next code :
    public class MYUPPER {
    public static String doUpper( String p_text )
    return p_text.toUpperCase();
    I compile it and I create the jar file:
    C:\>javac MYUPPER.java
    C:\>jar cf MYUPPER.jar MYUPPER.class
    - This is an abstract of my java code using the API:
    ( m_cm is ConsolidatorManager)
    // Create the java resource
    m_cm.createStoredProc( "MYUPPER.jar", "MYUPPER", "doUpper", "doUpper");
    // Add it to the publication
    m_cm.addJavaResource( "PMTS", "MYUPPER" );
    - After running that code I do not receive any exception and checking into the repository looks ok:
    a) From the Mobile Server I can see the Java Ressource MYUPPER for that publication
    b) I can see the entries in C$Resouces and in C$Pub_Objects as well
    *** ON THE CLIENT:
    Then I go to the client device a Windows XP labtop where I did install the jre 5.0 and I added the bin path to the system variable PATH.
    - I get a POL-8000 error when synchronizing (could not start the Java Visrtual Machine)
    - Anyway, I can see the MYUPPER.class file deployed in the same directory than the databases are.
    - I have also tried next from msql:
    c:\>msql system/manager@jdbc:polite:tomeu_conscli
    Oracle Lite MSQL Version 10.3.0.2.0
    Copyright (c) 1997, 2008, Oracle. All rights reserved.
    Connected to: Oracle Lite ORDBMS
    Database Name: CONSCLI (Read Write)
    Database Version: 10.3.0.2.0
    Auto Commit: off
    Driver Name: oracle.lite.poljdbc.POLJDBCDriver (OLite 4.0)
    SQL> select * from c$resources;
    PUB_NAME | DB_NAME | RESOURCE_NAME | RESOURCE_TYPE | RESOURCE_DATA
    PMTS | pmts | MYUPPER | JAVA CLASS | -¦¦¥ 1
    1 row(s) returned
    SQL>
    SQL> exit
    Disconnected from CONSCLI
    c:\>msql system/*****@jdbc:polite:tomeu_pmts
    Oracle Lite MSQL Version 10.3.0.2.0
    Copyright (c) 1997, 2008, Oracle. All rights reserved.
    Connected to: Oracle Lite ORDBMS
    Database Name: PMTS (Read Write)
    Database Version: 10.3.0.2.0
    Auto Commit: off
    Driver Name: oracle.lite.poljdbc.POLJDBCDriver (OLite 4.0)
    SQL> select doUpper('fhjdjf') from dual;
    [POL-8035] no such attribute or method
    SQL> create table sp (id number(1) primary key );
    Table created
    SQL> alter table sp attach java source "MYUPPER" in '.';
    [POL-8028] error in calling a Java method
    SQL> commit;
    Commit complete
    SQL> select sp.doUpper('fhjdjf') from dual;
    [POL-8035] no such attribute or method
    Lost... :(
    Tomeu

    sorry to bother, similar like above, i tried many times on my computer to load a simple image in java application.. here's my code:
    import java.awt.*;
    import java.awt.event.*;
    import java.awt.image.*;
    import java.io.*;
    import java.net.*;
    import javax.swing.*;
    public class View extends JFrame {
         private URL imageURL;
         private File file;
         private Image sourceImage;
         private String name, title, message;
         private int width, height;
        public static void main(String[] args) {
            System.out.println( "Hello Eros!!!" );
            View img = new View();
        public View() {
             name = "D:/shared/inputpic.gif";
             file = new File( name );
            Toolkit toolkit = Toolkit.getDefaultToolkit();
            try {
                imageURL = new URL("http://www.google.com.my/images/logo_sm.gif" );
            } catch (MalformedURLException e) {
            if ( file == null ) {
                sourceImage = Toolkit.getDefaultToolkit().getImage( name );
                System.out.println( file );
            } else {
                sourceImage = toolkit.getImage( imageURL );
                System.out.println( file );
            width = sourceImage.getWidth( this );
            height = sourceImage.getHeight( this );
            System.out.println( "Pixel = " + width + "x" + height );
            if ( width * height == 1 ) {
                title = "Greetings";  // Shown in title bar of dialog box.
                if ( file == null ) {
                    message = "Unable to load the file " + name;
                } else {
                    message = "Unable to load the link " + imageURL;
                JOptionPane.showMessageDialog(null, message, title, JOptionPane.INFORMATION_MESSAGE);
    }could anyone test this n give my the reason i couldnt even load the image

  • Problem of retrieve a set of data when calling store procedure using vb with ODBC

    when I use ODBC, it can return 1 record (1 field) using pass and retrieve the parameter. but it cannot success when return a set of data (using recordset to store it), when i do it, the error message (Multiple-step OLE DB operation generated errors. Check each OLE DB status value, if availabl. No work was done.). Why ? and how can solve it ?\
    Thanks in advance.

    oh, really ? it is not use ODBC to connecto to oracle ?
    Here is my program code:
    STORE PROCEDURE:
    PROCEDURE getInforcePolicy(PClient_ID IN VARCHAR2, PPolicy_No IN VARCHAR2, BasicCur OUT oraoledb.m_refcur, RiderCur OUT oraoledb.m_refcur)
    IS
    BEGIN
    OPEN BasicCur FOR SELECT * FROM
    inforce200111 WHERE Client_ID = PClient_ID and Policy_No = PPolicy_No and coverage_No = 1;
    OPEN RiderCur FOR SELECT * FROM
    inforce200111 WHERE Client_ID = PClient_ID and Policy_No = PPolicy_No and coverage_No <> 1;
    END getInforcePolicy;
    PACKAGE oraoledb AS
    TYPE m_refcur IS REF CURSOR;
    END oraoledb;
    Program:
    Dim cn As New ADODB.Connection
    Dim rs As New ADODB.Recordset
    Dim rs2 As New ADODB.Recordset
    Dim cmd As New ADODB.Command
    Dim paramclient As New ADODB.Parameter
    Dim parampolicy As New ADODB.Parameter
    Dim I As Integer
    cn.Open "ridev", "abc","abc"
    cmd.ActiveConnection = cn
    Set paramclient = cmd.CreateParameter("PClient", adVarChar, adParamInput, 10)
    Set parampolicy = cmd.CreateParameter("PPolicy", adVarChar, adParamInput, 10)
    paramclient.Value = "0000023011"
    parampolicy.Value = "HK0010021U"
    cmd.Parameters.Append paramclient
    cmd.Parameters.Append parampolicy
    cmd.CommandText = "{call getInforcePolicy}"
    Set rs = cmd.Execute
    Do While Not rs.EOF
    Loop
    Set rs2 = rs.NextRecordset
    Do While Not rs2.EOF
    loop
    Where the RIDEV is a datasource that created from Data Source in Control Panel using the driver call "Microsoft ODBC for ORACLE"

  • 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

  • (Resolved) How to execute 2 store procedures in 1 transaction?

    public void method1(){
    Session session = getSessionFactory().acquireSession();
    StoredProcedureCall spc1 = new StoredProcedureCall();
    spc1.setProcedureName("PKG.SP1");
    spc1.addNamedArgumentValue("param", "aaa");
    session.executeNonSelectingCall(spc1);
    StoredProcedureCall spc2 = new StoredProcedureCall();
    spc2.setProcedureName("PKG.SP2");
    spc2.addNamedArgumentValue("param", "bbb");
    session.executeNonSelectingCall(spc2);
    The above method is defined in SessionFacadeBean (just like the EJB in SRDemo),
    I want the above 2 procedures executed in 1 transaction. If spc2 failed, the spc1 should not be committed. How can I do this?
    Regards,
    Jason
    Message was edited by:
    Jason.Lu

    I have changed code as follows:
    public void method1(){
    DatabaseSession session = getSessionFactory().getSharedSession();
    session.beginTransaction();
    try{
    StoredProcedureCall spc1 = new StoredProcedureCall();
    spc1.setProcedureName("PKG.SP1");
    spc1.addNamedArgumentValue("param", "aaa");
    session.executeNonSelectingCall(spc1);
    StoredProcedureCall spc2 = new StoredProcedureCall();
    spc2.setProcedureName("PKG.SP2");
    spc2.addNamedArgumentValue("param", "bbb");
    session.executeNonSelectingCall(spc2);
    } catch (Exception e) {
    session.rollbackTransaction();
    } finally {
    session.release();
    It seems that the "session.rollbackTransaction();" will be executed if spc2 fails.
    toplink logs are as follows:
    [TopLink Info]: 2007.11.12 10:20:36.690--ServerSession(1901666)--Thread(Thread[HTTPThreadGroup-4,5,HTTPThreadGroup])--default login successful
    [TopLink Finer]: 2007.11.12 10:20:36.690--ServerSession(1901666)--Thread(Thread[HTTPThreadGroup-4,5,HTTPThreadGroup])--TX beginTransaction, status=NO_TRANSACTION
    [TopLink Finer]: 2007.11.12 10:20:36.705--ServerSession(1901666)--Thread(Thread[HTTPThreadGroup-4,5,HTTPThreadGroup])--TX Internally starting
    [TopLink Finer]: 2007.11.12 10:20:36.705--ServerSession(1901666)--Thread(Thread[HTTPThreadGroup-4,5,HTTPThreadGroup])--external transaction has begun internally
    [TopLink Fine]: 2007.11.12 10:20:36.705--ServerSession(1901666)--Connection(11203640)--Thread(Thread[HTTPThreadGroup-4,5,HTTPThreadGroup])--BEGIN PKG.SP1(param=>'aaa'); END;
    [TopLink Fine]: 2007.11.12 10:20:36.971--ServerSession(1901666)--Connection(22861541)--Thread(Thread[HTTPThreadGroup-4,5,HTTPThreadGroup])--BEGIN PKG.SP2(param=>'bbb'); END;
    [TopLink Warning]: 2007.11.12 10:20:37.440--ServerSession(1901666)--Thread(Thread[HTTPThreadGroup-4,5,HTTPThreadGroup])--Local Exception Stack:
    Exception [TOPLINK-4002] (Oracle TopLink - 10g Release 3 (10.1.3.3.0) (Build 070608)): oracle.toplink.exceptions.DatabaseException
    Internal Exception: java.sql.SQLException: ORA-06550: line 1, column 7:
    PLS-00306: wrong number or types of arguments in call to 'SP2'
    ORA-06550: line 1, column 7:
    PL/SQL: Statement ignored
    Error Code: 6550
    [TopLink Finer]: 2007.11.12 10:20:37.455--ServerSession(1901666)--Thread(Thread[HTTPThreadGroup-4,5,HTTPThreadGroup])--TX rollbackTransaction, status=STATUS_ACTIVE
    [TopLink Finer]: 2007.11.12 10:20:37.455--ServerSession(1901666)--Thread(Thread[HTTPThreadGroup-4,5,HTTPThreadGroup])--TX Internally rolling back
    [TopLink Finer]: 2007.11.12 10:20:37.455--ServerSession(1901666)--Thread(Thread[HTTPThreadGroup-4,5,HTTPThreadGroup])--external transaction has rolled back internally
    The problem is the 1st store procedure is committed (it should be rolled back!), and the database is updated.
    Thanks,
    Jason

  • Execute a Store Procedure in AS400 from Oracle

    Hi..
    I need to invoke a Store Procedure AS/400 from my Oracle Database (Workflow Engine). . How Can do That ??
    Thank you

    Hi Peter,
    is the xml File available for the Orchestrator Runbook Service and the logon account?
    Or are you Running with Runbook tester? ->
    http://www.sc-orchestrator.eu/index.php/scoblog/99-functionality-differences-executing-a-runbook-with-runbook-tester
    Regards,
    Stefan
    www.sc-orchestrator.eu ,
    Blog sc-orchestrator.eu

  • About call the store procedure using VB with ODBC

    I want to ask how can I use the vb with ODBC call the oracle's store procedure ? I try to pass the parameter from vb and return 1 result, it is ok, but when I try to pass 1 parameter with return mutiple result (put it in recordset), the error message occured(Multiple-step OLE DB operation generated errors. Check each OLE DB status value, if available, No work was done) why ?? I can success whit using OLE DB, but why not in ODBC ?? does anybody can help me ?? Thanks a lot.

    oh, really ? it is not use ODBC to connecto to oracle ?
    Here is my program code:
    STORE PROCEDURE:
    PROCEDURE getInforcePolicy(PClient_ID IN VARCHAR2, PPolicy_No IN VARCHAR2, BasicCur OUT oraoledb.m_refcur, RiderCur OUT oraoledb.m_refcur)
    IS
    BEGIN
    OPEN BasicCur FOR SELECT * FROM
    inforce200111 WHERE Client_ID = PClient_ID and Policy_No = PPolicy_No and coverage_No = 1;
    OPEN RiderCur FOR SELECT * FROM
    inforce200111 WHERE Client_ID = PClient_ID and Policy_No = PPolicy_No and coverage_No <> 1;
    END getInforcePolicy;
    PACKAGE oraoledb AS
    TYPE m_refcur IS REF CURSOR;
    END oraoledb;
    Program:
    Dim cn As New ADODB.Connection
    Dim rs As New ADODB.Recordset
    Dim rs2 As New ADODB.Recordset
    Dim cmd As New ADODB.Command
    Dim paramclient As New ADODB.Parameter
    Dim parampolicy As New ADODB.Parameter
    Dim I As Integer
    cn.Open "ridev", "abc","abc"
    cmd.ActiveConnection = cn
    Set paramclient = cmd.CreateParameter("PClient", adVarChar, adParamInput, 10)
    Set parampolicy = cmd.CreateParameter("PPolicy", adVarChar, adParamInput, 10)
    paramclient.Value = "0000023011"
    parampolicy.Value = "HK0010021U"
    cmd.Parameters.Append paramclient
    cmd.Parameters.Append parampolicy
    cmd.CommandText = "{call getInforcePolicy}"
    Set rs = cmd.Execute
    Do While Not rs.EOF
    Loop
    Set rs2 = rs.NextRecordset
    Do While Not rs2.EOF
    loop
    Where the RIDEV is a datasource that created from Data Source in Control Panel using the driver call "Microsoft ODBC for ORACLE"

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

Maybe you are looking for

  • Ipod recognized in windows, not by itunes. i've seriously tried everything!

    hi all looked everywhere for the answer to see if this has been discussed but this is the weirdest i've ever seen any of my ipods behave. ok... 30gb 5.5 generation ipod. plugged it in one day, won't sync to windows. froze up itunes only but not all o

  • Move, scale and flip actions happening at the same time.

    Im trying to get a square to move locations, get bigger and flip around at the same time. I can move and scale, but no flip. im super new so i may be doing something wrong. let me know Jonny

  • SAP ECC 6.0 EhP 7

    Hi, We have installed an ECC 6.0 with ehp7 and updated it via SUM . We need to activate the utilities solution so for doing that we need to update the IS-U from 600 to 617 . Problem is that this component doesn't appear on the MOPZ, so we have tried

  • IDOC Sender Partner has changed after transporting Integration Directory ob

    Greetings, After we did a transport from QA to PR for a new interface (Intergration Directory) objects were transported, The sender partner has changed to QA in all outbound IDOCs generated in XI PR. I checked the adapter-specific identifiers and it

  • Webdynpro Application is not Deploying into Netweaver 2004s From NWDS CE

    Hi, I Developed Webdynpro Application in NWDS CE 7.1 SP5. I Am using Netweaver 2004s AS JAVA . After Deploying application i will get page can not be displayed and in the browser url is following below http://localhost:-1/webdynpro/dispatcher/demo.sa