How to trigger an update in DBAT connector?

Hello,
I have set up the DBAT connector so that "Create User" task would call the create user groovy script, which calls the stored procedure to insert records into the parent and child tables.  This works fine.
I also set up the connector so that "Delete User" task would call the delete user groovy script, which calls the stored procedure to delete records in the parent and child tables.  This also works fine.
I have only 1 use case left which is the update of the child table.
I have a field called Reporter ID in the USR form.  I created a Change Reporter ID process task in DBAT process definition (added this into the lookup.USR_PROCESS_TRIGGERS).  This called an adapter task that just returned a response code of SUCCESS.  I want to attach a process task to this Change Reporter ID so that "somehow" it would call my "update user" groovy script, which calls the stored procedure to delete records from the child table and re-insert new records into the child table.
How can I achieve this?  I don't want to update anything in the parent process form or child process form.  I just want to call my update user stored procedure.
Thanks
Khanh

Thank you for your response.
I created the below java code and created a process task in DBAT User process form to call this code on "Change Reporter ID" event.
import groovy.lang.GroovyClassLoader;
import groovy.lang.GroovyObject;
import groovy.lang.GroovyShell;
//import groovy.lang.Binding;
import java.io.File;
import java.util.logging.Logger;
public class MyDBATUpdateUser extends GroovyShell {
    private String METHOD_NAME = "DEBUG: MyDBATUpdateUser: ";
    public String MyDBATUpdateUser() {
        String result = "";
        try {
            ClassLoader parent = MyDBATUpdateUser.class.getClassLoader();
              GroovyClassLoader loader = new GroovyClassLoader(parent);
            Class groovyClass =
                loader.parseClass(new File("/home/iam_dev/dbat/scripts/my_dbat_update_user.groovy"));
            logger.warning(METHOD_NAME +
                           "Passed groovy file name");
            GroovyObject groovyObject =
                (GroovyObject)groovyClass.newInstance();
            Object[] args = { };
            logger.warning(METHOD_NAME + "Defined args");
            groovyObject.invokeMethod("run", args);
            logger.warning(METHOD_NAME + "Success");
            return "SUCCESS";
        } catch (Exception e) {
            logger.warning("MYPROJECT ERROR: " + METHOD_NAME +
                           "Error encountered in main");
            e.printStackTrace();
            return "REJECT";
It seemed the above java code died at the line of code: groovyObject.invokeMethod("run", args);
my groovy script looks like this:
import java.util.*;
CallableStatement st = null;
def id = attributes['__NAME__']?.value?.get(0);
try {
st = conn.prepareCall("{call MY_PROC_ADD_CHILD_GROUP(?)}");
st.setString(1, id);
st.executeUpdate();
} finally {
if (st != null)
st.close();
trace.error("Called MY_PROC_ADD_CHILD_GROUP [${id}]");
return new Uid(id);
Thanks for letting me know what's wrong with the above code.
Khanh

Similar Messages

  • How to create conditional update trigger in sql server

    How to create conditional update trigger in sql server

    You cant create a conditional update trigger. Once you create an update trigger it will get called for every update action. However you could write logic inside it to make it do your activity based on your condition using IF condition statement
    Say for example if you've table with 6 columns and you want some logic to be implemented on update trigger only if col3 and col5 are participating in update operation you can write trigger like this
    CREATE TRIGGER Trg_TableName_Upd
    ON TableName
    FOR UPDATE
    AS
    BEGIN
    IF UPDATE(Col3) OR UPDATE (Col5)
    BEGIN
    ....your actual logic here
    END
    END
    UPDATE() function will check if column was involved in update operation and returns a boolean result
    Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs

  • How dose AddPrinter.app trigger software update?

    Has any one figured out how AddPrinter triggers software udpate to download and install printer drivers? Because it would be really cool to be able to add printers from the command line and still be able to trigger software update to download the printer drivers.

    Thanks for the response, that is good to know!
    I agree that you shouldn't wipe out completely. In my case however, I use a database to track alot of changes in my app.
    By default, I create a copy of the source database, and the user's changes go to the copy. In my update, I released a new table in my database, but I'm guessing the user's database copy remained in their workspace. So essentially, any calls to the new table cause a system failure, or in my case a crash because the user's old version still referenced the old database.
    Any ideas on how to approach this kind of problem? Is there a way to query a database version? I am using a sqlite3 database. Perhaps my app can check the working version of the database? And overwrite if it sees an older version?
    Either that, or is there a way to modify the actual update/install process? So that my app will automatically clear a certain directory where my old database file is sitting?

  • OBIEE Dashboard:- how to trigger a sql update from obiee dashboard?

    I want to trigger an update database query from a click in obiee dashboard.What is the best way to do it
    Edited by: Tataji vijjapu on Aug 7, 2012 11:20 PM

    Check WriteBack functionality
    http://gerardnico.com/wiki/dat/obiee/write_back
    Hope this helps

  • DBAT Connector 11.1.1.5.0 installation making oim server shut down

    Hi ,
    Currently as part of new requirement, we have just started working on DBAT .
    OIM server is getting shut down abruptly when the DBAT  connector is being installed after package is being generated.
    Please find below the steps followed for installation.
    As per documentation,
    1.I have created a table in Oracle 11g Express edition , with the following scripts
    CREATE TABLE DBAT_USER
          USERNAME VARCHAR(100) PRIMARY KEY,
            FIRST_NAME VARCHAR(100),
            MIDDLE_NAME VARCHAR(100),
            PASSWORD VARCHAR(100),
              EMAIL VARCHAR2(100),
              TELEPHONE_NUMBER VARCHAR2(100),
               HOME_NUMBER VARCHAR2(100),
                FAX VARCHAR2(100),
                MOBILE VARCHAR2(100),
                TITLE  VARCHAR(100),
              STATUS VARCHAR(100),
             LAST_UPDATE TIMESTAMP (8) DEFAULT CURRENT_TIMESTAMP
      Commit;
      CREATE OR REPLACE TRIGGER DBAT_USER_TS_TRG BEFORE
      INSERT OR
      UPDATE ON DBAT_USER REFERENCING NEW AS NEW FOR EACH ROW BEGIN
      SELECT CURRENT_TIMESTAMP INTO :NEW.LAST_UPDATE FROM dual;
      END;
      ALTER TRIGGER DBAT_USER_TS_TRG ENABLE;
    2. I have made changes in groovy file to make the DB table as  Target resource,
    // Run like:  DBATGenerator.cmd ..\resources\DBATConfiguration.groovy dbat
    trusted {
        //Resource name
        itResourceDefName='DBATTrusted' // DBAT is a name of the package
        // itResourceName="$itResourceDefName" //the same as itResourceDefName
        //Output files  
        //  connectorDir="../$itResourceDefName"   // out dir is the same as it resource name
        //  xmlFile='DBAT-ConnectorConfig.xml' // defaults are commented
        //  configFile='DBAT-CI.xml'
        //  propertiesFile='dbat-generator.properties'
        //  version='11.1.1.5.0'
        //The Configuration
        trusted=false
        bundleJar='../lib/org.identityconnectors.databasetable-1.2.2.jar'
        config = [
            'table' : 'DBAT_USER',
            'keyColumn' : 'USERNAME',
            'passwordColumn' : 'PASSWORD',
            'user' : 'oimuser',
       //   'password' : '', never provide passwords to generator
            'jdbcUrlTemplate' : 'jdbc:oracle:thin:@abc:1521:xe',
            'jdbcDriver': 'oracle.jdbc.driver.OracleDriver',
       //   'statusColumn':'STATUS',
       //   'enableValue':'Enabled',
       //   'disableValue':'Disabled',
      'database':'xe',
      'host':abc',
       //   'port':'1521',
       //   'datasource':'',
       //   'jndiProperties':'',
       //   'customizedQuery':'',
       //   'rethrowAllSQLExceptions', true,
            'allNative':true, // We prefer to have native dates, timestamps in OIM
       //   'validConnectionQuery':'SELECT 1 FROM DUMMY',
       //   'dateFormat':'dd/MM/yyyy',
       //   'timestampFormat':'dd/MM/yyyy HH:mm:ss:SSS',
       //   'enableEmptyString':false,
       //   'quoting':'NONE',
       //   'changeLogColumn':'LAST_UPDATE',
       //   'nativeTimestamps': false,
       //   'executeQueryScript': '',  // provide the groovy script, or file:///url of the script
        // Default mandatory aliases for trusted resource. Usage : ['CONNECTOR_ATTRIBUTE':'OIM_USER_ATTRIBUTE'] Eg., ['LAST_NAME':'Last Name']
        // PLEASE DO NOT REMOVE ANY ENTRY FROM THE FOLLOWING LIST. YOU CAN ADD ENTRIES FOR OTHER OIM USER ATTRIBUTES OR MODIFY THE <CONNECTOR_ATTRIBUTE> BASED ON THE TABLE COLUMNNAME
        // For the complete list of OIM User Profile Attributes, refer http://docs.oracle.com/cd/E40329_01/user.1112/e27151/usr_mangmnt.htm#CHDCDCCB
        alias = ['__UID__':'User Login', '__NAME__':'Last Name', 'Organization':'Organization Name', 'Xellerate Type':'Xellerate Type', '__ENABLE__':'Status', 'Role':'Role','FIRST_NAME':'First Name','MIDDLE_NAME':'Middle Name','TITLE':'Title','EMAIL':'Email','PASSWORD':'Password']
    // Run like:  DBATGenerator.cmd ..\resources\DBATConfiguration.groovy db1
    target {
        //Resource Name
        itResourceDefName='DBAT_IT' // DBAT is a name of the package
         itResourceName="$itResourceDefName" //the same as itResourceDefName
        //Output files
      connectorDir="../$itResourceDefName" //out dir is the same as it resource name
      xmlFile='DBAT-ConnectorConfig.xml'
         // configFile='DBAT-CI.xml'
          //propertiesFile='dbat-generator.properties'
         // version='11.1.1.5.0'
          //provisionDatasetFile='ProvisionResource_DBATUser.xml'
          //modifyResourceDatasetFile='ModifyProvisionedResource_DBATUser.xml'
          //requestDMDatasetsFile='Datasets.xml'
        //Configuration
        bundleJar='../lib/org.identityconnectors.databasetable-1.2.2.jar'
        config = [
            'table' : 'DBAT_USER',
            'keyColumn' : 'USERNAME',
            'passwordColumn' : 'PASSWORD',
            'user' : 'xxx',
       //   'password' : '', never provide passwords to generator
            'jdbcUrlTemplate' : 'jdbc:oracle:thin:@xxx:1521:xe',
            'jdbcDriver': 'oracle.jdbc.driver.OracleDriver',
        //  'relationTables': 'APP_USER_ROLE, APP_USER_TEAM, APP_USER_ORGANIZATION',
      'statusColumn':'STATUS',
      'enableValue':'Enabled',
      'disableValue':'Disabled',
          'database':'xe',
      'host':'xxx',
      'port':'1521',
      //'datasource':'xe',
       //   'jndiProperties':'',
       //   'customizedQuery':'',
       //   'rethrowAllSQLExceptions', true,
            'allNative':true,  // We prefer to have native dates, timestamps in OIM
       //   'validConnectionQuery':'SELECT 1 FROM DUMMY',
       //   'dateFormat':'dd/MM/yyyy',
      'timestampFormat':'dd/MM/yyyy HH:mm:ss:SSS', // Force the full timestamp formating
       //   'enableEmptyString':false,
       //   'quoting':'NONE',
      'changeLogColumn':'LAST_UPDATE',
      'nativeTimestamps': true,
       //   'createScript': '',   // provide the groovy script, or file:///url of the script
       //   'updateScript': '',  // provide the groovy script, or file:///url of the script
       //   'deleteScript': '',  // provide the groovy script, or file:///url of the script
       //   'executeQueryScript': '',  // provide the groovy script, or file:///url of the script
        //Database table name to OIM resource form name alliasing.
        //Make sure that itResourceName lenght plus child table alias lenght is within 8 characters limit. 
       // alias = ['APP_USER_ROLE':'RO', 'APP_USER_TEAM':'TM', 'APP_USER_ORGANIZATION':'ORG']
        //Attribute to form field names alliasing
        alias = ['FIRST_NAME':'First Name','USERNAME':'User Login','MIDDLE_NAME':'Middle Name','TITLE':'Title','EMAIL':'Email','PASSWORD':'Password']
        //Generate prepopulate adapters.PrePopluate Adapters Usage is ['CONNECTOR_ATTRIBUTE':'OIM USER ATTRIBUTE'] Eg., ['DISPLAY_NAME':'Display Name']
        prepopulate = ['USERNAME':'User Login', 'FIRST_NAME':'First Name','PASSWORD':'Password','MIDDLE_NAME':'Middle Name','TITLE':'Title','EMAIL':'Email']
    3. successfully generated generator packge, DBAT_IT.zip after running, ./DBATGenerator.sh ../resources/DBATConfiguration.groovy target
    4.Copied ojdbc.16.jar in /home/oracle/Oracle/Middleware/Oracle_IDM1/server/ConnectorDefaultDirectory/targetsystems-lib/DBAT_IT/ , as DBAT_IT is generated package from generator.
    5. unzipped DBAT_IT into /home/oracle/Oracle/Middleware/Oracle_IDM1/server/ConnectorDefaultDirectory/
    6.Now , when I try to install the dbat connector, through adminconsole --> Manager connector -->Install -->Load
    7.It loads for 10-15 minutes and   throws the error on browser as , 'Network Error , server is  too busy to process the request'
    8.If I would go  and see in weblogic console, I could find,  OIM server is  shut down.
    9.I can see, in /home/oracle/Oracle/Middleware/user_projects/domains/base_domain/servers/oim_server1/logs/oim_server1-diagnostic.log, that the connector file, DBAT_IT schedule tasks are being read
    Kindly help to get rid of the problem and install the connector appropriately.
    Thanks in Advance

    Hi ,
    Please find the logs ,oim_server1-diagnostic.log attached .
    Did you find any issue  in the process that  I have followed for connector installation.
    Kindly let me know any pointers to resolve this issue.
    Thanks in Advance.

  • How to trigger crystal report from SAP ECC

    Hi All,
    I hope i m right forum to ask this question.
    we want to do label printing from Crystal reports. data will be present in SAP ECC .
    So I below issues
    1 ) how to connect SAP ECC database with Crystal Reports.
    2 ) how to trigger print output in Crystal reports from ECC , lets say I create a Delivery In ECC , the print output will be issued to Crystal report and I should get a print out Immediately ( for printing - printer will be connected to local system and SAP network printer ) .
    I have worked  with this type of scenario in smarforms , adobeforms. but not with Crystal Reports ...
    Regards
    Yashpal Gupta.

    Hi Yashpal,
    First thing you need to do is install the Connector on both your work station where you run Crystal Reports as well as the SAP Server where the data is.
    So I moved your post to the SAP Integration Kit forum.
    Need to know what version of Crystal Reports you are using?
    Search of browse here, lots of info on how to...
    Thanks
    Don

  • How to trigger IDOC in a batch job?

    hi,
    My requirement is that a batch job must run on R/3 side to check if bank data are created or changed.Any creation or update in table BNKA will trigger an IDOC
    If a record is created IDOC BANK_CREATE01 should be triggered and
    If a record is changed/deleted IDOC BANK_CHANGE01 should be triggered
    A background program should run periodically (every hour) and check the table CDHDR for object class BANK.
    The program must check if any new entry exist in the table since the last run.
    New records can be identified according to the fields UDATE and UTIME.
    According to the change indicator (CHANGE_IND) the program will determine if the IDOC_CREATE (changeID=I) should be run or IDOC_CHANGE (changeID=U or D).
    If change ID=D, then deletion indicator will be set in the CHANGE IDOC.
    Can anybody tell me how will i write the code for this and how to trigger IDOc as i very basic knowledge in ABAP
    Thanks & Regards,
    Loveena

    hi
    whenever changes made to an application document.u want to replicate these changes in target system u have to work with cahngepointers
    RBDMIDOC is the program which u have to schedule background
    regards
    Nagesh.Paruchuri

  • Integrating MS SQL 2005  using DBAT Connector 9102

    Hi,
    I am trying to integrate MS SQL 2005 using DBAT Connector 9102 using GTC. My OIM version is 9102. Though the table exist in MS SQL still it is not able to find it.
    It is able to connect but throwing error that table "test" does not exist.
    I also tried to connect with small java program to test the connectivity
    Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");
              con = DriverManager.getConnection("jdbc:sqlserver://<IP>;instanceName=<instance>;portNumber=1433", "sa", "******");
              System.out.println("connect done");
              stmt = con.createStatement();
              ResultSet rset = stmt.executeQuery("SELECT * FROM test");
    It is throwing following error
    com.microsoft.sqlserver.jdbc.SQLServerException: Invalid object name 'test'.
    at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDatabaseError(SQLServerException.java:196)
    at com.microsoft.sqlserver.jdbc.SQLServerStatement.getNextResult(SQLServerStatement.java:1454)
    at com.microsoft.sqlserver.jdbc.SQLServerStatement.doExecuteStatement(SQLServerStatement.java:786)
    at com.microsoft.sqlserver.jdbc.SQLServerStatement$StmtExecCmd.doExecute(SQLServerStatement.java:685)
    at com.microsoft.sqlserver.jdbc.TDSCommand.execute(IOBuffer.java:4026)
    at com.microsoft.sqlserver.jdbc.SQLServerConnection.executeCommand(SQLServerConnection.java:1416)
    at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeCommand(SQLServerStatement.java:185)
    at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeStatement(SQLServerStatement.java:160)
    at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeQuery(SQLServerStatement.java:620)
    at TestingDB.main(TestingDB.java:33)
    I have also tired to put 1433 port in firewall exception list but same result.
    Any suggestion how to fix this issue?
    Regards,
    Sajid

    just try the appending the username in the sql query .., select * from sa.test
    - Double check that the table exist in the same schema which your are connecting
    Thanks
    Suren

  • How to perform auto update in staging database using warehouse builder ?

    Hi ,
    here our client requirement is?
    our client want to transfer data from their production database to staging database using warehouse builder.and also what ever the update occur in production database
    that must be reflected in staging database.
    here we are transfering data from product-db to staging using etl(maping--insert/update operator )
    it is transfering fine.but it is not automaticaly updating in staging db with new update in production database?
    can any body give me the details how to achive it.
    Thanks & regards,
    k azamtulla khan.

    Hi,
    firstly there are two threads for the same issue from youself(excluding this one) which is a waste of others time so kindly refrain from doing so and use one thread.
    OWB: how can automatic updation  perform in staging database using OWB
    OWB: how to use insert/update table operator for target table
    secondly, with regards to the options , here are some options:
    1. Use trigger for update.
    2. Use materialized view(refresh on commit)
    3. Use oracle advance queing mechanism (OAQ) for queing the recent inserted/updated records.
    Kindly close other threads and maintain just one thread.
    Regards
    Message was edited by: Rado
    user647181

  • Trigger and Update Flag Table

    I've recently started trying to automate around a dozen procedures. These procedures are set to run immediately after the necessary previous procedure(s) is(are) done.
    What I am attempting to accomplish is a single generic trigger that will fire off each procedure when its parent procedures have finished firing. This will be accompanied by an update_flag table with three columns
    PARENT_PRC----------------------CHILD_PRC----------------------FLAG
    parent_prc_name1--------------child_prc_name1-----------------N
    parent_prc_name1--------------child_prc_name2-----------------N
    parent_prc_name3--------------child_prc_name3-----------------Y
    Logic:
    *1.*     When a procedure fires it updates this table to set any rows in which it is the “PARENT_PRC” by updating the FLAG column to = Y.
    *2.*     The trigger will execute a child procedure if its flag (or in the case of multiple parent procedures; all of its flags) are set to 'Y'. This trigger is set to fire AFTER a table update on the UPDATE_FLAG table.
    ----a.     I have to execute the procedure UFLAG in a job because I want the trigger to execute the procedure and then continue running immediately, rather than wait for the procedure to finish then commit. This way the trigger could start several procedures all running at the same time.
    ----b.     I have made it an autonomous transaction because I needed the job to fire immediately rather than be queued, which required a commit within the trigger.
    *3.*     The last step is to set the flag in UPDATE_FLAGS back to 'N' for CHILD_PRC = '||uflag||' once the child procedure is complete.
    ----a.     I have tried placing the update child_prc = 'N' in the trigger but it won’t allow a trigger that fires on update to update the same table.
    ----b.     I want to avoid putting the update statement in all of my procedures because I would like the option of running these procedures manually for testing purposes WITHOUT effecting the update_flags table.
    Number 3. is the key problem I have been having. Placing code within the trigger to update the update_flags table setting 'Y's back to 'N's once the procedures have fired causes a deadlock error.
    I believe this is simply because the trigger is attempting to update a table which (upon updating) causes the same trigger to fire before it has finish executing.
    How can I update the Flag table to reset the update flags back to 'N'?
    Is there a different way of doing this all together?
    Here is some code with dummy procedures that demonstrates what I have so far.
    With this code, executing parent procedures should set the update_flag table to 'Y' for FLAG where procedure = 'parent_prc'.
    I need to find a way to execute the child procedures AND set the FLAG column back to 'N' from the trigger.
    ex. executing parent_1 should set update_flags.flag = 'Y' where parent_prc = 'parent_1' and thus execute procedure CHILD_A and CHILD_B.
    create table update_flags (parent_prc varchar2(10), child_prc varchar2(10), flag varchar2(1));
    insert into update_flags values('parent_1', 'child_a', 'N');
    insert into update_flags values('parent_1', 'child_b', 'N');
    insert into update_flags values('parent_2', 'child_c', 'N');
    insert into update_flags values('parent_3', 'child_c', 'N');
    insert into update_flags values('parent_4', 'child_d', 'N');
    CREATE OR REPLACE procedure parent_1 as
    BEGIN
    update update_flags set flag = 'Y' where parent_prc = 'parent_1';
    END parent_1;
    CREATE OR REPLACE procedure parent_2 as
    BEGIN
    update update_flags set flag = 'Y' where parent_prc = 'parent_2';
    END parent_2;
    CREATE OR REPLACE procedure parent_3 as
    BEGIN
    update update_flags set flag = 'Y' where parent_prc = 'parent_3';
    END parent_3;
    CREATE OR REPLACE procedure parent_4 as
    BEGIN
    update update_flags set flag = 'Y' where parent_prc = 'parent_4';
    END parent_4;
    CREATE OR REPLACE procedure child_a as
    BEGIN
    dbms_output.PUT_LINE('CHILD_A Worked');
    commit;
    END child_a;
    CREATE OR REPLACE procedure child_b as
    BEGIN
    dbms_output.PUT_LINE('CHILD_B Worked');
    commit;
    END child_b;
    CREATE OR REPLACE procedure child_c as
    BEGIN
    dbms_output.PUT_LINE('CHILD_C Worked');
    commit;
    END child_c;
    CREATE OR REPLACE procedure child_d as
    BEGIN
    dbms_output.PUT_LINE('CHILD_D Worked');
    commit;
    END child_d;
    CREATE OR REPLACE TRIGGER MASTER_TRG
    AFTER UPDATE
    ON UPDATE_FLAGS
    DECLARE
    Pragma  AUTONOMOUS_TRANSACTION;
    BEGIN
      DECLARE
      job_num number;
      uflag varchar2(1000);
      BEGIN
            select  MAX(case when COUNT(case when flag='Y' then 1 end)=COUNT(*) then CHILD_PRC else '  ' end)
            into uflag
            from        update_flags
            group by    child_prc;
            IF   uflag <> '  ' THEN
                                      --update update_flags set  flag = 'N' where child_prc = uflag     --(line of code that causes deadlock error)
                            dbms_job.submit (job => job_num,
                            what => ' '||uflag||';'
            END IF; 
       END;            
    COMMIT;
    END MASTER_TRG;
    execute parent_2;
    execute parent_3;

    >
    I think I am getting my head around the transactional/trigger issue.
    >
    It doesn't sound like it since you are still talking 'triggers'. At any rate it is OP that needs to get their head around it.
    OP doesn't even know what the entire process needs to be but has already decided that
    1. a single generic trigger that will fire off each procedure when its parent procedures have finished firing
    2. an update_flag table with three columns: PARENT_PRC, CHILD_PRC, FLAG
    3. a procedure fires it updates this table to set any rows in which it is the “PARENT_PRC” by updating the FLAG column to = Y.
    4. a job - I have to execute the procedure UFLAG in a job
    5. I have made it an autonomous transaction because I needed the job to fire immediately rather than be queued, which required a commit within the trigger.
    6. there should be an option of running these procedures manually for testing purposes WITHOUT effecting the update_flags table.
    Fortunately OP had the wisdom to ask
    >
    Is there a different way of doing this all together?
    >
    Doesn't anyone design things anymore? Seems like everyone just wants to decide what the solution ought to be be and then try to force the problem to fit into it.
    The first stage is the DESIGN - not the implementation details or technology to use.
    The first design step is to outline, or flowchart, the PROCESS that needs to take place. Since OPs post lacks sufficient detail I will substitute my own 'guesstimations' to illustrate.
    1. there are one or more 'parent' processes
    2a. these parent processes are allowed to run in parallel as they do not interfere in any way with the processing done by other parent or child processes. (is this true?)
    2b. these parent processes ARE NOT allowed to run in parallel as they may interfere with each other.
    3. Each parent process can have one or more 'child' processes. (it appears that these aren't really children but rather processes that are 'dependent' on the parent or that must always be executed after, and each time that the parent executes.
    So here are just SOME of the things that are missing that must be known before possible alternatives can be explored
    1. Re item #2 - can the parent processes be executed in parallel? Or must they be executed serially? Will any of the parent processes be dependent on any other parent or child process?
    2. What is the relationship between a parent process and its child processes? Is the parent always executed first? What triggers the parent execution? How often is it executed?
    What if it is already executing? What if other parent processes are currently executing? What if one or more of its child processes are executing? What if the parent process fails for any reason - what action should be taken?
    Based on what was posted a set of parent and child processes might need nothing more than: execute parent, execute child1, execute child2, . . ., execute childn.
    3. What is the relationship between the child processes that belong to the same parent? Can they be executed in parallel (i.e. are they completely independent)? Or must they be executed in some particular order? What if one or more of the child processes fails for any reason - what action should be taken?
    4. Will any other user or process be executing these parent or child processes? That could interfered with the automated stream.
    5. What type of exception handling and recovery needs to be implemented in one or more steps of the processing fail for some reason?
    Typically there is often one or more control tables (OPs flag table) to control and limit the processing. But the table would have status information for every process not just the children:
    A. STATUS - DISABLED, ACTIVE, RUNNING, IDLE, ERROR
    B. START_TIME
    C. END_TIME
    D. RESULT_CODE
    The control table can be used by a parent or child process to determine if it is permitted to run. For example the first thing a procedure might do is check it's own STATUS. If it is already running it would exit or log an error or message. If that test is passed it might check the status of any dependent processes. For example it might check that its child processes are ACTIVE and ready to run; if a child was still running the parent would exit or log an error or message.
    The control process would lock the appropriate control table records (FOR UPDATE) and would set the status and other fields appropriately to prevent interference by other processes or procedures.
    Design first. Then look at the implementation options.

  • How to trigger renumbering of rows in a group?

    Suppose we have a table ORDER_DETAILS with columns (ORDER_ID, LINE_NUMBER,DESCRIPTION).
    We have these rows:
    order_id, line_number, description
    17,1,'A'
    17,2,'G'
    17,3,'R'
    17,4,'Q'
    Next we insert a new row
    17,2,'K'
    How to trigger renumbering?
    This should be the result after renumbering.
    17,1,'A'
    17,2,'K'
    17,3,'G'
    17,4,'R'
    17,5,'Q'
    Next we move line 5 to line 2.
    How to trigger renumbering?
    This should be the result after renumbering.
    17,1,'A'
    17,2,'Q'
    17,3,'K'
    17,4,'G'
    17,5,'R'
    This question is related to another discussion:
    https://forums.oracle.com/thread/1088303

    create table order_details
    (order_id number,
    line_number number,
    description varchar2(30)
    rowdependencies;
    begin
    insert into order_details values (17,1,'A');
    insert into order_details values (17,2,'G');
    insert into order_details values (17,3,'R');
    insert into order_details values (17,4,'Q');
    end;
    select * from order_details order by line_number
    ORDER_ID
    LINE_NUMBER
    DESCRIPTION
    17
    1
    A
    17
    2
    G
    17
    3
    R
    17
    4
    Q
    create or replace procedure renumber(p_order_id number) as
    begin
      update order_details od
         set line_number = (select rn
                              from (select rowid rid,
    /* for autocommit active APEX etc. */  row_number() over (order by line_number,ora_rowscn desc) rn
    /* for autocommit = OFF  preferred     row_number() over (order by line_number,ora_rowscn nulls first) rn */
                                      from order_details
                                     where order_id = p_order_id
                             where rid = od.rowid
       where order_id = p_order_id;
    end;
    begin
    insert into order_details values (17,2,'K');
    renumber(17);
    end;
    select * from order_details order by line_number
    ORDER_ID
    LINE_NUMBER
    DESCRIPTION
    17
    1
    A
    17
    2
    K
    17
    3
    G
    17
    4
    R
    17
    5
    Q
    begin
    update order_details
        set line_number = 2
      where order_id = 17
        and line_number = 5;
    renumber(17);
    end;
    select * from order_details order by line_number
    ORDER_ID
    LINE_NUMBER
    DESCRIPTION
    17
    1
    A
    17
    2
    Q
    17
    3
    K
    17
    4
    G
    17
    5
    R
    Regards
    Etbin

  • How to trigger onerror of f:ajax inside a h:commandButton?

    hi, how to trigger onerror of f:ajax inside a h:commandButton from it's action method?
    <h:form>
       <h:inputText id="i1" value="#{bean.i1}"/>
       <h:commandButton id="go" action="#{bean.process}" value="go">
          <f:ajax render="o1" onerror="myfunction();"/>
       </h:commandButton>
       <h:outputText id="o1" value="#{bean.o1}"/>
    </h:form>then in the bean
        public String process() {
            if(isOK()) {
                calculate();
                return null;
            } else {
                //here I want to send an ajax error, to trigger the onerror function in the client
       }I don't know what I must do inside the action method to signalize an ajax error. Do I have to throw a specific Exception or any run time exception, or another approach?

    797701 wrote:
    Basic idea of commandbutton is to send form data to server, basic idea of ajax is to update part of page. Hopefully your example is very generic or just a test, otherwise using ajax in your example makes no sense.No. AJAX - Asynchonous Javascript and XML. Key word: asynchronous.
    The basic idea behind Ajax is to make a request to the server asynchronous. Its purpose, even in JSF, is not to update part of a page, that may be a result of doing the request asynchronous. It is perfectly valid to want to do an ajax call from a button, it depends on what requirements you have and nothing else.

  • Howto trigger an update of SCEP at the end of the task sequence?

    Hi,
    Howto trigger an update of SCEP at the end of the task sequence?
    Please advise.
    J.
    Jan Hoedt

    Do you know if the command is running in WinPE mode or full-OS mode? You might try wrapping the command into a .bat or .cmd file and then running that through the task sequence.
    Edit - I don't know how you're doing your task sequence initializing (e.g. unknown computers, OSD imaging collections, etc), but do you have a Client Policy (not Endpoint Protection Policy) set to allow SCEP to be managed?  And if so, how are your imaged
    PC's getting into the collection to be managed.  Same for SCEP updates.
    What I wonder is if your PC's know they have updates deployed to them.  That command line, if I remember right, will search for your internal update server, aka WSUS/SCCM for updates.  If the device does not have SCEP updates deployed to it, that
    command will do nothing.  If you add -MMPC to the end of it the device will download from Microsoft.
    There's a setting client setting for Endpoint protection called Disable Alternate Sources for the Initial Update.  What is that set to?  Sorry, I know I just threw a bunch of information at you and asked a lot of questions.

  • How many trigger possible on one table?

    How many trigger possible on one table?

    Hi,
    shiv kumar wrote:
    How many trigger possible on one table?There's no limit.
    If you have more than one trigger that fires at the same time (for example "BEFORE INSERT OR UPDATE ... FOR EACH ROW"), ask yourself why you want or need 2 separate triggers, rather than one (which maybe calls two sparate procedures).

  • BODS 3.1 : How to trigger an email alert for the jobs on BODS server ?

    Hi All.
    I have this request.
    BODS 3.1 : How to trigger an email alert for the jobs on BODS server ?
    We have jobs scheduled on BODS running smoothly and absolutely fine.
    But to check, i am logging into the admin console and check for the jobs status.
    I would like to have an email to be received from BODS after each job is finished.
    It could succuessful. Or it could fail.
    Whatsoever, i wish to receive an email alert as soon as a job is finished.
    Can anyone advise me as to whether this could be made possible.
    And if yes, how this could be done.
    Thanks for your help in advance.
    In BOE CMC / for webi / schedule / we find an option to send email for a job success or a job failure.
    Is there any option similar to that in BODS ?
    Also would like to know :
    how to use the smtp_to or mail_to functions ?
    how to set up the smtp server for this ?
    thanks
    REgards
    indu
    Edited by: Indumathy Narayanan on May 31, 2011 3:47 PM

    Hi.
    Since am new to this BODS. I need some help.
    I already have many jobs which are running absolutely fine.
    And when a job runs, and finishes, am able to see the trace saying
    e.g. :
    Job_abc is completed successfully.
    We got the smtp service activated for our test server.
    and we hae a group email id.
    I have put the details of the smtp server / ip address / and said apply restarted.
    The i created a simple test script as below :
    print (' Before email ' );
    smtp_to('abc@company_name.com', 'Job ' || job_name() ||' on ' || host_name() || ' has FAILED',
    ' the job has failed', 0, 0);
    print('After Email ');
    It does send a email to as per smtp_to whatever email is specified.
    But how to differentiate between a job success
    And a job which has failed.
    I wish to have a mail which says on the subject :
    'Job ' || job_name() ||' on ' || host_name() || ' has completed successfully'
    ==> IF it is a success
    OR
    'Job ' || job_name() ||' on ' || host_name() || ' has failed'
    ==> if it has failed
    How to make the system identify, whether
    to send a success message or a error message whatever
    Could anyone advise.
    thanks
    indu

Maybe you are looking for

  • How to convert the cursor to lens

    Hi anyone here can help me I have developed an application which opens the FITS Images(Flexible Image Transform System- which is used to open astronomical images) . Now i need to convert the cursor to lens means as and when the cursor moves on the im

  • Sound cuts out on DVD slide shows with music

    I have tried 5 DVD slide show programs with the same result.  Hewlett Packard says my hardware is OK but I have a compatability problem.  My wife has the same compaint.  Can you help with my computer?

  • How can I store my settings on an external drive and configure FF to use that path? I want to leave the desktop clean.

    The idea is to run FF on several desktops (work, home, cafe etc) but making it look like the same one. This also ensures that no personal information is left on the desktop and that there is no need to sync data for the NSA to collect. cf Portable Th

  • SYSAUX tablespace grow too quick????

    We have EBS R12.1 on LINUX system. Recently I found our development EBS database SYSAUX tablespace grow very quick. The SYSAUX tablespace has two data files and each data files size is 6GB (total 12 GB). In one month all 12 GB space are gone. My ques

  • BBM Status

    Can anyone tell me what it means when one of my blackberry messenger contacts is "unreachable"? Message Edited by GaDawg on 01-24-2009 10:36 AM