Home » SQL & PL/SQL » SQL & PL/SQL » Catch new update , new insert into a table and write to a file!
Catch new update , new insert into a table and write to a file! [message #327112] Fri, 13 June 2008 22:52 Go to next message
dinhchung82
Messages: 3
Registered: June 2008
Junior Member
i have a table , whenever this table is inserted or updated , i must write this new row to a file .
Would anybody recommend suggesstion for me ?
i need code example for reference.
Thanks so much !
Re: Catch new update , new insert into a table and write to a file! [message #327114 is a reply to message #327112] Fri, 13 June 2008 23:01 Go to previous messageGo to next message
BlackSwan
Messages: 26766
Registered: January 2009
Location: SoCal
Senior Member
>Would anybody recommend suggestion for me ?
http://www.orafaq.com/forum/t/88153/0/
I suggest you read & follow Posting Guidelines as stated in URL above.

Search this forum for "trigger".
You find many examples if you really look for yourself.
Re: Catch new update , new insert into a table and write to a file! [message #327120 is a reply to message #327112] Sat, 14 June 2008 00:40 Go to previous messageGo to next message
Michel Cadot
Messages: 68737
Registered: March 2007
Location: Saint-Maur, France, https...
Senior Member
Account Moderator
And what should happen if you roll back the DML statement?

Regards
Michel
Re: Catch new update , new insert into a table and write to a file! [message #327144 is a reply to message #327114] Sat, 14 June 2008 04:30 Go to previous messageGo to next message
dinhchung82
Messages: 3
Registered: June 2008
Junior Member
Thanks for your quesiton!
Our database have online transactions so i think roll back doen't happen.

Re: Catch new update , new insert into a table and write to a file! [message #327146 is a reply to message #327112] Sat, 14 June 2008 04:39 Go to previous messageGo to next message
dinhchung82
Messages: 3
Registered: June 2008
Junior Member
i solve my problem by a trigger and UTL_file package to write a file.
When trigger know update or insert to this table , UTL_file is write to file that contains latest transaction .
But i don't know how to query the only latest transaction when trigger run.
Help me please !
Re: Catch new update , new insert into a table and write to a file! [message #327150 is a reply to message #327146] Sat, 14 June 2008 06:08 Go to previous messageGo to next message
Dipali Vithalani
Messages: 278
Registered: March 2007
Location: India
Senior Member
Study Trigger's topic properly and you will find your answer urself.
Triggers (of insert/update event) are fired only for the records which are inserted/updated. So there will be no issue like "
latest transaction when trigger run
"

regards...
Re: Catch new update , new insert into a table and write to a file! [message #327188 is a reply to message #327144] Sat, 14 June 2008 10:25 Go to previous messageGo to next message
Michel Cadot
Messages: 68737
Registered: March 2007
Location: Saint-Maur, France, https...
Senior Member
Account Moderator
dinhchung82 wrote on Sat, 14 June 2008 11:30
Thanks for your quesiton!
Our database have online transactions so i think roll back doen't happen.

Your customers never click on "cancel" button?
I really doubt about this.
You never have server failure?
I really doubt about this.

Regards
Michel

Re: Catch new update , new insert into a table and write to a file! [message #327190 is a reply to message #327144] Sat, 14 June 2008 10:30 Go to previous messageGo to next message
BlackSwan
Messages: 26766
Registered: January 2009
Location: SoCal
Senior Member
dinhchung82 wrote on Sat, 14 June 2008 02:30
Thanks for your quesiton!
Our database have online transactions so i think roll back doen't happen.




Does any user ever get disconnected "accidentally" or have the PC hang & are forced to reboot in the middle of working against DB?

How do you KNOW with 100% certainty rollback don't happen?
Re: Catch new update , new insert into a table and write to a file! [message #327192 is a reply to message #327190] Sat, 14 June 2008 10:38 Go to previous message
Michel Cadot
Messages: 68737
Registered: March 2007
Location: Saint-Maur, France, https...
Senior Member
Account Moderator
One more: you do not have network failure?

Regards
Michel

[Updated on: Sat, 14 June 2008 10:39]

Report message to a moderator

Previous Topic: Reading the current time zone
Next Topic: Fast refresh won't empty the mlog table.
Goto Forum:
  


Current Time: Tue Feb 18 12:33:22 CST 2025