Skip to Main Content

SQL Developer

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!

import from excel into existing table with primary key constraint

2904875Mar 16 2015 — edited Mar 16 2015

Simple example that will illustrate the issue I'm having:

I have a table called USERS in my database. USERS has two columns: user_id and username

user_id is the primary key and is thus unique and not nullable. When doing inserts manually, I use sequence.next_val to create the next primary key. USERS already has data.

My problem:

I have an excel spreadsheet with new usernames. The spreadsheet does not have user_id associated with each of the usernames, and even if it did, it wouldn't matter as the user_id in the preexisting table would take precedence.

I am trying to import this data into the existing table using the Data Import Wizard. However, I receive error ORA-01400: cannot insert NULL into ("OWNER"."USERS'."USER_ID").

What is the best work around for this?

This is not a one time thing. This process will need to be automated or simple enough for business users to be able to complete in relatively few steps.

Thanks in advance.

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 13 2015
Added on Mar 16 2015
1 comment
1,044 views