Subject SQL - Default Value ?
Author pierre.yager@crisalid.9tel.com
Hi all,

Happy new year 2005 !

I would like to know if there is a special keyword to force a field to be
initialized to its default value in an insert command.

Like :

INSERT INTO MY_TABLE(ID, NAME, AN_INT_FIELD_WITH_DEFAULT_VALUE) VALUES (1,
'HAPPY NEW YEAR', DEFAULT)

I know that "DEFAULT" keyword don't exist (at least with FB 1.5.2)

I'm designing a "magik sql builder" objects (using delphi and UIB
components) that can handle multiple requests in a request cache in order to
import easily complex files in a Firebird database :

Var
MyMagikSQLBuilder : TMagikSQLBuilder;

...
Procedure ImportSomething(Something: Integer); Begin
With MyMagikSQLBuilder do
Begin
BuildSQLRequest(rqInsert,'SOME_TABLE');
AssignParams(['SOME_FIELD'],[Something]);
Execute;
End;
End;

TMagikSQLBuilder will handle a cache of prepared queries (once a query is
requested) and I will just pass necessary parameters. Others are left to
"DEFAULT" values. If no default values are set TMagikSQLBuilder will assign
NULL values.

But I have to find how to send a dynamic query to Firebird without assigning
values to parameters...

Can you help me ?

Thanks in advance, best regards,

Pierre Y.