Subject | Re: [IBO] Still little problems |
---|---|
Author | Salvatore Besso |
Post date | 2003-03-14T20:56:20Z |
hello Helen,
empty string is going through my SQL instead of a NULL.
the same as above.
handling it in any trigger. Here is its definition, along with the
table definition and the only trigger for that table:
CREATE DOMAIN CH_EVENT_DESC
AS VARCHAR(50)
NOT NULL
COLLATE BETA_ISO8859_1_NOCASE;
[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]
CREATE TRIGGER BI_EVENTS FOR Events
ACTIVE BEFORE INSERT POSITION 0
AS
BEGIN
IF (NEW.ID_Event IS NULL) THEN
NEW.ID_Event = GEN_ID(GEN_ID_Event, 1);
END ^
[snip]
Cheers
Salvatore
> Are you watching an IB_MonitorDialog, to seeyes, I've done it. Even if I leave the DESCRIPTION field empty, an
> what values are going through in your SQL?
empty string is going through my SQL instead of a NULL.
> Have you touched the BLANKISNULL attribute at all?yes and no <g> With BLANKISNULL checked or not, the result is always
the same as above.
> Is there any possibility that you have DEFAULTNo, the DESCRIPTION field doesn't have any DEFAULT value and I'm not
> assigned for these columns (these work only on
> inserts), or that you are handling NULL via
> triggers?
handling it in any trigger. Here is its definition, along with the
table definition and the only trigger for that table:
CREATE DOMAIN CH_EVENT_DESC
AS VARCHAR(50)
NOT NULL
COLLATE BETA_ISO8859_1_NOCASE;
[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]
CREATE TRIGGER BI_EVENTS FOR Events
ACTIVE BEFORE INSERT POSITION 0
AS
BEGIN
IF (NEW.ID_Event IS NULL) THEN
NEW.ID_Event = GEN_ID(GEN_ID_Event, 1);
END ^
[snip]
> Yes, if NULL is not being handled by a triggeryes, this should be the case, but the OnError handler is never fired.
> or a DEFAULT, you should get an EIB_ISCError
> if Post fails. Post *should* fail if NULL is
> passed to a non-nullable column. The EIB_ISCError
> is transformed into a structure which you can
> read in the OnError event.
Cheers
Salvatore