Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Populate a column with data from a column in another table

Mencis JoeApr 20 2016 — edited Apr 20 2016

Hi. I am looking to populate PART_NUM column of warranty_info table. I want this column to be filled with the data of SUPPLIER_NUM column of item_list table. item_code is the common column between the two tables. I have tried the following query.

INSERT INTO warranty_info (PART_NUM)

SELECT (SUPPLIER_NUM)

FROMĀ  item_list,warranty_info

WHERE warranty_info.item_code=item_list.ITEM_CODE;

When I tried executing this query , I got the following error.

ORA-01400: cannot insert NULL into (WARRANTY_INFO.WARRANTY_ID). warranty_id is the primary key of the warranty_info table. I just want to populate the PART_NUM column of warranty_info table with the data in SUPPLIER_NUM column of item_list table. One more thing is, all the columns in warranty_info table has data except PART_NUM in which I am trying to populate data. What am I missing? Thanks.

This post has been answered by AlbertoFaenza on Apr 20 2016
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 18 2016
Added on Apr 20 2016
37 comments
4,929 views