[thelist] Multiple updates - ASP

Matt MacLeod mattmacleod12 at yahoo.co.uk
Thu Oct 31 11:06:01 CST 2002


Got it in the end. Really messy - as I looped through the records in the
order I built an update command for each record in the loop. Not great but
it does work, and that's all I'm fussed about just now. Thanks to everyone.


At 11:32 31/10/02 -0500, you wrote:
> > 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
>
>
>
>--
>For unsubscribe and other options, including
>the Tip Harvester and archive of thelist go to:
>http://lists.evolt.org Workers of the Web, evolt !




More information about the thelist mailing list