Home » Other » Training & Certification » update a column using existing column in the same table
update a column using existing column in the same table [message #301885] Fri, 22 February 2008 02:58 Go to next message
dr.s.raghunathan
Messages: 540
Registered: February 2008
Senior Member
dear sir/madam,

I have one table name as Check_in
where the following columns are available
id number
Room_no varchar2(3) foreign key refers room_mst(room_no)
Chk_in_dt varchar2(20)
chk_ou_dt varchar2(20)
Room_rent number(10,2)
Luxary_tax_rate number(10,2)
total_value number(10,2)

Table Nmae Room_mst
id number
room_no varchar2(3) indexed
rent_per_day number(10,2)

I was able to fetch rent_per_day from the room_mst and update the column in check_in(room_rent) using the trigger
(after insert or update or delete on each statement)

I was unable to create trigger to populate the total_value
with room_rent * (1 + luxary_tax_rate) for each row of insert or update or delte

Why triggers are not getting fired when handling the columns available in the same table?

What sort of the mistake i am doing?

thanks in advance and yours faithfully,

dr.s.raghunathan
Re: update a column using existing column in the same table [message #301886 is a reply to message #301885] Fri, 22 February 2008 03:00 Go to previous messageGo to next message
Michel Cadot
Messages: 68624
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Can you post what you already tried.

Please use code tags to post your code as explained in OraFAQ Forum Guide.

Regards
Michel

[Updated on: Fri, 22 February 2008 03:01]

Report message to a moderator

Re: update a column using existing column in the same table [message #301887 is a reply to message #301885] Fri, 22 February 2008 03:01 Go to previous message
pablolee
Messages: 2882
Registered: May 2007
Location: Scotland
Senior Member
Show what you have tried. Format your code and put in [code]...[/code] tags.
Previous Topic: oracle apps
Next Topic: Free Oracle/SQL eBooks
Goto Forum:
  


Current Time: Thu Mar 28 05:05:10 CDT 2024