i have had this issue before and the only way i could come up with it is
insert into the peopletable and then query it with the same info you just
inserted, thus giving you the id of that person....then insert into the
appointment table....
it's a pain, but i haven't found an easier solution
jason
>From: Aimee Abbott <[EMAIL PROTECTED]>
>Reply-To: [EMAIL PROTECTED]
>To: CF-Talk <[EMAIL PROTECTED]>
>Subject: insert to two tables
>Date: Thu, 05 Apr 2001 14:08:41 -0600
>
>Hello everyone.
>
>I have mostly worked on very simple, single table, cold fusion projects but
>now I need to do something where I need to add information into two
>tables. I have something like this:
>
>PeopleTable
>personID Autonumber
>name Text
>address Text
>
>AppointmentTable
>aptID Autonumber
>PersonID Number
>AptName Text
>AptDate Date/Time
>
>The information for both tables come from one entry form on a web page. I
>have a second page to do the insert. When I insert the person into the
>person table, how do I find out what the personID was so I can enter it
>into the AppointmentTable/PersonID? Or can I do some sort of more complex
>insert statement that inserts into both tables at once? What if I add a
>third table? Does it get more complex? Should I setup the join as a
>relationship in microsoft access?
>
>
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at
http://www.fusionauthority.com/bkinfo.cfm
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists