Next Question

Mahalo is adding a tip to all questions that don't offer a tip.
M¢25 Funded By Mahalo ? |
August 09, 2009 05:42 AM
RSS
Yes ,You can Commit inside the trigger.
But for this you have to make this trigger transaction to be a Independent transaction from its parent transaction, You can do this by using Pragma. Pragma AUTONOMOUS_TRANSACTION allow you to build the Indepadent(child) Transaction,started by another. Shold be declare in DECLARE section of any subprogram.
Used to make Modular and Resuable Blocks
CREATE OR REPLACE TRIGGER t_trigger
AFTER INSERT ON t1 FOR EACH ROW
DECLARE
PRAGMA AUTONOMOUS_TRANSACTION;
i PLS_INTEGER;
BEGIN
SELECT COUNT(*)
INTO i
FROM t1;
INSERT INTO t2
VALUES
(i);
COMMIT;
END;
Permalink | Report
mysterygir...
Answered Question

Mahalo is adding a tip to all questions that don't offer a tip.
How to add commit inside of trigeer?
Dear friend i want to know how to use commit inside of trigger in oracle 9i??
Interesting Question?
Yes (0)
No (0)
- In Programming Design & Development |
- Tags: and, web, design, development, software |
- |
- Report |
-
Share
RSS
Best Answer Decided by Votes
| September 10, 2009 01:40 PM |
But for this you have to make this trigger transaction to be a Independent transaction from its parent transaction, You can do this by using Pragma. Pragma AUTONOMOUS_TRANSACTION allow you to build the Indepadent(child) Transaction,started by another. Shold be declare in DECLARE section of any subprogram.
Used to make Modular and Resuable Blocks
CREATE OR REPLACE TRIGGER t_trigger
AFTER INSERT ON t1 FOR EACH ROW
DECLARE
PRAGMA AUTONOMOUS_TRANSACTION;
i PLS_INTEGER;
BEGIN
SELECT COUNT(*)
INTO i
FROM t1;
INSERT INTO t2
VALUES
(i);
COMMIT;
END;
Permalink | Report
mysterygir...
September 11, 2009 05:43 AM
Thanks for the information! Keep up the great work!
Tip mysterygirl89 for this comment
Report
Answer this Question
Related Questions
Ask a Question
Buy Mahalo Dollars with Credit Card or PayPal
Top Members
Most Popular Tags
Categories
- Anonymous
- Arts & Design
- Beauty & Style
- Books & Authors
- Business
- Cars & Transportation
- Consumer Electronics
- Coupons Deals
- Education
- Entertainment
- Environment
- Fitness
- Food & Drink
- From Email
- From Iphone
- From Twitter
- Health
- History
- Hobbies
- Home & Garden
- How Tos
- Humor
- Jobs
- Legal
- Local
- Love & Relationships
- Mahalo Answers Community
- Money
- Music
- News
- NSFW
- Parenting
- Pets
- Science & Mathematics
- Services
- Shopping
- Social Science
- Society & Culture
- Sports
- Technology & Internet
- Travel
- Video Games
Welcome New Members
- sockit, November 26, 2009 03:55 AM
- adam_miami, November 26, 2009 03:17 AM
- chazm3, November 26, 2009 02:51 AM
- zackttrout, November 26, 2009 02:48 AM
- lordtimmy2009, November 26, 2009 02:39 AM
Mahalo Dollars are the currency of Mahalo Answers.
Each Mahalo Dollar costs $1.
Once you earn more than 40 Mahalo Dollars, you can request to be paid via PayPal. Each Mahalo Dollar is currently worth $0.75 when paid out via PayPal. Learn More