E
EMW
When I create a table in the database with:
cmd.CommandText = "CREATE TABLE pmdb.wolist (SITENUM NVARCHAR2(5) NOT NULL,
VELD1 NVARCHAR2(100), " + _
"VELD2 NVARCHAR2(100), VELD3 NVARCHAR2(100), VELD4 NVARCHAR2(100), " + _
"VELD5 NVARCHAR2(100), VELD6 NVARCHAR2(100), VELD7 NVARCHAR2(100), " + _
"VELD8 NVARCHAR2(100), PRIMARY KEY(sitenum)) TABLESPACE PM"
This is part of a report and VELD1 in combination of SITENUM is a unique
combination.
Since VELD1 is the date the report is created on and SITENUM is just a
number, I planned to add more reports with the same number but a different
date to the database.
Here comes my problem.
I cannot add more rows to the database, I get an error about violating the
UNIQUE contraint.
But I never specified the UNIQUE contraint, so it should accept multiple
times of SITENUM, but just with another date in VELD1.
If I leave the PRIMARY KEY part out, the UPDATE command of the
OracleDataAdaptor errors with 'No primary key etc..'
So what should my commandtext then be like, in order to have several rows
with the same number in SITENUM and different dates in VELD1?
rg,
Eric
cmd.CommandText = "CREATE TABLE pmdb.wolist (SITENUM NVARCHAR2(5) NOT NULL,
VELD1 NVARCHAR2(100), " + _
"VELD2 NVARCHAR2(100), VELD3 NVARCHAR2(100), VELD4 NVARCHAR2(100), " + _
"VELD5 NVARCHAR2(100), VELD6 NVARCHAR2(100), VELD7 NVARCHAR2(100), " + _
"VELD8 NVARCHAR2(100), PRIMARY KEY(sitenum)) TABLESPACE PM"
This is part of a report and VELD1 in combination of SITENUM is a unique
combination.
Since VELD1 is the date the report is created on and SITENUM is just a
number, I planned to add more reports with the same number but a different
date to the database.
Here comes my problem.
I cannot add more rows to the database, I get an error about violating the
UNIQUE contraint.
But I never specified the UNIQUE contraint, so it should accept multiple
times of SITENUM, but just with another date in VELD1.
If I leave the PRIMARY KEY part out, the UPDATE command of the
OracleDataAdaptor errors with 'No primary key etc..'
So what should my commandtext then be like, in order to have several rows
with the same number in SITENUM and different dates in VELD1?
rg,
Eric