This is difficult to explain but I will try my best.  I have an Insert Query
which will be passed a list of values from a form.  This form is dynamically
generated from a previous query result set so by the time the form is
generated we know the number of records returned used for building the form.
Once the user has entered information in the form and submitted it  the
insert query has to behave like this: -

<cfquery name="qinssvceaddr" datasource="#request.DSN#" dbtype="odbc">
INSERT INTO #request.TBCR#TN0987
ADDR_ID_001,
       ADDR_ID_002,
       ADDR_ID_003,
       ADDR_ID_004,
       ADDR_ID_005,
       ADDR_ID_006,
       ADDR_ID_007,
       ADDR_ID_008 (this carries on up to 100)
VALUES
       #form.addressID# (once again we have 100 fields in the db and for
example in the case where there are 5 values passed to this query from the
form we have make the remaining 95 values be null and this will vary
dependant on the number of form values past.  So again if there are 20
form.addressID's passed we would have to dynamically set the remaining 80
values in the Insert to null.

Hope I explained this well, can anyone help?

Mike Brunt
Sempra Energy
213.244.5226

"A logician trying to explain logic to a programmer is like a cat trying to
explain to a fish what it's like to get wet." 


______________________________________________________________________
Signup for the Fusion Authority news alert and keep up with the latest news in 
ColdFusion and related topics. http://www.fusionauthority.com/signup.cfm
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to