Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Database > Oracle
|
Oracle General Oracle database discussions.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Oracle section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old September 16th, 2008, 03:13 PM
Registered User
 
Join Date: Sep 2008
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Flex Trggers After statement

Hello i am a newbie who needs urgent help i keep getting the below failure on my databridge.


java.lang.Exception: Record Key = (OBJ_CODE, 10617), (OBJ_ORG, *). System error:class com.dstm.mp.mpentitycollection.EntityCollectionSys temError: Error in processing entity DBError Error in updating R5Objects table: java.sql.SQLException: ORA-04091: table ADMIN0134_TRN.R5OBJECTS is mutating, trigger/function may not see it ORA-06512: at "ADMIN0134_TRN.TSCALC", line 190 ORA-06512:

I understand now why this is happening but i am having trouble writing the after statement in my code can anyone look at the below flex trigger and see how to write in an after statement to fire the trigger after the table is updated.

Description - When an Asset is Blancco'ed there can be sub assets attached to
the main asset. Each sub asset with be created via Databridge. This flex trigger
will connect the Main Asset to the Sub Asset Structures
Table - R5PROPERTYVALUES
Type - POST-INSERT
*/
Declare

v_subasset varchar2(255);
v_mainasset varchar2(255);
v_subobjtype varchar2(255);
v_subobjrtype varchar2(255);
v_subobjorg varchar2(255);
v_mainobjtype varchar2(255);
v_mainobjrtype varchar2(255);
v_mainobjorg varchar2(255);


Begin


    select substr(prv_code, 1, instr(prv_code,'#',1,1)-1), prv_value into v_subasset, v_mainasset
    from r5propertyvalues
    where
    prv_property = 'ABLAUID'
    and
    rowid = :rowid;




    select obj_obtype, obj_obrtype, obj_org
    into v_subobjtype, v_subobjrtype, v_subobjorg
    from r5objects
    where
    obj_code = v_subasset;



    select obj_obtype, obj_obrtype, obj_org
    into v_mainobjtype, v_mainobjrtype, v_mainobjorg
    from r5objects
    where
    obj_code = v_mainasset;


    insert into r5structures
    (STC_CHILDTYPE, STC_CHILDRTYPE, STC_CHILD, STC_PARENTTYPE, STC_PARENTRTYPE,
    STC_PARENT, STC_ROLLDOWN, STC_ROLLUP, STC_EQUIVALENT, STC_DOWNTIME,
    STC_CHILD_ORG, STC_PARENT_ORG)
    Values
    (v_subobjtype, v_subobjrtype, v_subasset, v_mainobjtype, v_mainobjrtype,
    v_mainasset, '-', '+', '-', '-', v_subobjorg, v_mainobjorg);


exception

when no_data_found then

    Null;


End;
Regards

Chris





Similar Threads
Thread Thread Starter Forum Replies Last Post
Flex Triggers cbyrne123 Oracle 1 October 20th, 2008 02:54 AM
Merging in flex rsshanmugapriya Beginning VB 6 2 December 16th, 2006 01:54 AM
flex grid [email protected] General .NET 0 January 12th, 2006 01:18 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.