View Full Version : CONDITIONAL INSERT STATEMENT ??? PLEASE HELP!!!!


morfeus
01-18-2002, 03:47 AM
Is it possible to implement a conditional insert statement?
I have the table
LEXICON (ID , DE_TEXT , EN_TEXT)
I would like to insert a (x, y, z) into this table
x= ID
y = DE_TEXT
z = EN_TEXT
with the condition that if x is Null then x = y (x takes the value of y)

PS: x is a NOT NULL Feld.

Thanxx for any contrib.


Eric

David R
01-18-2002, 07:04 AM
If this is a one-time action, you can do this with an Update query. Field X: Update To: [same source as Field Y] Criteria: [regular source for Field X] Is Null or IsNull[regular source for Field X]. You'll have to do this in two stages, I believe (first run the regular x,y,z source, then just the modified x source to fill in the blanks).

If this will be an ongoing process, it might help to know more about what you're trying to do. Storing the same 'piece' of data in two places is generally not good relational database design.

HTH,
David R