Hi Ricardo How are the new fields added ? How is a value assigned to an existing field ?
I am not 100% sure what your application is doing, but this sounds similar to a time sheet page I did as part of a job tracking system. If time had been entered for a job on a particular day, that textbox was submitted as time_#jobid#_#date#_#timesheetid#. If no time had ever been entered, the textbox was named time_#jobid#_#date#_0. ListLast(FORM_VAR_NAME, "_") = timesheetid = 0 or a a value. If 0, insert the record, else upate the record. HTH Aaron ----- Original Message ----- From: "Ricardo Russon" <[EMAIL PROTECTED]> Newsgroups: cfaussie To: "CFAussie Mailing List" <[EMAIL PROTECTED]> Sent: Friday, April 02, 2004 9:11 AM Subject: [cfaussie] Re: SQL Update / Insert > mmm.. its kinda hard to explain, but i'll try. > for translation purposes, field names are stored in one table, and values > are stored in another. they are referenced by an id. > > when a new field is added, there is no matching field ID in the values > table. > > so when i submit the form and loop through the fields to update the client, > there is no matching field to update, so nothing happens. > > so i have two choices... that i know of... check each field to see if it > exists and then update or insert accordingly. the other option is to loop > over the values table and instert default values for each client when i add > a new record into the fields table. > > i think i will take the second option. > > what do you think? > Ricardo. > > > "Gareth Edwards" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > > Is there another solution to this Ricardo? what is it you are trying to do? > we do this sort of thing often by making two trips.. sometimes you just have > to. But sometimes there is a work around. What app is giving you the > problem. > > Gareth. > > -----Original Message----- > From: Ricardo Russon [mailto:[EMAIL PROTECTED] > Sent: Thursday, 1 April 2004 3:16 PM > To: CFAussie Mailing List > Subject: [cfaussie] SQL Update / Insert > > > Hi guys. > > is there any way to updade a record to if it the key exists, if not insert > it, within the same SQL statment. i don't realy want to be making to trips > for this. > > I remember doing somthing like this a few years ago.. but that might ahve > been in (gulp) ASP. > > TIA > > Ricardo. > > > > --- > You are currently subscribed to cfaussie as: [EMAIL PROTECTED] > To unsubscribe send a blank email to [EMAIL PROTECTED] > > MXDU2004 + Macromedia DevCon AsiaPac + Sydney, Australia > http://www.mxdu.com/ + 24-25 February, 2004 > > > > > --- > You are currently subscribed to cfaussie as: [EMAIL PROTECTED] > To unsubscribe send a blank email to [EMAIL PROTECTED] > > MXDU2004 + Macromedia DevCon AsiaPac + Sydney, Australia > http://www.mxdu.com/ + 24-25 February, 2004 --- You are currently subscribed to cfaussie as: [EMAIL PROTECTED] To unsubscribe send a blank email to [EMAIL PROTECTED] MXDU2004 + Macromedia DevCon AsiaPac + Sydney, Australia http://www.mxdu.com/ + 24-25 February, 2004
