- 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.
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.