Subject Re: [IBO] default value in table field
Author Lucas Franzen
Adalberto,

if you have a Query on your client side that will have SQL like:

SELECT * FROM FINFILE

NFILE_UP will be part of the select statement.
Thus the client will also know, that this field is defined NOT NULL so
it will cause an error every time you're trying to post the record,
without having assigned a value to this field.

If you change your SQL to:
SELECT nfile, des60 FROM FINFILE

NFILE_UP will NOT be part of the SQL statement - so if you save the
record, the server will receive NULL for that field and WILL react the
way you expect it to.

As you stated in your example:

Insert into Finfile (nfile,des60) values ('Customers','Customer
Information')

does work.

It works since NFILE_UP is NOT part of the insert statement.

HTH
Luc.



baldiniadalb@... schrieb:
>
> Nando, Helen
>
> NFILE_UP is a secondary field I use only for some checks or for set
> order sequence.
> I am looking for a solution that allow me to don't worry with
> calculated fields into the application. So I thought to charge
> Database to do it for me.
>
> I constructed Before_Insert and Before_Update triggers :
> NEW.nfile_up := Upper(New.nfile) and following SQL instruction :
>
> Insert into Finfile (nfile,des60) values ('Customers','Customer
> Information') it works well !!
>
> Delphi, IBConsole, IB_WISQL ... require data for all not null fields.
> I put Default Value to cheat them , but it doesn't work.
> They don't use default value definitions.
>
> Second solution : I tried it but it doesn't work; IBO always use
> database definitions and test NFILE_UP as required.
>
> Finally : it seems I have to accept to fill these information into
> all applications that will post records.
>
> Thanks,
> Adalberto
>
>
>
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/