so I just added a new column to a table and now i want to populate that column in the pre-existing rows. This my current query, but it keeps erroring, because its trying to insert into the first column of the table.
insert into Product_Database(UPC)
select u.UPC
from upc_temp u
join upc_temp_gers g on u.PartNumber = g.PartNumber
join Product_Database p on p.ITM_CD = g.ItemCode
where u.UPC is not null
and this is the error its returning
Cannot insert the value NULL into column 'ITM_CD'
Clearly i am not trying to insert into the 'ITM_CD' column. Just 'UPC'.
Any help would be greatly appreciated. Thanks!
Product_Database? I'm certain there is anot nullconstraint on the columnITM_CDand you are not providing any value forITM_CD. Hence the row would haveNULLas a value forITM_CD, which the constraint prevents.