Subject | Re: [firebird-support] Default value in DDL not work |
---|---|
Author | |
Post date | 2019-06-05T18:17:52Z |
Yes this happen when I omit the field the default value is not applied.
I do this insert part into a stored procedure with other SQL statement for other tables.
I do this insert part into a stored procedure with other SQL statement for other tables.
INTITULE_SALAIRE='N-'||F_GET_MONTH_NAME(:MOIS)||' '||:ANNEE;
INSERT INTO SALAIRES (EMPLOYEUR_ID, EMPLOYE_ID, UNITE_ID, MOIS, ANNEE,FROM_DATE,TO_DATE,INTITULE_SALAIRE,TRIMESTRE,TYPE_SALAIRE,TYPE_DECLARATION) VALUES (:EMPLOYEUR_ID, :EMPLOYE_ID, :UNITE_ID, :MOIS, :ANNEE,:PAIE_FROM,:PAIE_TO,:INTITULE_SALAIRE,F_GET_TRIMESTRE(:PAIE_FROM),'N','N') RETURNING ROWID INTO :SALAIRE_ID;
This table has many fields so I post some of them in defined in DDL with default values like this I can post the entire DDL if needed:
This table has many fields so I post some of them in defined in DDL with default values like this I can post the entire DDL if needed:
CREATE TABLE SALAIRES (
ROWID BIGINT NOT NULL,
EMPLOYEUR_ID INTEGER NOT NULL,
EMPLOYE_ID INTEGER NOT NULL,
UNITE_ID INTEGER NOT NULL,
MOIS INTEGER NOT NULL,
ANNEE INTEGER NOT NULL,
NB_JOUR_TRAVAILLER NUMERIC(4,2) DEFAULT 0,
NB_HEURE_TRAVAILLER NUMERIC(5,2) DEFAULT 0,
NB_FERIE_TRAVAILLER NUMERIC(4,2) DEFAULT 0,
NB_CONGE_EXCEPTIONNEL NUMERIC(4,2) DEFAULT 0,
NB_CONGE_ANNUEL NUMERIC(4,2) DEFAULT 0,
NB_CONGE_SANS_SOLDE NUMERIC(4,2) DEFAULT 0,
NB_ABSENCE_AUTORISEE NUMERIC(4,2) DEFAULT 0,
NB_ABSENCE_NON_AUTORISEE NUMERIC(4,2) DEFAULT 0,
NB_MISSION NUMERIC(4,2) DEFAULT 0,
NB_INTEMPERIE NUMERIC(4,2) DEFAULT 0,
NB_MALADIE NUMERIC(4,2) DEFAULT 0,
NB_HEURE_RETARD NUMERIC(4,2) DEFAULT 0,
NB_DEDUCTION NUMERIC(4,2) DEFAULT 0,
INTITULE_SALAIRE VARCHAR(50)
);
I 've just made I test that I forgot to do it under IBEXPERT with the insert above the default values are applied.
If it is correct maybe it comes from my delphi app ?
I 've just made I test that I forgot to do it under IBEXPERT with the insert above the default values are applied.
If it is correct maybe it comes from my delphi app ?