Page 1 of 1

Ora VS Tools 2.55: Datagrid incorrectly complains about not-null constraints

Posted: Fri 11 Apr 2008 07:57
by Robert Giesecke
Easy to repro:

create a table with a not-null column, that can receive a value either by having a default or by a trigger:

Code: Select all

create table NotNullTest
(
  MyColumn Integer  default 1 not null
)
Now open the table data, and try to add 2 empty rows.
You will get an ORA-1400, which desn't make any sense.
Except when having a fixed column list for the insert statement, which would be wrong for this kind of application. ;-)

Posted: Mon 14 Apr 2008 07:38
by Duke
Well, it's not a bug. I'll try to explain this behavior.
Data editor has built-in DML statement generator for automatic data update. It generates INSERT statement that include only those columns which have actual values provided by user in data grid. But in case when you do not enter any value in any column before posting data to server it generates INSERT statement like this
INSERT INTO table1 (column1, column2) VALUES (null, null)

Table in your example has only one column and you did not enter the value so you got the error. DML generator does not pick up server-side default values on client side.

Though it may seem a bit strange the error is correct.

Posted: Mon 14 Apr 2008 09:59
by Robert Giesecke
Duke wrote:Though it may seem a bit strange the error is correct.
My mistake, the simplified testcase was a bit too simple, then.
I am sure, I had this problem with a half entered record.
Next time, I see it, I will make precise notes on how to repro it.

Cheers,
Robert