[thelist] Multiple updates - ASP
rudy
r937 at interlog.com
Thu Oct 31 10:34:01 CST 2002
> I want to be able to hit one submit button and have
> each record updated with the new stock level.
this is quite typical for a many-to-many relationship
the items, with their individual quantities, are in the table that
implements the many-to-many relationship between product and order -- it's
called an associative or intersection or junction or relationship table
when the form submits, one field in the form carries the order id, and
multiple fields, each set corresponding to an order item line, will include
product id and quantity
to process these sets of fields, you have to loop over an sql statement
that does an insert
... unless you're using mysql (a long shot, given that you're asking about
asp), because mysql supports this non-standard but highly appealing
syntax --
insert into orderitem
values ('O12', 'P24', 1)
, ('O12', 'P27', 1)
, ('O12', 'P29', 3)
, ('O12', 'P31', 2)
i.e. only one call to the database engine
rudy
More information about the thelist
mailing list