The second option sounds good, but I would only insert values where the table fields 
are 'NOT NULL'. ie. Key, Userid, etc.

Gareth.

-----Original Message-----
From: Ricardo Russon [mailto:[EMAIL PROTECTED]
Sent: Friday, 2 April 2004 9:11 AM
To: CFAussie Mailing List
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

Reply via email to