You want to capture update dates, with trigger on a view to refresh quickly materialized. But trigger on MV consider inserting and updates are inserts only.
Oracle Database 11 g Enterprise Edition Release 11.2.0.4.0 - 64 bit Production
PL/SQL Release 11.2.0.4.0 - Production
CORE Production 11.2.0.4.0
AMT for Linux: Version 11.2.0.4.0 - Production
NLSRTL Version 11.2.0.4.0 - Production
I create the structure of the table like that.
create table test1 (a primary key, b (2) char number, date c, d varchar2 (10), date of e);
create table test2 (number of ab, cd (2) tank, date of the ef, gh varchar2 (10), date of the ij, kl varchar2 (100));
Create materialized view log on test1;
create materialized view fast refresh test1_v on commit in select * from test1;
I have create a trigger of the sample
CREATE OR REPLACE TRIGGER test1_trig
AFTER INSERT OR UPDATE OR DELETE
ON test1_v
FOR EACH LINE
DECLARE
lr_test2 test2% ROWTYPE;
lv_error VARCHAR2 (4000);
BEGIN
lr_test2. AB: =: NEW.a;
lr_test2. CD: =: NEW.b;
lr_test2. GH: =: NEW.d;
IF THE INSERTION
THEN
lr_test2. EF: = SYSDATE;
lr_test2.IJ: = SYSDATE;
lr_test2.KL: = 'INSERT ';
INSERT INTO test2
VALUES lr_test2;
ELSIF UPDATE
THEN
lr_test2.IJ: = SYSDATE;
lr_test2.KL: = 'UPDATE ';
UPDATE test2 = lr_test2 ab WHERE = LINE: OLD.a;
ELSIF REMOVAL
THEN
DELETE FROM test2
AB = WHERE: old.a;
END IF;
EXCEPTION
WHILE OTHERS
THEN
lv_error: = SQLERRM;
INSERT INTO XXDOMINO_FG_DATA_LOAD_ERROR
VALUES ('test1_trig',
: OLD.a,.
"test1_trig,"
LV_ERROR,
SYSDATE);
COMMIT;
END test1_trig;
/
So, if check you my code,.
When I insert EF = SYSDATE, IJ = SYSDATE.
Update EF is not changed, IJ = SYSDATE.
So I like to capture their insertion and update dates.
But if updates or insert arrives on the materialized table. The trigger themselves as an INSERT only.
So how do you capture the updates?
I use the statemnet with out merger with performance and also able to capture the update dates.
CREATE OR REPLACE TRIGGER test1_trig_merge
AFTER INSERT OR UPDATE OR DELETE
ON test1_v
FOR EACH LINE
DECLARE
lr_test2 test2% ROWTYPE;
lv_error VARCHAR2 (4000);
BEGIN
IF THE REMOVAL
THEN
DELETE FROM test2
AB = WHERE: old.a;
ELSIF INSERTION
THEN
MERGE INTO test2 one
B using (SELECT 1 FROM DUAL)
WE (ab =: new.a)
WHEN MATCHED
THEN
UPDATE the VALUE ab =: NEW.a.
CD =: NEW.b,
GH =: NEW.c
IJ = SYSDATE,
KL = "Update"
AB WHERE =: old.a
WHEN NOT MATCHED
THEN
INSERTING VALUES (: NEW.a,)
: NEW.b,.
: NEW.c.
: NEW.d,.
: NEW.e,.
"INSERT");
END IF;
EXCEPTION
WHILE OTHERS
THEN
lv_error: = SQLERRM;
INSERT INTO XXDOMINO_FG_DATA_LOAD_ERROR
VALUES ('test1_trig',
: OLD.a,.
"test1_trig,"
LV_ERROR,
SYSDATE);
END test1_trig_merge;
/
DISPLAY ERRORS;
Tags: Database
Similar Questions
-
When you open a program, such as the system restore or turbo tax it always ask what program you want to open this program with a list of options such as the Adobe reader, internet explorer, yahoo Messenger, etc..
is there any solution for this?
Hello
The issue seems to be with the file association so corrupt that I suggest you run the fix it or follow the manual procedure provided in the link below to fix the problem.
-
I have a desktop with windows 7 and a Linksys E1000 router and you want to connect a laptop with windows 8, it will work router?
Yes, it should work perfectly, if wired (Ethernet) or wireless.
Click on the network icon in the Notification area
Click on the available wireless network that you want to connect
In the list of available wireless networks, click a network, and then click on connect.
Some networks have need a network security key or password. To connect to one of those networks, ask the network administrator or service provider for key security or password.
-
"The server has encountered an error" when you want to send a message with the form.
Hello
"The server has encountered an error" when you want to send a message with the form.
With the businesscatalyst site, the message is well received by the recipient as the site FTP host, the previous message is displayed.
What code do I add and where?
In advance, thank you.
Please, answer in french!
Hello ScratchMaster,
Please see the link below, I'm sure that you will find it useful.
https://forums.Adobe.com/docs/doc-3581
Kind regards
Vivek
-
I lost 5 Lightroom bought in Dec 2014 and want to download another copy with a serial number. It is not available on the site of Adobe Web and Im not interested in Lightroom CC. Can you direct me to an appropriate site? Thanks Frank
Lightroom - all versions
Windows
http://www.Adobe.com/support/downloads/product.jsp?product=113&platform=Windows
Mac
http://www.Adobe.com/support/downloads/product.jsp?product=113&platform=Macintosh
-
I am trying to download the InDesign CS5.5 update and continue to be "Update failed" "please contact your administrator if you want to apply updates on your computer. I did this and now have administrator rights, but I still get the message. How to do the update?
Direct updates
----------------- -
With premiere pro cc2015 why can I get this error message when reading 'timers video and audio are not synchronized?
Hello
Here are the steps.
Install a cable Audio virtual on your machine:
http://virtual-audio-cable.en.softonic.com/
Under HW Audio Configuration configured Virtual audio cable as default input device
And value clock maser virtual audio cable and try reading.
This issue with the message 'Audio material e/s overloaded at 00' can be fixed, follow these steps.
Vinay
-
do not open files in the Panel or when I open any file the message telling to choose the program you want to open this file
Hello
· What is the exact error message that you receive with the error code?
· What is the service pack installed on the computer?
· Do you remember all the recent changes on the computer before the show?
Follow the methods below:
Method 1:
Check the file association, you can see below the link for the steps for the same: how to change or choose the program that starts when you double-click a file in Windows XP: http://support.microsoft.com/kb/307859
Method 2:
Run the checker system files on the computer. Link, we can see: Description of Windows XP and Windows Server 2003 System File Checker (Sfc.exe): http://support.microsoft.com/kb/310747
Note that: if he asks you the service pack CD, follow these steps from the link: you are prompted to insert a Windows XP SP2 CD when you try to run the tool on a Windows XP SP2 computer system File Checker: http://support.microsoft.com/kb/900910 (valid for Service pack 3)
-
Hello
I'm stumped on this one. Whenever you launch any program on the start menu, the command open, run box, the "program would you like to open (progrem.exe) with? appears, example by clicking the shortcut of internet Explorer, invites "which program you would like to open iexplore.exe with? It looks like a file association error but cannot find a list.
HelpHello midryder
Go here
12 straight line
Save the REG file to your hard drive. Double click it and answer Yes to the import prompt.
.
-
"choose the program you want to open this file" always comes up when I want to download something, and no matter what I choose, it will not download.
frustrating... can anyone help pls.
Take a look at this...
http://forums.techguy.org/Windows-Vista/899995-solved-Open-box-opens-every.html
Scroll down to the answer given by Phantom010 -
Hello well the question in the topic... Sorry newbie here! Thanks in advance for any assistance!
Thank you!... Jack
Oh! PS. I bought the eleven version by the way and have an authorized copy of first and second!
These are the only downloads support,
Downloads available:
- Suites and programs: CC | CS6 | CS5.5 | CS5 | CS4 | CS3
- Acrobat: XI, X | 9,8 | 9 standard
- Premiere Elements: 12 | 11, 10 | 9, 8, 7
- Photoshop Elements: 12 | 11, 10 | 9,8,7
- Lightroom: 5.4 (win) 5.4 (mac) | 5 | 4 | 3
- Captivate: 8 | 7 | 6 | 5
- Contribute: CS5 | CS4, CS3
Download and installation help links Adobe
Help download and installation to Prodesigntools links can be found on the most linked pages. They are essential; especially steps 1, 2 and 3. If you click on a link that does not have these listed steps, open a second window by using the link to Lightroom 3 to see these "important Instructions".
-
I tried to reload Rundll32, but in vain. It still does not work. Also, I can not open install/uninstall from the control panel. Help!
Hi Karen,.
I suggest you perform upgrade in-place from Windows XP. This operation reinstalls Windows XP to the same folder on your computer where it was originally installed.
However, before you perform the upgrade on Windows XP site, back up important data to another location as disc CD/DVD, USB etc.
For more information, see this link.
How to perform an upgrade on the spot (reinstallation) of Windows XP
Hope the helps of information.
Please post back and we do know. -
Hi, whenever I try to open a program, I get the prompt and a window asking to to choose me a program to open this file with, I recently added mcafee and now when I click on the icon and other icons on the desktop, it invites this window, could he be bound, what can I do? Help!
Hello
Try the system restore before it happened.
How to make a Vista system restore
http://www.Vistax64.com/tutorials/76905-System-Restore-how.html
Its control panel - backup and restore center - left upper repair WindowsSO which opens also to use the below to execute.
Start - type in the search box-> rstrui.exe CONTROL the top - top - right click RUN AS ADMIN
or use start - computer or Windows Explorer to navigate to
C:\Windows\System32\rstrui.exe
=====================================
To run a particular program until get them you all back to the normal fair use start - search and type in the
program name or the name of the executable file - OR use start - computer or Windows Explorer to access to the
program, and run it from there.Define your main program associations, and then you can edit any type of file to the correct program.
How to set default Associations for a program under Vista
http://www.Vistax64.com/tutorials/83196-default-programs-program-default-associations.htmlHow to associate a file Extension with a program Type in Vistahttp://www.vistax64.com/tutorials/69758-default-programs.html
How to view and change an Extension of filename on Vista
http://www.Vistax64.com/tutorials/103171-file-name-extension.htmlHow Unassociate a Type of Extension file in Vista and a utility to help
http://www.Vistax64.com/tutorials/91920-unassociate-file-extention-type.htmlRestore the Type Associations by default Vista file extensions
http://www.Vistax64.com/tutorials/233243-default-file-type-associations-restore.html
I hope this helps.
Rob - bicycle - Mark Twain said it is good. -
YOU WANT TO ERASE ALL DATA FROM THE LAPTOP?
I WANT TO RESTORE/SYSTEM RECOVERY, I WANT THAT ALL FACTORY SETTINGS. COMPUTER IS RUNNING SO SLOW AND 6 GB TO 80 GB LEFT NOTHING IMPORTANT ABOUT LAPTOP? ANYTIPS OR HELP? I ALSO HAVE A FULL VERSION OF WINDOWS VISTA, I WANT TO INSTALL. CURRENTLY, MY COMPUTER HAS WINDOWS VISTA BASED AMD 64 ATHLON X 2?
Hello
How to reinstall Vista
an easy to follow the answer for you:
follow these steps
And make sure you only set the CD/DVD drive to be 1st in the boot order to boot from the drive that you have just made
to boot from the dvd drive to be able to you will see a way to get into the bios Setup at the bottom of the screen or command menu start
It would be F2 or delete etc to enter the BIOS or F12 etc. for the start menu
Change boot order it do dvd drive 1st in the boot order
http://helpdeskgeek.com/how-to/change-boot-order-XP-Vista/
How to clean install Vista
http://www.theeldergeek.com/Vista/vista_clean_installation.html
-
Flash player you want to store the data on the local computer
Hi all
I have my 600kb swf size. I get this message from local storage when the client machine running.
I don't want to show this message. Because of the large size?
The message is attached. If I deny I get error RAS.
Please help me.
Thank you
-CK
Somewhere, you should use sharedobject so only this message come.
Try fusion frame application.
To reduce the swf file if you integrate assets or fonts load stuff dynamically.
Maybe you are looking for
-
Set a value in each separate digital output in qnx
Hello, I have two examples of the Eseries for outputs digital and they seem to work but when I change the value I want to put in the output of dig 1 it does not change. More accurately, I changed the digex1 of the example in this way: Write 0x00 to 0
-
Current problems with windows xp and Internet Explorer e-mail. You want advice
Problem started when in Internet explorer, I could not send emails. Program would close downm advised by the technical support of Microsoft Windows than windows xp or explore 8 had bad files and needed to do a clean install. Cannot locate the disc fo
-
ontouchstart, ontouchmove, ontouchend in Simulator
Hi all I'm trying to capture touch events correctly in the Simulator and horribly lacking at home. Consider this test code: testdiv = document.getElementById('mydiv'); testdiv.ontouchstart = function(e) { document.getElementById('mydiv').innerHTML =
-
Hi, I have an application with some pages. I add the code to create the tables in one of the pages and I do all the "CREATE TABLE...". "but when I change to another page, I think I lost all data, isn't? How can I save and load the database I created
-
Photoshop does not open jpeg files
I'm working on a Mac OS 10.8.5 and run Photoshop CC 2104. For these days so I'm opening a JPEG in photoshop, that it continues to throw up "could not complete your request because the file was not found." No matter where I try to open the file from o