append error
Posted: 01.08.2006, 19:51
hy
i work with zeoslib lazarus .0.9.17 and firebird 1.5
This is my function
function appendrecord(sTablename : String; SLFieldentrys : TStringList):boolean;
var
dbtbl : TZTable;
slFieldlist : TStringList;
i : integer;
begin
slFieldlist := TStringList.Create;
dbtbl := getTable(sTablename);
dbtbl.GetFieldNames(slFieldlist);
dbtbl.Append;
for i := 0 to slFieldlist.Count -1 do begin
if SLFieldentrys <> '#1' then begin
dbtbl.FieldByName(slFieldlist).AsString := SLFieldentrys;
end else begin
dbtbl.FieldByName(slFieldlist).AsInteger := dbtbl.Sequence.GetNextValue;
end;
end;
try
dbtbl.Post;
result := true;
except
result := false;
dbtbl.Cancel;
end;
dbtbl := nil;
slFieldlist.Free;
end;
on append it comes an error:
SQL Error: validation error for column ICONFIGMASKENID, value ''***null***''.Error Code:-625. The instert failed because a column definition includes validation constraints. The SQL: INSERT INTO CON###(gdb unparsed remainder:...)###
i fild the id field on SLFieldentrys = '#1'
can someone help me?
thanks
i work with zeoslib lazarus .0.9.17 and firebird 1.5
This is my function
function appendrecord(sTablename : String; SLFieldentrys : TStringList):boolean;
var
dbtbl : TZTable;
slFieldlist : TStringList;
i : integer;
begin
slFieldlist := TStringList.Create;
dbtbl := getTable(sTablename);
dbtbl.GetFieldNames(slFieldlist);
dbtbl.Append;
for i := 0 to slFieldlist.Count -1 do begin
if SLFieldentrys <> '#1' then begin
dbtbl.FieldByName(slFieldlist).AsString := SLFieldentrys;
end else begin
dbtbl.FieldByName(slFieldlist).AsInteger := dbtbl.Sequence.GetNextValue;
end;
end;
try
dbtbl.Post;
result := true;
except
result := false;
dbtbl.Cancel;
end;
dbtbl := nil;
slFieldlist.Free;
end;
on append it comes an error:
SQL Error: validation error for column ICONFIGMASKENID, value ''***null***''.Error Code:-625. The instert failed because a column definition includes validation constraints. The SQL: INSERT INTO CON###(gdb unparsed remainder:...)###
i fild the id field on SLFieldentrys = '#1'
can someone help me?
thanks