468,107 Members | 1,412 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,107 developers. It's quick & easy.

Update Query Overwrite?

I'm trying to get an Update Query to overwrite any records that already
exist. By default it appears to skip any records in which the key already
exists. Is there any way to change this?
Nov 12 '05 #1
3 2507
Forgot to mention... I'm using the DAO.Execute method...

I'm trying to get an Update Query to overwrite any records that already
exist. By default it appears to skip any records in which the key already
exists. Is there any way to change this?

Nov 12 '05 #2
Brandon M,
Not enough info in your post to say. Generally, a statement like "UPDATE
FOO_TBL SET COLUMN_1='SomeText';" is a bad idea because every row in FOO_TBL
will show the value 'SomeText' in COLUMN_1. Usually a WHERE clause is used
to limit the update to the intended rows. By implication it seems that your
statement does limit the effected rows with a WHERE clause but your e-mail
doesn't clearly define what you mean by "in which the key already exists."
One interpretation is a WHERE clause that reads something like, "WHERE
KEY_COLUMN IS NULL;" which would have the effect you write about. If that
is the case, either remove the WHERE clause altogether so every row is
changed or figure out what it should be so you only change the intended
rows.

"Brandon M" <aw*****@telus.net> wrote in message
news:uX8_b.50124$Hy3.21537@edtnps89...
I'm trying to get an Update Query to overwrite any records that already
exist. By default it appears to skip any records in which the key already
exists. Is there any way to change this?

Nov 12 '05 #3
I'm sorry... I meant an append query... too much in my head right now!!

"Alan Webb" <kn*****@hotmail.com> wrote in message
news:hj*****************@news.uswest.net...
Brandon M,
Not enough info in your post to say. Generally, a statement like "UPDATE
FOO_TBL SET COLUMN_1='SomeText';" is a bad idea because every row in FOO_TBL will show the value 'SomeText' in COLUMN_1. Usually a WHERE clause is used to limit the update to the intended rows. By implication it seems that your statement does limit the effected rows with a WHERE clause but your e-mail
doesn't clearly define what you mean by "in which the key already exists."
One interpretation is a WHERE clause that reads something like, "WHERE
KEY_COLUMN IS NULL;" which would have the effect you write about. If that
is the case, either remove the WHERE clause altogether so every row is
changed or figure out what it should be so you only change the intended
rows.

"Brandon M" <aw*****@telus.net> wrote in message
news:uX8_b.50124$Hy3.21537@edtnps89...
I'm trying to get an Update Query to overwrite any records that already
exist. By default it appears to skip any records in which the key already exists. Is there any way to change this?


Nov 12 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by Mason | last post: by
reply views Thread by Stephen Brown | last post: by
2 posts views Thread by =?Utf-8?B?U2hlbGRvbg==?= | last post: by
1 post views Thread by Solo | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.