Home » Other » Training & Certification » Doubts in trigger (merged by LF and MC)
Doubts in trigger (merged by LF and MC) [message #266255] Mon, 10 September 2007 05:37 Go to next message
oracleram
Messages: 23
Registered: November 2006
Junior Member
hi every1,

i have 2 tables say A and B

A table contains

id amt

1 1000

2 2000
3 3000
32 5000
there is a need to write a trigger to update the values of B tables While inserting values in B table


the output will be B table contains

name id1 amount1 id2 amount2 id3 amount3 id4 amount4
x 1 1000 2 2000 3 3000 32 5000


thanx in advance

[Updated on: Mon, 10 September 2007 06:33] by Moderator

Report message to a moderator

doubts in trigger [message #266258 is a reply to message #266255] Mon, 10 September 2007 05:54 Go to previous messageGo to next message
oracleram
Messages: 23
Registered: November 2006
Junior Member
hi every1,

is it possible to use cursors inside the trigger,Thanx in advance
Re: doubts in trigger [message #266261 is a reply to message #266258] Mon, 10 September 2007 05:56 Go to previous messageGo to next message
pablolee
Messages: 2834
Registered: May 2007
Location: Scotland
Senior Member
Have you tried?
Re: doubts in trigger [message #266263 is a reply to message #266258] Mon, 10 September 2007 06:00 Go to previous messageGo to next message
Michel Cadot
Messages: 64122
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Yes, but if you need it then you have a bad application implementation.

Regards
Michel
doubts in trigger [message #266266 is a reply to message #266255] Mon, 10 September 2007 06:07 Go to previous messageGo to next message
oracleram
Messages: 23
Registered: November 2006
Junior Member
i have 2 tables say A and B

A table contains

name id amt

x 1 1000

x 2 2000
x 3 3000

y 32 5000

x 10 600
there is a need to write a trigger to update the values of B tables While inserting values in A table


the output will be B table contains

name id1 amount1 id2 amount2 id3 amount3 id4 amount4
x 1 1000 2 2000 3 3000 10 600
y 32 5000

thanx in advance
Re: doubts in trigger [message #266267 is a reply to message #266255] Mon, 10 September 2007 06:08 Go to previous messageGo to next message
Michel Cadot
Messages: 64122
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Please read and follow OraFAQ Forum Guide, especially "How to format your post?" section.
Make sure that lines of code do not exceed 80 characters when you format. Use the "Preview Message" button.
Please always post your Oracle version (4 decimals).

Please give a description of B (an ouput is NOT a description).
Please explain how you want to fill B with A values during insert.

If it would be a real case, I'd say change your implementation, it is bad.
As this is a homework, I say: post what you already tried.

Regards
Michel
Re: doubts in trigger [message #266270 is a reply to message #266266] Mon, 10 September 2007 06:11 Go to previous messageGo to next message
Michel Cadot
Messages: 64122
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Don't multipost.

Regards
Michel
Re: doubts in trigger [message #266284 is a reply to message #266267] Mon, 10 September 2007 06:31 Go to previous messageGo to next message
oracleram
Messages: 23
Registered: November 2006
Junior Member
A table description

name varchar2(10);
id number;
amount number;
month number;
year number;


B table description

name varchar2(10);
id number;
amount number;

our objective is to insert the values of table A into table B

i have 2 tables say A and B

A table contains

name id amt month year

x 1 1000

x 2 2000
x 3 3000

y 32 5000

x 10 600
there is a need to write a trigger to update the values of B tables While inserting values in A table


the output will be B table contains

name id1 amount1 id2 amount2 id3 amount3 id4 amount4
x 1 1000 2 2000 3 3000 10 600
y 32 5000

thanx in advance
Re: doubts in trigger [message #266285 is a reply to message #266255] Mon, 10 September 2007 06:31 Go to previous messageGo to next message
Michel Cadot
Messages: 64122
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
You already post this twice (sorry three times).
Go on on the previous topics don't start new one.

Regards
Michel

[Updated on: Mon, 10 September 2007 06:34]

Report message to a moderator

Re: Doubts in trigger (merged by LF and MC) [message #266435 is a reply to message #266255] Mon, 10 September 2007 22:08 Go to previous message
Arju
Messages: 1554
Registered: June 2007
Location: Dhaka,Bangladesh. Mobile:...
Senior Member

This is too easy if you read about triggers. Read it.
Previous Topic: Where it stored
Next Topic: Sum function belongs to which package
Goto Forum:
  


Current Time: Wed Dec 07 04:40:30 CST 2016

Total time taken to generate the page: 0.22726 seconds