Home » SQL & PL/SQL » SQL & PL/SQL » Constraint
Constraint [message #2934] Thu, 22 August 2002 16:08 Go to next message
NiGg3r
Messages: 1
Registered: August 2002
Junior Member
HiĦĦ
I have the following trouble:

I have a table created as follows :

CREATE TABLE schema.table (
column1 VARCHAR2(3) CONSTRAINT NN_column1 NOT NULL,
column2 VARCHAR2(8) CONSTRAINT PK_column2 primary key,
column3 VARCHAR2 (8))
TABLESPACE Tablespace_name;

The purpose of the table is to store comercial documents that can be A,B,C......K in the column1

At the column 2 , stores the number of this comercial
documents they are correlatives beginnig in 0 , and in the reality they can be : A001 , b001 , c001)
,tryng to represent the data it will be something like this:

column1 column2 column3
A 001 abcde
B 001 xxxxx
f 001 xxxxz

my problem appears when im tryng to upload data via sqlloader or inserting it using an aplication compiled with delphi
from a existing table. cause i need that the column2 be a PK , but how the data in that column have sometimes equal values
(but it isn't the same comercial document), oracle dont let me upload the data.
what can i do?

Sorry for my spanglish
and thanks in advanced

Leo
Re: Constraint [message #2938 is a reply to message #2934] Fri, 23 August 2002 09:23 Go to previous message
lkrylov
Messages: 3
Registered: August 2002
Junior Member
Leo,

1.If this is a lookup table of commercial docs then you should do a distinct on the SQL statement that creates the values for the load.
2.If you need to load it all and there are duplicates perhaps you need to make the key a combination of Column 1 and Column 2?
Previous Topic: Get All Instances of Oracle on a Machine
Next Topic: Tracking changes to rows in Oracle 9i
Goto Forum:
  


Current Time: Fri Mar 29 07:24:11 CDT 2024