Error executing DB2 stored proc

Hi,
We are trying to execute a Stored Proc in Mainframe DB2. We've prepared a PreparedStatement. The problem the stored proc works fine in some cases, but in some it fails even thouhg the data passed is same. Even the whole JVM crashes and there is no log in error.log file.
Do you have any idea as to what might be the problem. We are using IBM WebSpehere5.0 and DB2v7.0
Regards,
Rohit

For starters you should be using CallableStatement and not PreparedStatement.
And if the VM goes down and no errors are thrown anywhere than it's time to talk to the vendor or consult the docs because that is beyond the scope of help you could be given here.

Similar Messages

  • Calling DB2 Stored Proc from Oracle DB

    Hi,
    I am having two different database running (One is oracle on solaris while the other one is db2 on os/390 mainframe) i want to pass the data realtime. Is there any way I can call a DB2 stored procedure from oracle directly. If anyboy can help in this will be really helpful.
    thanks,
    Kishor

    odi version we have is  ODI_11.1.1.6.0, it is not migrated and 'Always Execute' option is checked already.
    tried using variables in capital format but did not worked,
    begin
    schema_name.proc_name(#LV_TABLE_NAME,#LV_SCHEMA_NAME,#LV_START_DATE,#LV_END_DATE);
    end;
    odi is giving error if it finds any bug in stored proc but after fixing its completing successfully without errors in operator but i am not able to see the result.
    Please advise.

  • Error while Compiling Stored proc

    I am having problem while compiling stored proc.It gives the following error
    "Error while trying to retrieve text for error - ORA-03113"
    I have my SQL file in which i am adding the input parameters (aroung 100 parameters). Till 53 parameters i added it created the procedure now after that i am adding the parameteres one by one but its giving the same error.
    null

    Hi Minish,
    Whatever you wrote in crontab is fine. But we can call a stored procedure from Shell Script provide the shell script must have a sql file which contain the procedure to be excuted.
    Follow the things...
    Assume that,
    1. you have file called load.sql
    it contains...
    load_data;
    2. your shell script must have this code
    . /home/nimish/.profile
    sqlplus scott/tiger@orcl_bk load.sql
    *** make sure that sql file should have executable permissions
    Good Luck
    <BLOCKQUOTE><font size="1" face="Verdana, Arial, Helvetica">quote:</font><HR>Originally posted by Nimish Buch:
    I want to run a stored procedure as an end of day process. I wrote a small unix shell script to run the procedure from a sql session, similar to following.
    . /home/nimish/.profile
    sqlplus scott/tiger@orcl_bk < execute load_data;
    If I run this script manually, it runs fine. I get the following errors when I attempt to run it as a cron job.
    Message file sp1.msb not found
    I have checked sp1us.msb does exist in ORACLE_HOME/sqlplus/mesg directory. I even tried giving it's path in PATH variable.
    Any help with this will be appreciated.
    Thanks a lot.
    Nimish<HR></BLOCKQUOTE>
    null

  • Executing a stored proc from inside a stored proc

    Hi,
    I'm trying to execute a stored procedure from inside another stored procedure, and I can't seem to work out the correct syntax to use, could someone please give me a pointer, it's starting to drive me insane :]
    CREATE OR REPLACE PROCEDURE foo (blah in type) AS
    BEGIN
    EXEC OTHER_STORED_PROC();
    END;
    Thank you kindly,
    Anthony...

    EXEC is a SQL*Plus command, not PL/SQL syntax. In SQL*Plus, EXEC <<procedure name>> is just shorthand for
    BEGIN
      <<procedure name>>
    END;Calling a stored procedure from another stored procedure (or any PL/SQL block), can bypass the extra begin/end pair because it's already inside a PL/SQL block. Thus, the syntax you need is just
    CREATE OR REPLACE PROCEDURE foo (bar IN type)
    AS
    BEGIN
      other_stored_procedure();
    END;Justin
    Distributed Database Consulting, Inc.
    www.ddbcinc.com/askDDBC

  • Error while calling a Db2 stored proc  using Dataservice

    Hi ,
    I am getting the following exception while calling a Db2 proc.The proc is not returning any refcursor.It has one Input param of type String.We are expecting the result in resultset. I am able to call the proc using JDBC function and iterate tru the resultset and print it.
    While doing import the source Metadata , I Added a "Editable Row Set" Type.
    Any clue ?
    ava.lang.RuntimeException: Incorrect definition, too many return resultset
         at com.bea.ld.wrappers.procedure.ProcedureAdapter$CallableWrapper.getNextReturnValue(ProcedureAdapter.java:634)
         at com.bea.ld.wrappers.procedure.ProcedureIterator.getNextToken(ProcedureIterator.java:249)
         at com.bea.ld.wrappers.procedure.ProcedureIterator.fetchNext(ProcedureIterator.java:125)
         at weblogic.xml.query.iterators.GenericIterator.hasNext(GenericIterator.java:134)
         at weblogic.xml.query.runtime.sequences.Subsequence.fetchNext(Subsequence.java:106)
         at weblogic.xml.query.iterators.GenericIterator.next(GenericIterator.java:113)
         at weblogic.xml.query.runtime.querycide.QueryAssassin.fetchNext(QueryAssassin.java:54)
         at weblogic.xml.query.iterators.GenericIterator.peekNext(GenericIterator.java:151)
         at weblogic.xml.query.runtime.qname.InsertNamespaces.fetchNext(InsertNamespaces.java:161)
         at weblogic.xml.query.iterators.GenericIterator.next(GenericIterator.java:113)
         at weblogic.xml.query.runtime.core.QueryIterator.fetchNext(QueryIterator.java:127)
         at weblogic.xml.query.iterators.GenericIterator.hasNext(GenericIterator.java:134)
         at weblogic.xml.query.xdbc.util.Serializer.serializeItems(Serializer.java:142)
         at com.bea.ld.server.QueryInvocation.getResult(QueryInvocation.java:461)
         at com.bea.ld.EJBRequestHandler.executeFunction(EJBRequestHandler.java:346)
         at com.bea.ld.ServerBean.executeFunction(ServerBean.java:108)
         at com.bea.ld.Server_ydm4ie_EOImpl.executeFunction(Server_ydm4ie_EOImpl.java:208)
         at com.bea.ld.Server_ydm4ie_EOImpl_WLSkel.invoke(Unknown Source)
         at weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:491)
         at weblogic.rmi.cluster.ReplicaAwareServerRef.invoke(ReplicaAwareServerRef.java:120)
         at weblogic.rmi.internal.BasicServerRef$1.run(BasicServerRef.java:434)
         at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:363)
         at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:147)
         at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:429)
         at weblogic.rmi.internal.BasicExecuteRequest.execute(BasicExecuteRequest.java:35)
         at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:224)
         at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:183)

    Hi,
    I am trying to do something like this but with Oracle stored procedure which returns an associate array and a cursor and these are defined as INOUT. I am not finding a way how to do it with editable row set. Can you plese list the steps used to make things work.
    Thanks.

  • Error executing a stored procedure from SSIS using the MERGE statement between databases

    Good morning,
    I'm trying to execute from SSIS a stored procedure that compares the content of two tables on different databases in the same server and updates one of them. To perform this action, I've created a stored procedure in the destination database and I'm
    comparing the data between tables with the MERGE statement. When I execute the procedure on the destination database the error that I obtain is:
    "Msg 916, Level 14, State 1, Procedure RefreshDestinationTable, Line 13
    The server principal "XXXX" is not able to access the database "XXXX" under the current security context."
    Some things to take in account:
    1. I've created a temporary table on the same destination database to check if the problem was on the MERGE statement and it works fine.
    2. I've created the procedure with the option "WITH EXECUTE AS DBO".
    I've read that it can be a problem of permissions but I don't know if I'm executing the procedure from SSIS to which user/login I should give permissions and which.
    Could you give me some tip to continue investigating how to solve the problem?
    Thank you,
    Virgilio

    Read Erland's article http://www.sommarskog.se/grantperm.html
    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

  • ORA-00942 error in simple stored proc

    Guys,
    I'm trying to learn to write some procedures in oracle and have started with the following;
    CREATE OR REPLACE PROCEDURE sp__who
    IS
    BEGIN
    FOR rec IN (SELECT s.SID, s.serial#, p.spid, s.osuser, s.program,
    s.status
    FROM v$process p, v$session s
    WHERE p.addr = s.paddr)
    LOOP
    DBMS_OUTPUT.put_line ('SID: ' || rec.SID);
    DBMS_OUTPUT.put_line ('Serial Nbr: ' || rec.serial);
    DBMS_OUTPUT.put_line ('SPID: ' || rec.spid);
    DBMS_OUTPUT.put_line ('OS User: ' || rec.osuser);
    DBMS_OUTPUT.put_line ('Program: ' || rec.program);
    DBMS_OUTPUT.put_line ('Status: ' || rec.status);
    DBMS_OUTPUT.put_line ('------------------------------');
    END LOOP;
    END sp__who;
    SHOW ERRORS;
    This is failing with a PL/SQL: ORA-00942: table or view does not exist - it seems to be complaining about v$session and v$process - I do have access to these as I can run the select by itself fine...
    Any ideas why?
    Also, can anyone suggest a good website for learning PL/SQL and oracle procedure writing?
    Cheers!
    Pete

    I'm a DBA (Sybase / SQL Server DBA!) and I'm learning to support oracle instances in my current role.
    The stored procedure will be used to extract a list of users active or otherwise in the database... Ideally giving enough information to make decisions easier when it comes to killing processes, etc. Replicating in part, the sybase equivalent stored procedures. (long term plan will be to recreate all the sybase sp_ procedures in oracle)
    What's written so far is obviously very basic and will need further enhancements to make it useful as intended - but having zero experience of writing procs in Oracle I thought it best to start with a simple select :-)

  • Failing to execute Sybase Stored Proc on startup

              This problem has been encountered while upgrading from weblogic 5.1 to 8.1: when
              a connection is used in a connection pool with the attribute conn.setAutoCommit(true),
              we get an error message:
              <<Cannot set auto commit to "true" when in distributed transaction.>>.
              When forcing setAutoCommit(false), then a new message appears about being unable
              to chain stored procedures. Obviously the transaction syncronization the entitry
              bean and the Sybase jConnect 5.5 jdbc driver is off. We had a similar problem
              long ago when installing weblogic 5.1 and fixed it with a subtle change in the
              weblogic.properties.
              What should be changed in the configuration? Or is this a deeper issue with the
              Jdbc driver or
              Sybase configuration?
              Particulars: weblogic 8.1 SP1 running on windows 2000 SP3; Sybase jConnect 5.5:
              jconn2.jar
              

    Show me the whole SQLException stacktrace (in both cases).
              The issue is probably in the DBMS stored procedure itself,
              not the driver or weblogic. An odd fact is that Sybase stored
              procedures have a default execution mode, which the DBMS
              enforces. If the procedure was created when the connection
              was in the typical chained-off (autoCommit(true)) mode, the
              procedure will only be allowed to run when the connection is in
              that unchained autoCommit(true) mode. Alternately, if the
              procedure was created during an autoCommit(false) session, then
              the DBMS will only allow the procedure to run in that mode!
              However, Sybase will allow any procedure's executre-mode to
              be changed to allow it to run in any mode. The system stored
              procedure sp_procxmode will set that:
              sp_procxmode my_procedure_name, ANYMODE
              (something like that. Please check the documents).
              That should allow you to run without playing with the autoCommit mode,
              which you shouldn't anyway.
              Joe
              John Redden wrote:
              > This problem has been encountered while upgrading from weblogic 5.1 to 8.1: when
              > a connection is used in a connection pool with the attribute conn.setAutoCommit(true),
              >
              > we get an error message:
              >
              > <<Cannot set auto commit to "true" when in distributed transaction.>>.
              >
              > When forcing setAutoCommit(false), then a new message appears about being unable
              > to chain stored procedures. Obviously the transaction syncronization the entitry
              > bean and the Sybase jConnect 5.5 jdbc driver is off. We had a similar problem
              > long ago when installing weblogic 5.1 and fixed it with a subtle change in the
              > weblogic.properties.
              >
              > What should be changed in the configuration? Or is this a deeper issue with the
              > Jdbc driver or
              > Sybase configuration?
              >
              > Particulars: weblogic 8.1 SP1 running on windows 2000 SP3; Sybase jConnect 5.5:
              > jconn2.jar
              

  • How to execute a stored proc with output params

    I have a SP that I created with 2 input varchar2s and 1 output varchar2. I developed it using PL/SQL Developer where it compiles and tests OK.
    When I try to run it using exec it fails with:
    exec validstate2('300', '5')
    BEGIN validstate2('300', '5'); END;
    ERROR at line 1:
    ORA-06550: line 1, column 7:
    PLS-00306: wrong number or types of arguments in call to 'VALIDSTATE2'
    ORA-06550: line 1, column 7:
    PL/SQL: Statement ignored
    If I try to add a set of quotes for an empty string for the output it fails as well.
    What do I need to do to get this to run? How do I handle that output parameter?
    Rick Price

    Here's the SP code, getcountry2 and get state are both functions that seem to work just fine.
    create or replace procedure ValidState2(mesgid IN varchar2, vcondition IN varchar2, valid OUT varchar2) is
    vvalid varchar2(20);
    v_temp varchar2(3);
    begin
    v_temp := getcountry2(mesgid, vcondition);
    IF v_temp = 'US' then
    vvalid := getstate(mesgid);
    valid := vvalid;
    else valid := 'Not US';
    end if;
    EXCEPTION
    when NO_DATA_FOUND THEN valid := 'No Data Found';
    end ValidState2;

  • Runtime exception java.lang.ClassNotFoundException on executing Stored Proc

    I am getting the below error when I try to execute a stored proc in Pointbase from weblogic.
    java.sql.SQLException: The external "DbLog::insLog" routine had the following runtime exception "java.lang.ClassNotFoundException: DbLog"
    import java.sql.*; import com.pointbase.jdbc.*; public class DbLog { static Connection conn = null; static Statement m_stmt; static Statement l_stmt; static CallableStatement m_callStmt = null; public boolean logPreAuth() { try { String I_URL = "jdbc:pointbase:server://localhost:9093/weblogic_eval"; conn = DriverManager.getConnection(I_URL, "PBSYSADMIN", "PBSYSADMIN"); /*String SQL_CREATE_PROC = "CREATE PROCEDURE insLog(IN P1 VARCHAR(30))" + " LANGUAGE JAVA" + " SPECIFIC insLog" + " DETERMINISTIC" + " NO SQL" + " EXTERNAL NAME \"DbLog::insLog\"" + " PARAMETER STYLE SQL"; m_stmt = conn.createStatement(); m_stmt.executeUpdate(SQL_CREATE_PROC); m_stmt.close(); */ Commented out because it throwed error saying, The routine "INSLOG" in schema "PBPUBLIC" already exists in system table SYSROUTINES. m_callStmt = conn.prepareCall("{ call insLog(?) }"); m_callStmt.setString(1, "Success!!"); m_callStmt.execute(); } catch (Exception e) { logger.error("Error in logPreAuth method" + e); } return true; } public static void insLog(String test) { try { l_stmt = conn.createStatement(); l_stmt.executeUpdate("Insert into logs values('" + test + "')"); l_stmt.close(); conn.close(); } catch (Exception e) { } }
    Please let me know how to solve this.

    I setted the classpath in commEnv.cmd as follows,
    set POINTBASE_HOME=%WL_HOME%\common\eval\pointbase
    set POINTBASE_CLIENT_CLASSPATH=%POINTBASE_HOME%\lib\pbclient57.jar
    set POINTBASE_CLASSPATH=%POINTBASE_HOME%\lib\pbembedded57.jar;%POINTBASE_CLIENT_CLASSPATH%;C:\bea\user_projects\workspaces\work1\utility\build\classes
    set POINTBASE_TOOLS=%POINTBASE_HOME%\lib\pbtools57.jar
    My DbLog class in the path, C:\bea\user_projects\workspaces\Work1\util\build\classes\net\local\util\common
    FYI, net\local\util\common is the package.
    But when I try to execute the page which calls RequestFilter.java, I am getting the following error,
    Error 500--Internal Server Error
    java.lang.NoClassDefFoundError: Could not initialize class net.local.util.common.DbLog
    Please find the code below,
    --RequestFilter.java
    import net.local.util.common.DbLog;  
    public final class RequestFilter {  
    public void log() {  
    DbLog dblog = new DbLog();  
    dblog.logPreAuth();  
    }  --DbLog.java
    package net.local.util.common;  
    import java.sql.*;  
    import org.apache.log4j.Logger;  
    import com.pointbase.jdbc.*;  
    public class DbLog {  
        private static final Logger logger = Logger.getLogger(DbLog.class);  
        private static boolean DEBUGGING = logger.isDebugEnabled();  
        private Connection conn = null;  
        private Statement m_stmt;  
        private Statement l_stmt;  
        private CallableStatement m_callStmt = null;  
        //static ResultSet l_rs = null;  
    public DbLog() {  
        logger.info("DbLog constructor called");  
        init();  
    public void init() {  
        logger.info("DbLog init called");  
    public void logPreAuth() {  
            try {  
                logger.info("Inside logPreAuth method");  
                String I_URL = "jdbc:pointbase:server://localhost:9093/weblogic_eval";  
                Class.forName("com.pointbase.jdbc.jdbcUniversalDriver").newInstance();  
                //Class.forName("com.pointbase.jdbc.jdbcDataSource");  
                conn = DriverManager.getConnection(I_URL, "PBPUBLIC", "PBPUBLIC");  
            String SQL_CREATE_PROC = "CREATE PROCEDURE insLog(IN P1 VARCHAR(30))" 
                    + " LANGUAGE JAVA" 
                    + " SPECIFIC insLog" 
                    + " DETERMINISTIC" 
                    + " NO SQL" 
                    + " EXTERNAL NAME \"DbLog::insLog\"" 
                    + " PARAMETER STYLE SQL";   
                m_stmt = conn.createStatement();  
                m_stmt.executeUpdate(SQL_CREATE_PROC);  
                m_stmt.close();    
                m_callStmt = conn.prepareCall("{ call PBPUBLIC.insLog(?) }");  
                m_callStmt.setString(1, "Success!!");  
                m_callStmt.execute();   
            catch (Exception e) {  
                logger.error("Error in logPreAuth method" + e);  
    public void insLog(String test)  
        try {  
            l_stmt = conn.createStatement();  
            l_stmt.execute("Insert into logs values('" + test + "')");  
            l_stmt.close();  
            conn.close();  
        catch (Exception e) {  

  • Resultset returns null while calling a DB2 stored procedure using hibernat

    Hi All ,
    I am trying to call a db2 stored proc with cursor open from my java code but it always returns me null results though it executes fine when I call the procedure from the command line
    Java code....................
    CallableStatement stmt3 = EyeHibernateApp.getHibernateSession().connection().prepareCall("{call answers_select_id( ? )}");
    stmt3.setString(1,20);
    stmt3.execute();
    ResultSet rs1 = stmt3.getResultSet();
    System.out.println("rs1 " + rs1); --> returns null
    procedure-------------
    CREATE PROCEDURE answers_select_id (IN question_id bigint )
    P1:BEGIN
    DECLARE cursor1 CURSOR WITH RETURN TO CLIENT FOR
    SELECT a.answer_id from answers as a where a.question_id = question_id;
    open cursor1;
    END P1;
    I am using the same java code with mysql stored procs . It works fine there but I assume open cursors in db2 stored proc is causing the problem . If I can help it , I need to maintain the same java code for mysql ad db2 . Please help me ...
    Thanks,
    Av~

    Hi,
    I am trying to do something like this but with Oracle stored procedure which returns an associate array and a cursor and these are defined as INOUT. I am not finding a way how to do it with editable row set. Can you plese list the steps used to make things work.
    Thanks.

  • Resultset returns null while calling a DB2 stored procedure using hibernate

    Hi All ,
    I am trying to call a db2 stored proc with cursor open from my java code but it always returns me null results though it executes fine when I call the procedure from the command line
    Java code....................
    CallableStatement stmt3 = EyeHibernateApp.getHibernateSession().connection().prepareCall("{call answers_select_id( ? )}");
    stmt3.setString(1,20);
    stmt3.execute();
    ResultSet rs1 = stmt3.getResultSet();
    System.out.println("rs1 " + rs1); --> returns null
    procedure-------------
    CREATE PROCEDURE answers_select_id (IN question_id bigint )
    P1:BEGIN
    DECLARE cursor1 CURSOR WITH RETURN TO CLIENT FOR
    SELECT a.answer_id from answers as a where a.question_id = question_id;
    open cursor1;
    END P1;
    I am using the same java code with mysql stored procs . It works fine there but I assume open cursors in db2 stored proc is causing the problem . If I can help it , I need to maintain the same java code for mysql ad db2 . Please help me ...
    Thanks,
    Av~

    Hi,
    I am trying to do something like this but with Oracle stored procedure which returns an associate array and a cursor and these are defined as INOUT. I am not finding a way how to do it with editable row set. Can you plese list the steps used to make things work.
    Thanks.

  • Problem while executing a Stored Procedure

    Hi,
    im a newbie,using Oracle 10g v(10.2.0.1.0) on linux machine.
    Im unable to execute following procedure through iSQLPLUS query interface.
    create or replace procedure pd_hr(
    pno varchar2,
    pdt date default sysdate,
    phr out number,
    perr_msg out varchar2
    ) as
    begin
         phr := 2;
    end pd_hr;
    VARIABLE phr number;
    VARIABLE perr_msg VARCHAR2(250);
    execute pd_hr('pno',NULL,phr,perr_msg);
    It flashes the following error when i try to execute the stored proc:
    ERROR at line 1:
    ORA-06550: line 1, column 44:
    PLS-00201: identifier 'PHR' must be declared
    ORA-06550: line 1, column 7:
    PL/SQL: Statement ignored
    I executed the following query through DBA login before executing the procedure:
    GRANT EXECUTE ANY PROCEDURE TO "SCOTT";
    Any kind of assistance will be priceless!
    Peter

    Hi, Peter,
    user10707566 wrote:
    Thanks Frank, it worked seamlessly!
    btw what the ':' signifies here?":" just means "this is a bind variable".
    It's convenient, because when you name a bind variable "phr", you can use ":phr" without worrying whether there is a column or a local variable that is also called phr, and, if so, which one takes precedence.

  • Handling result form Stored Proc in java program

    Folks, I have a question on how to handle results from Stored Procedures with the java.sql API. I execute a stored proc from a java program using the statement:
    statement.execute();
    where 'statement' is of type Statement. Then I get the results:
    ResultSet rs = query.getResultSet();
    The above returns me a ResultSet object. Now, my stored proc is such that it will return an integer in case of errors (as error code), and, if no error,it'll return the result set. Because I wouldn't know if the stored proc is returning an integer or a result set, how do I get the result of the stored proc in the java program? 'query.getResultSet()' would get me only an object of type ResultSet. What if the stored proc is returning an integer (i.e. when an error occurs)?
    Thanks.

    GSP wrote:
    Thanks to all for your replies. I do not have access to modify the stored procedure. I can just use it in my java program. The stored proc first validates its input parameters. If it finds them invalid, then it returns an appropriate error code (which is an integer) depending on which input param is found invalid. If all the input parameters are found valid, then it fetches the rows from the DB tables & returns them as result set. Now my question is: say if I give a statement as this in my java program:
    ResultSet rs = query.getResultSet();
    what if the stored proc returns an error code (Since the above statement gets only ResultSet object, how will it handle if the stored proc returns an int)? Is there any alternative?
    Ok, so there is a piece of missing data.
    Store procs, conceptuatlly can return data in a variety of ways.
    So the first step is to determine how the data is being returned.
    Unless you know that there is no way to determine how to use it in java.

  • Stored Proc running twice using DBMS_Scheduler

    Hello all,
    I have a vb front end that calls a main stored proc which submits scheduler jobs to execute several stored procs asynchronously. Everything is working, except the part that the several stored procs are running twice. In the troubleshooting, I have eliminated the front end from being the culprit and the stored procs themselves. Essentially, when I call the stored proc using dbms_scheduler.create_job, it runs twice, even manually. I am about at wits end trying to figure out why: Using Oracle 11gR2
    I started off setting up the programs
    begin
    --create program
    dbms_scheduler.create_program
    ( program_name => 'prog_name'
    ,program_type => 'STORED_PROCEDURE'
    ,program_action => 'usp_sub_proc_1'
    ,number_of_arguments => 8
    ,enabled => FALSE
    dbms_scheduler.DEFINE_PROGRAM_ARGUMENT
    ( program_name=> 'prog_name'
    ,argument_position=>1
    ,argument_name => 'name'
    ,argument_type=>'VARCHAR2'
    /*the remaining 7 arguments are in code but not display for space reasons*/
    dbms_scheduler.enable('prog_name');
    end;Then the main stored proc executes this code:
    declare v_job_name varchar2(100);
        v_1 varchar(50) := 'All';
        v_2 varchar(50) := 'All';
        v_3 varchar(50) := 'All';
        v_4 varchar(50) := 'All';
        v_5 varchar(50) := 'TEST';
        i_6 integer := 1;
        v_7 varchar(50) := 'TEST_NE';
        ts_8 timestamp := current_timestamp;
    begin
        v_job_name := 'uj_dmo_1';
    dbms_scheduler.create_job (v_job_name
                                            ,program_name => 'prog_name'
                                            ,job_class => 'UCLASS_1'
                                            ,auto_drop => TRUE
    --set parameters
    dbms_scheduler.set_job_argument_value(v_job_name,1, v_1);
    dbms_scheduler.set_job_argument_value(v_job_name,2, v_2);
    dbms_scheduler.set_job_argument_value(v_job_name,3, v_3);
    dbms_scheduler.set_job_argument_value(v_job_name,4, v_4);
    dbms_scheduler.set_job_argument_value(v_job_name,5, v_5);
    dbms_scheduler.set_job_argument_value(v_job_name,6, to_char(i_6));
    dbms_scheduler.set_job_argument_value(v_job_name,7, v_7);
    dbms_scheduler.set_job_argument_value(v_job_name ,8, to_char(ts_8));
    --enable job
    dbms_scheduler.enable(v_job_name);
    --execute job
    dbms_scheduler.run_job(job_name => v_job_name , use_current_session => FALSE);
    end;
    ...And this is where I get the double execution of the job, but I am just not seeing it in my syntax, dba_scheduler_jobs, logging, etc. Any help is greatly appreciated, thanks!!

    Well apparently I will not win any Captain Obvious awards;
    With 34MCA2K2's response with "what doesn't work" for some reason turned the light on. After some more testing here is what I found.
    This code works as expected :
    Exhibit A
    begin
    dbms_scheduler.create_job (job_name =>'TESTER'
                                   ,job_type => 'PLSQL_BLOCK'
                                   ,job_action => 'declare test1 integer := 1; begin test1 := test1 + 5; end;'
                                   ,auto_drop => True
       /*dbms_scheduler.enable('TESTER');   */
       dbms_scheduler.run_job(job_name => 'TESTER', use_current_session =>FALSE);   
    end;As does this:
    Exhibit B
    begin
    dbms_scheduler.create_job (job_name =>'TESTER'
                                   ,job_type => 'PLSQL_BLOCK'
                                   ,job_action => 'declare test1 integer := 1; begin test1 := test1 + 5; end;'
                                   ,auto_drop => True
       dbms_scheduler.enable('TESTER');  
      /*dbms_scheduler.run_job(job_name => 'TESTER', use_current_session =>FALSE);    */
    end;Exhibit A will create the job and is visible in the schedulerjobs view, and the RUN_JOB will execute it even when not enabled, but the pl/sql will not drop the job.
    Exhibit B will create the job and once enabled, executes the job and then drops from schedulerjobs view.
    Therefore, my desired results for running the jobs once asynchronously and dropping immediately is....
    begin
        v_job_name := 'uj_dmo_1';
    dbms_scheduler.create_job (v_job_name
                                            ,program_name => 'prog_name'
                                            ,job_class => 'UCLASS_1'
                                            ,auto_drop => TRUE
    --set parameters
    dbms_scheduler.set_job_argument_value(v_job_name,1, v_1);
    dbms_scheduler.set_job_argument_value(v_job_name,2, v_2);
    dbms_scheduler.set_job_argument_value(v_job_name,3, v_3);
    dbms_scheduler.set_job_argument_value(v_job_name,4, v_4);
    dbms_scheduler.set_job_argument_value(v_job_name,5, v_5);
    dbms_scheduler.set_job_argument_value(v_job_name,6, to_char(i_6));
    dbms_scheduler.set_job_argument_value(v_job_name,7, v_7);
    dbms_scheduler.set_job_argument_value(v_job_name ,8, to_char(ts_8));
    /*enable job*/
    dbms_scheduler.enable(v_job_name);
    /*execute job (Do not execute the code below, it will lead to multiple executions)
    dbms_scheduler.run_job(job_name => v_job_name , use_current_session => FALSE); */
    end;

Maybe you are looking for

  • Remote App causing an iPhone restart/crash

    Has anyone had the iPhone restart or crash when launching the Remote App? I have had it happen 3 or 4 times now. I will choose the icon and the iPhone will flash and then restart. I am using a 1st generation 8 GB. Thanks, Ben

  • How do I transfer my music from my external hard drive with the extension .itl?

    I transferred my music from my old computer to an external hard drive.  Now trying to get my music to load into my new computer via external hard drive but I do not think it will due to the extension of .itl.  what shall I do?

  • Trying to open a new browser window

    Hi I have this code to open my website into a new window once loaded And I was wondering if A it is correct, I wanted the dimmensions to be 1000 - 600 and B do I put this code in dreamweaver and if so where abouts do i put it? myRef = window.open(''+

  • Calling a Configuration Entry Point from a C# code module

    Hi, Is it possible to call a configuration entry point from a C# code module? I have a custom process model which creates some configuration entry points. One of the entry points, calls a C# method in a code module to display a Startup screen for the

  • Applications are using too much data

    my iphone 5 fatching too much data on every application like facebook , whats app etc...