Click to See Complete Forum and Search --> : need help for a simple query ...plspls


imti
04-18-2007, 08:44 AM
pls see the attachment

as u can see at room no 109 there is no customer
and its on first floor
in my db design , room and floor are fixed for the hotel
so what wud be the query to insert customer in room no 109
along with RentDate,LeavingDate,Contract


pls pls let me know asap
thx in advance
imti

joewmaki
04-18-2007, 11:33 AM
You need to update the existing record, something like

UPDATE ROOM
SET CUSID = 12,
RENTDATE = '04/20/2007',
LEAVINGDATE = '04/22/2007'
CONTRACT = 101
WHERE ROOMNO = 109
AND FLOOR = 1

Not sure what datatype you need to apply to CONTRACT, but you should get the idea. A stored procedure w/ parameters may be the best way to do this.