OracleDataTable -> Constrained to be unique error.
OracleDataTable -> Constrained to be unique error.
I recieve this error:
Column 'TESTFIELD' is constrained to be unique error. Value '' is already present.
but value is NULL, not ''.
I use OracleDataTable. OraDirect.Net v 4.6, Oracle 10.2.01, VS 2005
Column constraint defined in oracle :
alter table TESTTABLE
add constraint UQ_TEST unique (TESTFIELD);
Best Regards.
Zeki Güven.
Column 'TESTFIELD' is constrained to be unique error. Value '' is already present.
but value is NULL, not ''.
I use OracleDataTable. OraDirect.Net v 4.6, Oracle 10.2.01, VS 2005
Column constraint defined in oracle :
alter table TESTTABLE
add constraint UQ_TEST unique (TESTFIELD);
Best Regards.
Zeki Güven.
-
- Posts: 729
- Joined: Thu 13 Dec 2007 10:24
-
- Posts: 729
- Joined: Thu 13 Dec 2007 10:24
Please send me (alexeyman*crlab*com) a small test project to reproduce the problem.
It is desirable to use 'test' schema objects, otherwise include the
definition of your own database objects.
Do not use third party components.
If it is impossible for you to create the test project, send us a piece of
your code where the error occurs.
It is desirable to use 'test' schema objects, otherwise include the
definition of your own database objects.
Do not use third party components.
If it is impossible for you to create the test project, send us a piece of
your code where the error occurs.
I send to you sample test project, sql code is below.
Code: Select all
create table TESTTABLE
(
ID NUMBER not null,
TEST1 VARCHAR2(10),
TEST2 VARCHAR2(10),
TESTFIELD VARCHAR2(25)
);
alter table TESTTABLE
add constraint PK_TESTTABLE primary key (ID);
alter table TESTTABLE
add constraint UQ_TEST unique (TESTFIELD);
delete from TESTTABLE;
commit;
insert into TESTTABLE (ID, TEST1, TEST2, TESTFIELD)
values (1, 'test', 'wqe', '1');
insert into TESTTABLE (ID, TEST1, TEST2, TESTFIELD)
values (2, 'wqwqw', 'qwe', null);
insert into TESTTABLE (ID, TEST1, TEST2, TESTFIELD)
values (3, 'wqe', 'wq', '2');
insert into TESTTABLE (ID, TEST1, TEST2, TESTFIELD)
values (4, 'qwe', 'qw', null);
insert into TESTTABLE (ID, TEST1, TEST2, TESTFIELD)
values (5, 'wqe', 'we', '3');
insert into TESTTABLE (ID, TEST1, TEST2, TESTFIELD)
values (6, 'wqe', 'qw', null);
insert into TESTTABLE (ID, TEST1, TEST2, TESTFIELD)
values (7, 'wqe', 'eqw', '4');
insert into TESTTABLE (ID, TEST1, TEST2, TESTFIELD)
values (8, 'qwe', 'wq', null);
commit;
-
- Posts: 729
- Joined: Thu 13 Dec 2007 10:24
I want to solve this problem. any way to disable this constraint.Alexey.mdr wrote:OraDirect .NET follows standard ADO.NET architecture and raises such exception.
Standard Microsoft data provider for Oracle also raises an same exception.
You should either insert unique data or not enforce a constraint.
Oracle running without exception, but driver not running
-
- Posts: 729
- Joined: Thu 13 Dec 2007 10:24
-
- Posts: 729
- Joined: Thu 13 Dec 2007 10:24