Quote:
Originally posted by Hings
I forgot to mention that you can also include exception handler in your code.
|
hi,
i will explain about my table
we are designing table for hotel reservation:
i have a table --->
reservation containing following attributes:
reservationid,hotelphone,startdate,nights,guestpho ne,creditcard_num,
checkindate,checkoutdate,cancellationdate,roomnumb er
charges table containing following attributes
chargesdate,category(like FINE OR ROOM CHARGES),charge_amount,
reservation_id
so i told earlier....i have triggering if person cancel ...before startdate
time ie 48 hrs before he has to cancel...otherwise ..we have to charge...
that is y ...i am selecting reservationid from reservation table...where i am finding out ...(i am finding out whether people have cancelled before 48 hrs or not....
for this only i have used this function....
(floor ((startdatetime-cancellationdatetime )*24) -
(floor(startdatetime-cancellationdatetime)*24)) < 48;
using that reservationid ..i am going to insert values into charge table.....
chargedate,category,amount,reservationid..
i have already got a idea about the trigger..but i have given u all details about my table..could give me idea how to do that...
wat is NEW and OLD..when they will be used...
thanxx...pls give me a clear idea....