Really struggling with SQL

B

Brian C

I'm struggling with SQL to do the following:

I create a record in a BOOKING table. The BOOKING table is
keyed on Booking id which is an AUTONUMBER.

I then want to run a query against an AVAILABILITY table
keyed on three fields (slot, period, room) which also
returns another field called booking id. I then want to
write the Booking Id from the BOOKING table in this field.
BOOKING and AVAILABILITY have a 1 to many relationship
based upon this field.

What does the SQL look like to do this? and where do I put
it?

Finally is there a way of getting a record for update and
holding on to it until I have completed updating it and
any related tables? How do I release it if I decide not to
update it?

Thanks in advance for your help
 
Top