I currently have a table (reserved room) in my database, I have a number of columns. I have a room reserved ID, a date_for and date_to, and member id (foreign key) . Example;
'RR001'
to_date('21-11-2003 09:00','DD-MM-YYYY HH24:MI'),
to_date('21-11-2003 11:00','DD-MM-YYYY HH24:MI'),
1 .....
Ideally, I think what I need is a stored function that calculates the time the room has been booked for and then is multiplied by x amount of pounds/dollars (i.e. 11:00 -09:00 * 50). I think I am able to do that in a query, but I’m am not sure how I would do it if for example I wanted to enter the reserved ID, the calculation was performed and then displayed the reserved id, the member id, and the total amount.
Is it possible to do that?
'RR001'
to_date('21-11-2003 09:00','DD-MM-YYYY HH24:MI'),
to_date('21-11-2003 11:00','DD-MM-YYYY HH24:MI'),
1 .....
Ideally, I think what I need is a stored function that calculates the time the room has been booked for and then is multiplied by x amount of pounds/dollars (i.e. 11:00 -09:00 * 50). I think I am able to do that in a query, but I’m am not sure how I would do it if for example I wanted to enter the reserved ID, the calculation was performed and then displayed the reserved id, the member id, and the total amount.
Is it possible to do that?