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

Discussion of open issues, suggestions and bugs regarding database management and development tools for Oracle
Post Reply
Robert Giesecke
Posts: 7
Joined: Thu 03 Apr 2008 10:24

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

Post by Robert Giesecke » Fri 11 Apr 2008 07:57

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. ;-)

Duke
Devart Team
Posts: 476
Joined: Fri 29 Oct 2004 09:25

Post by Duke » Mon 14 Apr 2008 07:38

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.

Robert Giesecke
Posts: 7
Joined: Thu 03 Apr 2008 10:24

Post by Robert Giesecke » Mon 14 Apr 2008 09:59

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

Post Reply