Insert query

Joined
May 20, 2011
Messages
2
Reaction score
0
This may probably a very simple question to answer, but I am new to access and Databases..

I have a table that has the following fields
ID - Primary key
Productkey - text (indexed, no duplicate allowed)
Product description
Product number
Product manufacturing date

At the run time I just want to duplicate one row in my table but want to change the productkey so that the insert is possible. so in pseudocode terms

Insert into producttable values
Select * from producttable where Productkey = "ABC"
update Productkey ="XYZ"

is it possible through a single SQL statement or has to be divided into two. My problem is that if I use just the insert statement without update - it gives me an error - duplicate key on productkey.

Thank you.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top