Subject | Re: [IBO] Still little problems |
---|---|
Author | Salvatore Besso |
Post date | 2003-03-13T22:16:19Z |
hello Lester,
thank you for your kind reply.
database (regarding the table involved in my message):
[snip]
CREATE DOMAIN INT_ID
AS INTEGER
NOT NULL
CHECK(VALUE > 0);
CREATE DOMAIN CH_EVENT_DESC
AS VARCHAR(50)
NOT NULL
COLLATE BETA_ISO8859_1_NOCASE;
CREATE DOMAIN DATE_EXPIRY_DATE
AS DATE
NOT NULL;
CREATE DOMAIN INT_EVENT_ALERT_DAYS
AS SMALLINT
DEFAULT 1
NOT NULL
CHECK(VALUE > 0);
CREATE DOMAIN LOGICAL
AS SMALLINT
DEFAULT 0 /* False */
NOT NULL
CHECK(VALUE IN(0, 1));
[snip]
CREATE TABLE Events(
ID_Event INT_ID,
Description CH_EVENT_DESC,
Expiry_Date DATE_EXPIRY_DATE,
Alert_Days_Before INT_EVENT_ALERT_DAYS,
Alert_Days_After INT_EVENT_ALERT_DAYS,
Event_Enabled LOGICAL);
[snip]
If I leave, for example, the field Description = NULL (it has no
default value) with CheckRequired := False, I get no error and the
NULL field is successfully posted to the database. Instead, if
CheckRequired := True, I get an IBO error message. In either case the
OnError handler of TIB_Query is *never* fired.
I forgot to mention that I'm using Firebird 1.0.2.908
REQUIRED check boxes for *all* fields in the TIB_Query are grayed, so
I suppose that IBO should by-pass this test and let the database
return an error in this case.
Regards
Salvatore
thank you for your kind reply.
> Do you have all of the fields in the table configured asYes. Here is an extract taken from the script that I use to create my
> 'NOT NULL'? That is - has the table been created with NOT
> NULL fields.
database (regarding the table involved in my message):
[snip]
CREATE DOMAIN INT_ID
AS INTEGER
NOT NULL
CHECK(VALUE > 0);
CREATE DOMAIN CH_EVENT_DESC
AS VARCHAR(50)
NOT NULL
COLLATE BETA_ISO8859_1_NOCASE;
CREATE DOMAIN DATE_EXPIRY_DATE
AS DATE
NOT NULL;
CREATE DOMAIN INT_EVENT_ALERT_DAYS
AS SMALLINT
DEFAULT 1
NOT NULL
CHECK(VALUE > 0);
CREATE DOMAIN LOGICAL
AS SMALLINT
DEFAULT 0 /* False */
NOT NULL
CHECK(VALUE IN(0, 1));
[snip]
CREATE TABLE Events(
ID_Event INT_ID,
Description CH_EVENT_DESC,
Expiry_Date DATE_EXPIRY_DATE,
Alert_Days_Before INT_EVENT_ALERT_DAYS,
Alert_Days_After INT_EVENT_ALERT_DAYS,
Event_Enabled LOGICAL);
[snip]
If I leave, for example, the field Description = NULL (it has no
default value) with CheckRequired := False, I get no error and the
NULL field is successfully posted to the database. Instead, if
CheckRequired := True, I get an IBO error message. In either case the
OnError handler of TIB_Query is *never* fired.
I forgot to mention that I'm using Firebird 1.0.2.908
> just adding the NOT NULL in the query is not theBut I have *not* added the NOT NULL in the query. I have said that the
> correct way of doing it
REQUIRED check boxes for *all* fields in the TIB_Query are grayed, so
I suppose that IBO should by-pass this test and let the database
return an error in this case.
Regards
Salvatore