Subject | cannot insert |
---|---|
Author | Duilio Foschi |
Post date | 2002-01-21T21:57:21Z |
table BL_HD is defined as:
SHOW TABLE bl_hd
N_MOV INTEGER Not Null
Y_MOV SMALLINT Not Null
D_MOV DATE Not Null
TIP_DOC VARCHAR(5) Nullable
SERIE VARCHAR(10) Nullable
N_DOC INTEGER Nullable
D_DOC DATE Nullable
N_FAT INTEGER Nullable
D_FAT DATE Nullable
D_MAG DATE Nullable
N_ORD INTEGER Nullable
D_ORD DATE Nullable
D_AGG DATE Nullable
D_ANN DATE Nullable
D_PRT DATE Nullable
COD_CAU VARCHAR(5) Not Null
COD_CF VARCHAR(9) Not Null
COD_MAG VARCHAR(5) Not Null
COD_PAG VARCHAR(5) Nullable
COD_BAN VARCHAR(5) Nullable
COD_ESE VARCHAR(5) Nullable
COD_AGE VARCHAR(5) Nullable
AGTEST VARCHAR(1) Nullable
FLG_PRO VARCHAR(1) Nullable
ACCONTO FLOAT Nullable
SP_INC_SN VARCHAR(1) Nullable
SP_TRA_FP VARCHAR(1) Nullable
SP_TRA FLOAT Nullable
SP_BOL_SN VARCHAR(1) Nullable
SP_VAR_FP VARCHAR(1) Nullable
SP_VAR FLOAT Nullable
TIP_PAG VARCHAR(5) Nullable
OMAGGIO FLOAT Nullable
RESO FLOAT Nullable
TOT_PAG FLOAT Nullable
SC_PAG FLOAT Nullable
LISTINO INTEGER Nullable
TOT_FAT FLOAT Nullable
FLG_TST VARCHAR(1) Nullable
FLG_OMA VARCHAR(1) Nullable
FLG_SCR VARCHAR(1) Nullable
COD_VAL VARCHAR(5) Not Null
K_VAL FLOAT Not Null
CONSTRAINT INTEG_676:
Primary key (N_MOV, Y_MOV)
I try to insert the first record:
INSERT INTO BL_HD
(
N_MOV,
D_MOV,
Y_MOV,
TIP_DOC,
SERIE,
N_DOC,
D_DOC,
N_FAT,
D_FAT,
D_MAG,
N_ORD,
D_ORD,
D_AGG,
D_ANN,
D_PRT,
COD_CAU,
COD_CF,
COD_MAG,
COD_PAG,
COD_BAN,
COD_ESE,
COD_AGE,
AGTEST,
FLG_PRO,
ACCONTO,
SP_INC_SN,
SP_TRA_FP,
SP_TRA,
SP_BOL_SN,
SP_VAR_FP,
SP_VAR,
TIP_PAG,
OMAGGIO,
RESO,
TOT_PAG,
SC_PAG,
LISTINO,
TOT_FAT,
FLG_TST,
FLG_OMA,
FLG_SCR,
COD_VAL,
K_VAL
)
VALUES (
7,
'02-JAN-2002',
2002,
'FAT',
'',
1,
'02-JAN-2002',
1,
'02-JAN-2002',
'02-JAN-2002',
' 0',
'30-DEC-1899',
'30-DEC-1899',
'30-DEC-1899',
'30-DEC-1899',
'VEN',
'302',
'01',
'3',
'',
'07',
'',
'',
'',
0,
'F',
'',
0,
'F',
'',
0,
'',
0,
0,
0,
0,
0,
594.03,
'',
'',
'',
'EURO',
1
);
...and get the following error message:
"violation of PRIMARY or UNIQUE KEY constraint INTEG_676 on table BL_HD".
The table is completely empty. This is the first record I insert.
Where is the problem ?
Thank you
Duilio Foschi
SHOW TABLE bl_hd
N_MOV INTEGER Not Null
Y_MOV SMALLINT Not Null
D_MOV DATE Not Null
TIP_DOC VARCHAR(5) Nullable
SERIE VARCHAR(10) Nullable
N_DOC INTEGER Nullable
D_DOC DATE Nullable
N_FAT INTEGER Nullable
D_FAT DATE Nullable
D_MAG DATE Nullable
N_ORD INTEGER Nullable
D_ORD DATE Nullable
D_AGG DATE Nullable
D_ANN DATE Nullable
D_PRT DATE Nullable
COD_CAU VARCHAR(5) Not Null
COD_CF VARCHAR(9) Not Null
COD_MAG VARCHAR(5) Not Null
COD_PAG VARCHAR(5) Nullable
COD_BAN VARCHAR(5) Nullable
COD_ESE VARCHAR(5) Nullable
COD_AGE VARCHAR(5) Nullable
AGTEST VARCHAR(1) Nullable
FLG_PRO VARCHAR(1) Nullable
ACCONTO FLOAT Nullable
SP_INC_SN VARCHAR(1) Nullable
SP_TRA_FP VARCHAR(1) Nullable
SP_TRA FLOAT Nullable
SP_BOL_SN VARCHAR(1) Nullable
SP_VAR_FP VARCHAR(1) Nullable
SP_VAR FLOAT Nullable
TIP_PAG VARCHAR(5) Nullable
OMAGGIO FLOAT Nullable
RESO FLOAT Nullable
TOT_PAG FLOAT Nullable
SC_PAG FLOAT Nullable
LISTINO INTEGER Nullable
TOT_FAT FLOAT Nullable
FLG_TST VARCHAR(1) Nullable
FLG_OMA VARCHAR(1) Nullable
FLG_SCR VARCHAR(1) Nullable
COD_VAL VARCHAR(5) Not Null
K_VAL FLOAT Not Null
CONSTRAINT INTEG_676:
Primary key (N_MOV, Y_MOV)
I try to insert the first record:
INSERT INTO BL_HD
(
N_MOV,
D_MOV,
Y_MOV,
TIP_DOC,
SERIE,
N_DOC,
D_DOC,
N_FAT,
D_FAT,
D_MAG,
N_ORD,
D_ORD,
D_AGG,
D_ANN,
D_PRT,
COD_CAU,
COD_CF,
COD_MAG,
COD_PAG,
COD_BAN,
COD_ESE,
COD_AGE,
AGTEST,
FLG_PRO,
ACCONTO,
SP_INC_SN,
SP_TRA_FP,
SP_TRA,
SP_BOL_SN,
SP_VAR_FP,
SP_VAR,
TIP_PAG,
OMAGGIO,
RESO,
TOT_PAG,
SC_PAG,
LISTINO,
TOT_FAT,
FLG_TST,
FLG_OMA,
FLG_SCR,
COD_VAL,
K_VAL
)
VALUES (
7,
'02-JAN-2002',
2002,
'FAT',
'',
1,
'02-JAN-2002',
1,
'02-JAN-2002',
'02-JAN-2002',
' 0',
'30-DEC-1899',
'30-DEC-1899',
'30-DEC-1899',
'30-DEC-1899',
'VEN',
'302',
'01',
'3',
'',
'07',
'',
'',
'',
0,
'F',
'',
0,
'F',
'',
0,
'',
0,
0,
0,
0,
0,
594.03,
'',
'',
'',
'EURO',
1
);
...and get the following error message:
"violation of PRIMARY or UNIQUE KEY constraint INTEG_676 on table BL_HD".
The table is completely empty. This is the first record I insert.
Where is the problem ?
Thank you
Duilio Foschi