How to Fire Trigger, when changes are applied on destination??

Hi,
I want to fire the following trigger at destination, when changes are applied from source table (cms.test_2) to destination table(cms.test_2).
create or replace trigger Ins_and_upd
after insert or update of send_status on cms.test_2
declare
begin
update cms.test_2
set RECEIVE_STATUS = 'YES'
where UPPER(send_status)=upper('YES');
end;
Thanks,
faziarain

I am using oracle10g stream replication, and database version is "10.2.0.1.0".
Basically I have 2 machines named:
--> Site#1_DB ----> Having Table TEST_2 -----> Columns (BID,DBID,Send_Status,Receive_Status,Final_Status).
--> Center_DB ----> Having Table TEST_2 -----> Columns (BID,DBID,Send_Status,Receive_Status,Final_Status).
My Senario example is following:
At Site#1_DB TEST_2 Table contains the following data:
TEST_2 is updating and set the YES value in "Send_Status" column, and this change will replicated to Center_DB TEST_2 table.
BID----------DBID----------Send_Status----------Receive_Status----------Final_Status
1----------2----------YES----------NULL----------NULL----------NULL
2----------3----------YES----------NULL----------NULL----------NULL
3----------4----------YES----------NULL----------NULL----------NULL
4----------5----------YES----------NULL----------NULL----------NULL
At Center_DB TEST_2 Table contains:
In My Senario changes are successfully replicated at Center_DB TEST_2 Table and after replication
Test_2 table is same on both machines.
But Now I want to write my given trigger at Center_DB and this trigger will be fired when changes are replicated
from Site#1_DB to Center_DB.
BID----------DBID----------Send_Status----------Receive_Status----------Final_Status
1----------2----------YES----------NULL----------NULL----------NULL
2----------3----------YES----------NULL----------NULL----------NULL
3----------4----------YES----------NULL----------NULL----------NULL
4----------5----------YES----------NULL----------NULL----------NULL
Output After Firing the trigger at Center_DB:
BID----------DBID----------Send_Status----------Receive_Status----------Final_Status
1----------2----------YES----------YES----------NULL----------NULL
2----------3----------YES----------YES----------NULL----------NULL
3----------4----------YES----------YES----------NULL----------NULL
4----------5----------YES----------YES----------NULL----------NULL
Thanks,
Faziarain.
Edited by: [email protected] on Mar 30, 2009 10:00 PM
Edited by: [email protected] on Mar 30, 2009 10:17 PM
Edited by: [email protected] on Mar 31, 2009 3:48 AM

Similar Messages

  • Why Synonym becomes INVALID when changes are made on the related object ?

    Hi all,
    WHY SYNONYMS becomes invalid when changes are made on related OBJECTS ?
    Is there any specific reasons for this.?
    Is there any method or procedures to make the synonym VALID as soon as the we perform any alteration on the related object.
    Thanks
    Himabala

    Synonym will be validated when it is accessed, no need to take an action.

  • Shared Reminders: How do I stop getting emails when changes are made?

    My wife and I both have iPhone 5's that we bought 2 weeks ago. We are sharing a calendar and a "Grocery" list in reminders. I have everything set up where it is working properly but I keep getting emails when a change is made to the grocery list. I don't get emails when there are changes to the calendar.
    I want to stop getting emails when there are changes made to our grocery list but I am not sure how to do it. We both have icloud accounts and we both have checked the box under preferences in my calendar for "in app notifications" for icloud invitations. When I open Reminders in icloud I don't see a preferences for reminders.
    If it helps , or makes any difference, my wife has a yahoo mail account and I have a hotmail account. She does not get emails about changes being made.
    thanks

    Did you try to switch Push "off" and fetch to "manually"? This way no mail is delivered until you choose to open the mail app. The moment you open Mail on your device, your mail account will be checked and if any, mail will be delivered.
    Fetch New Data
    This setting lets you turn Push on or off for MobileMe, Microsoft Exchange, Yahoo!, and any other push accounts on iPhone. Push accounts deliver new information to iPhone whenever new information appears on the server (some delays may occur). You might want to turn Push off to suspend delivery of email and other information, or to conserve battery life.
    When Push is off, and with accounts that don’t support push, data can still be fetched—that is, iPhone can check with the server and see if new information is available. Use the Fetch New Data setting to determine how often data is requested. For optimal battery life, don’t fetch too often.
    Turn Push on: Choose “Mail, Contacts, Calendars” > Fetch New Data, then tap to turn Push on.
    Set the interval to fetch data: Choose “Mail, Contacts, Calendars” > Fetch New Data, then choose how often you want to fetch data for all accounts.
    To conserve battery life, fetch less frequently.
    Setting Push to OFF (or setting Fetch to Manually on the Fetch New Data screen) overrides individual account settings.
    page 203 iPhone_User_Guide
    Message was edited by: Ingo2711

  • How Long until layout set changes are effective?

    I have made a copy of an SAP layout set to my own namespace.  When I modify some of the associated command groups, the changes are NOT showing immediately when I apply the layout set to a km folder.  I did find the 'rendering' cache setting under config and set it to a smaller value (was 1800 seconds : I made it 60 seconds), seemingly to no avail  I have used rendering debug mode and verified that my layout set is being applied. Is there some other settings/cache etc that I can tweak?

    Hi Hurton
    Here's how I usually get around this problem:
    1) Save your changes in the associated command group like you normally do. At this point the changes does not show.
    2) Remove all commands in the associated command group, you are making the changes to using "Shift+DEL". Save the command group with no commands entered.
    3) Enter the commands again into the command group using "Shift+INS". Save your changes.
    Your changes should now be visible. Hope it helps.
    Regards,
    Martin

  • How to get notified when changes happen on Hyper-V host or VMs

    Is there a way to get notified on Hyper-V host or VM changes? Our intention is to notify the system-administrators on any changes.
    1. How to get notified when new VM is created (or deleted) on Hyper-V.
    2. How to get notified when any memory/CPU/disk is added (or deleted) on any VM(s).
    In general: 
    - Get notified when any changes happens to Hyper-V host.
    - Get notified when any changes happens on any VMs.
    Our target servers are Windows Server(2008, 2008 R2, 2012, and 2012 R2)
    We tried to get the notification using "Event Viewer" on different Windows servers (2008, 2008 R2, 2012, and 2012 R2)
    We were able to get event-logs only on one of our 2012 R2 server as described below on creation/deletion of VMs (on another 2012 R2 server, we did not got any such event, Is there any setting required on host computer to get Hyper-V event-logs in "Event
    Viewer"?)
    Log Name:      Microsoft-Windows-Hyper-V-VMMS-Admin
    Source:        Microsoft-Windows-Hyper-V-VMMS
    Date:          12/18/2014 1:21:45 AM
    Event ID:      13002
    Task Category: None
    Level:         Information
    Keywords:      
    User:          SYSTEM
    Computer:      HPHyper-V.COMPUTERNAME.lab
    Description:
    A new virtual machine 'TestVM' was created. (Virtual machine ID A0FED305-7B1A-4BB5-952C-BA9634ACDA45)
    Log Name:      Microsoft-Windows-Hyper-V-VMMS-Admin
    Source:        Microsoft-Windows-Hyper-V-VMMS
    Date:          12/17/2014 10:57:01 PM
    Event ID:      13003
    Task Category: None
    Level:         Information
    Keywords:      
    User:          SYSTEM
    Computer:      HPHyper-V.COMPUTERNAME.lab
    Description: The virtual machine 'TestVM' was deleted. (Virtual machine ID A0FED305-7B1A-4BB5-952C-BA9634ACDA45)

    Thanks for your reply,
    Just to make it more clear:
    In our environment we have enabled Hyper-V on following Windows servers: 2012 R2, 2012, 2008 R2, 2008. The environment is very dynamic, VMs are getting created and deleted very frequently. Our intention is to get notified by any means on VM creation/deletion,
    currently we are relying on event-logs (we are OK with any different mechanism for such notification if there exists, i,e other than event-logs)
    We were able to get event-logs only on few of our 2012 R2 server on creation/deletion of VMs. On another 2012 R2 server, we did not got any such event (do we need to make some settings on 2012 R2 to get events? If yes, what are those settings).
    Also we are not getting any such event of VM creation/deletion on our Windows Server 2012, 2008, 2008 R2. Is there any setting required on hese host computer to get Hyper-V event-logs in "Event Viewer" for VM creation/deletion?

  • How to replace sky when there are trees in the photo

    I have several photos taken outdoors with a dull sky. I also have several sky shots to supply the blue sky; with or without clouds. I know a couple of ways to do  that --as long as the horizon line is clear, such as roofs, etc.  My preferred method is to use a tool; e.g., Magic Wand, to select the sky area and then copy/paste a blue sky image using Ctrl+Shift+V command. This makes the copied sky inserted into the original image and I'm happy with the results.
    But when there are trees or other bushes between the camera and the sky, problems begin.  No matter how carefully I try to include all the "holes" in those trees, the end result contains white spots where the selected section failed to follow the tree "holes".  Anybody know how to fix these types of problems?  I am somewhat familiar with layers-- which I have tried to use to solve this problem.
    Using PSE-12 on Windows 8.1
    TIA,
    Pete Grant

    Pete,
    There are several ways to do this. In my experience the Alibony technique works well. You will be able to use your "good" sky pictures:
    Watch Lesson 12: Quick Colorless Sky Replacement | Alibony Lessons for Photoshop Elements Episodes | How To Videos | Bli…
    As I pointed out to you on June 5, 2014, this is how I do it after watching the Alibony video.
    Open your picture (A) (File>open), and open the replacement sky picture (B)
    On the sky picture (B), go to Select>all from the menu, then Edit>copy to place it on the clipboard
    Go back to your picture (A), then Edit>paste. The new sky (B) should come in on a new layer
    With the move tool, use the corner handles to reduce the size of the sky (B) to cover the old sky on (A)
    In the layers palette, set the blending mode of (B) to darken
    Set the foreground color chip to white
    Get the Gradient tool out of the toolbox, and drag a foreground to transparent, linear gradient from below up to the top of the tree line, while holding down the shift key.
    With a soft white brush, at reduced opacity, gently paint the horizon a bit, as we want the horizon to be a tad lighter than the rest of the sky.
    If necessary, add a few clouds with the Return to Eden set.

  • Automatic Output Message when Changes are made to a PO

    Hi Gurus,
    I would like to know to to set up automatic print or fax for PO output once changes are made to it. I was able to send automatic print/fax when i create a new PO. But when that same PO is changed, i still need to go to ME9F to fax it. Is there a way to make it automatic?
    Thanks,
    Jograd

    Hi Greetings
    would like to know to  set up automatic print or fax for PO output once changes are made to it. I was able to send automatic print/fax when i create a new PO. But when that same PO is changed, i still need to go to ME9F to fax it. Is there a way to make it automatic?
    You need to make the following u201CFine-Tune controlu201D settings for the output type so that output will be generated automatically once changes are made.
    ONLM --> Messages --> Output control --> Message types -->Define Message Types for Purchase Order -->  Fine-Tuned Control: Purchase Order --> Include indicator 2. Printout of changes for the output type.
    Gobinthan G

  • How to fire trigger/event on session end !?

    Is there a way to fire trigger or some store procedure just before session ends, but also get info from ending session (like Terminal, Machine, User...) ?

    create table logoff_tbl (
      who  varchar2(30),
      when date
    create trigger trg_logoff
    before logoff on database
    begin
      insert into logoff_tbl values(sys_context('userenv','session_user'), sysdate);
    end;
    /

  • How to know whether the changes are implemented by sap or not(not manually)

    Hi,
    On 4.7 version in some standard objects(SAP Objects) some changes are done by custom by using modification assistance.
    On ecc 6.0 version I need to know whether the same changes are done by custom or sap? ( not manually)
    Let me know is there any process to know the changes done by sap or custom on ecc 6.0.
    Thanks,
    Radhika

    Hi ,
    u can check  for entries  in table ADIRACCESS.
    Regards
    prabhu

  • How to delete archivelogs once they are applied on Physical Standby

    We have 10.2.0.4 Primary and Physical Standby.
    According to Note, ID 331924.1, we have
    on Primary:
    RMAN> SHOW ARCHIVELOG DELETION POLICY;
    RMAN configuration parameters are:
    CONFIGURE ARCHIVELOG DELETION POLICY TO APPLIED ON STANDBY;
    on Standby:
    RMAN> SHOW ARCHIVELOG DELETION POLICY;
    RMAN configuration parameters are:
    CONFIGURE ARCHIVELOG DELETION POLICY TO NONE;
    I would like to delete the archivelogs from Primary(as soon as they are applied to standby) as well as from standby and schedule a RMAN script which will run every hourly. The archivelogs are taken on flashback area.
    Please guide.

    Handle: chakra
    Status Level: Newbie
    Registered: Oct 27, 2006
    Total Posts: 107
    Total Questions:  56 (46 unresolved)
    Name Anirban
    Why so many open questions. Close the answered questions, give points and keep forum clean.
    Refer the below link
    Best Way to monitor standby, primary databases, including alert logs, etc.
    Edited by: jazz81 on 10-May-2012 16:38

  • Howe can I tell when there are no references to an object?

    Hi all,
    Is there any way for me to know when there are no references to an object without using finalize()?
    I want to pool created objects when it is safe to do so.
    finalize() won't work since it is called only once for every object instance.
    Regards,
    Marcus

    If you are trying to establish an object pool by placing the objects back in the pool when there are no references to the object, then I am afraid you are out of luck.
    If there were no references, then you would not have a "handle" on the object to be able to manipulate it in any way (like putting it back in the pool).
    If you are talking about something else, then the classes in java.lang.ref.*, might be of use.
    If you are really trying to pool objects, then you should have some sort of "close" method in the objects that is called when they are no longer needed and can be returned to the pool.

  • Trigger WF when changes are made in a table

    HI folks!
    Could you please guide me as to how to trigger a WF when an new row is inserted in a particular table in SAP.
    Appreciate a quick response.
    Thanks!

    Hi,
       Go to SCDO and look for your Change Document. If it doesn't exist, you should create your own change document, but if your target is only to trigger a WF maybe you can find out other ways (ie call function SAP_WAPI_CREATE_EVENT).
    Remeber that your change document id code usually is not the same of your BO.
    To set a link between change document and workflow Business Object call TRX SWEC.
    Here you can set al ink to raise an event when you create, modify or delete a table row (you can also work on specific fields).
    An easy way to understand if your CD is active is to make a change to an object and check new entries in table CDPOS and CDHDR.
    Anyway it's always a good idea look for documentation :
    http://help.sap.com/saphelp_47x200/helpdata/en/2a/fa015b493111d182b70000e829fbfe/frameset.htm
    Regards,
        Gianluca

  • How to not retriggered output type when changes are made in Purchase Order

    Hi All,
    Could you let me know how can I resolve this one?
    We have a custom output type. Now this output type should NOT be automatically retriggered if a change is made to the document/purchase order. Currently the system automatically repeating the output type for every change made to the document/purchase order. But there is still an option for the user to be able to manually repeat the output.
    TIA

    Hi,
    1.In order to restrict the output type to trigger you need to write the requirement routine in transaction
       VOFM> requirements>output control.
    2. create the requirement routine in application EF and write the required logic and pass the sy-subrc EQ 4 if you not require to trigger the output type and pass sy-subrc equal 0 to trigger the output type.
    3. assign this requirement routine to custom output type.

  • How do I Sync All 5,000 of my songs onto my iPod 5th Generation without no problems at all, Most of my songs have the Album Artworks, some are ACC converted but after the "Changes Are Applied", it will say - Songs were not synced. File wasn't convert

    I Am having a problem with syncing 5,000+ songs onto my IPod 5th Generation. Everytime I sync, some songs will either go away or ALL of them will come off my iPod. I have iTunes 12 for Windows, and it has a slow syncing process and it will take days for songs to get on the iPod. It will even say that any of the songs "we're not synced to my iPod because the file wasn't converted..
    I Need help please, I would appreciate it.

    Hey Bryce,
    Welcome to Apple Support Communities. 
    It sounds like some songs aren’t being synced to your iPod touch because they aren’t in a compatible format. Can you play those tracks in iTunes? Try selecting the tracks that won’t sync and creating a new version of them with iTunes as shown in the article below.
    iTunes 11 for Windows: Save a copy of a song in a new file format
    Take care,
    -Jason

  • RMAN recover on a different server - Verify all changes are applied

    Hey everyone,
    I have two database servers, Oracle 10g SE on linux. One is the 'primary', and we plan to switchover to the other newer server. In order to minimize the downtime from a duplicate database, or a full backup and restore/recover, I restored the database to the newer server using RMAN, and just continuously apply the archivelogs generated from the original database through RMAN> recover database;.
    My question is, at the time when we do do the switchover, how can I ensure that all changes in the database are written to the archivelogs? I understand I can do a 'alter system switch archivelog' until all groups are inactive, but will this be enough? I've noticed that when I force an archivelog switch, the previous group still has an 'ACTIVE' status, even though I thought that the ARC process had just written out all the changes from that redo log to the archivelog?
    Any help would be much appreciated. Thanks

    Dear oscrub,
    You can compare the system change numbers on both databases and you can also use the standby redo log files for synchronized data replication with the maximum availability or maximum protection protection levels.
    I you don't want to see the archivelog as ACTIVE state you need to run the following command;
    SQL> ALTER SYSTEM CHECKPOINT GLOBAL;You will manually trigger the checkpoint and the data in the redolog (active one) will be written to the database thanks to the database writer processes. With that way, you won't see the online redo log as ACTIVE state. You will see online redologs as "CURRENT" and "INACTIVE".
    I hope that addresses your questions.
    Regards.
    Ogan

Maybe you are looking for

  • Can this usage of CASE stmt be fine tuned?

    Hi, Need inputs in improving the performance of the below query. (Other forms of rewriting the query) insert into c(col1, col2, col3) select b.col1, b.col2, (case   when b.col3 is not null and b.col2 = 'x'   then   (select col3 from a where a <<join_

  • Help for a beginner

    I AM USING ORACLE DEVELOPER2000 R2.1 (STILL STUDYING IT)AND FIRST I INSTALLED ORACLE 8 PERSONAL EDITION AS A DATABASE ENGINE. THE PROPLEM IS THAT I HAD THE PROGRAM READ THE TABLES 'SUMMIT2' FOR THE USER : scott AND THE PASSWORD: tiger. THEN I MAKE IT

  • Field values are not erased when I change content types.

    On an SP2010 site I created 2 Site Columns  TextColumn1 and  TextColumn2 (both Single Line of text). I added Two Content Types ContentType1 and ContentType2 (both derived from Item). I created a list and enabled content types. I Added ContentType1 an

  • What is the reason to create database directory in oracle instead of oracle could use ;

    Hi all,      I want to know why oracle has given the concept of directory as database object while a file on os can be access directly by it full qualified name. like we use directory object in external table and expdp etc.

  • Regarding PAI event display of data in table control

    Hi all, I have a drop down list in my module pool screen and based on my selection the value in not getting captured as i have to display table control data (or item level data ) based on the delivery that is selected from the drop down. The first le