> All references to CFINSERT I've found in CFWACK and Danesh
> describe the inclusion of only one tablename. For forms that
> query relational tables, would you have to provide for two
> separate inserts within a CFTRANSACTION? I'm pretty sure this
> will work, but I'm wondering if I can utilize one of my Access
> queries as the "tablename" value and do the insert in one action.

Whether you use CFINSERT or a regular SQL INSERT statement within CFQUERY,
you can only update one table at a time. If you need to update multiple
tables, you'll need multiple inserts. Whether or not they need to be within
a CFTRANSACTION really depends on the specific circumstances. If they both
absolutely have to either succeed or fail together, then they belong within
a transaction.

> Also for the child table, where I might be inserting multiple
> rows, do I need to do the inserts within a loop? Please be
> patient if this seems elementary. I'm still somewhat of a newbie.

Yes, if you want to perform multiple inserts within a child table, you'll
probably end up looping over an insert into that table. There are
alternatives, but they require a decent amount of SQL within a stored
procedure.

Dave Watts, CTO, Fig Leaf Software
http://www.figleaf.com/
voice: (202) 797-5496
fax: (202) 797-5444

------------------------------------------------------------------------------
Archives: http://www.eGroups.com/list/cf-talk
To Unsubscribe visit 
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a 
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.

Reply via email to