Small fixes for Interbase SQLGenerator

This commit is contained in:
Daniele Teti 2020-06-24 23:51:06 +02:00
parent a8ee598b9d
commit 57e785efd7
2 changed files with 6 additions and 3 deletions

Binary file not shown.

View File

@ -62,7 +62,7 @@ var
lSB: TStringBuilder;
lPKInInsert: Boolean;
begin
lPKInInsert := (not PKFieldName.IsEmpty) and (not(TMVCActiveRecordFieldOption.foAutoGenerated in PKOptions));
lPKInInsert := (not PKFieldName.IsEmpty); // and (not(TMVCActiveRecordFieldOption.foAutoGenerated in PKOptions));
lSB := TStringBuilder.Create;
try
lSB.Append('INSERT INTO ' + TableName + '(');
@ -74,7 +74,7 @@ begin
begin
if lKeyValue.Value.Writeable then
begin
lSB.Append(':' + lKeyValue.Value.FieldName + ',');
lSB.Append(lKeyValue.Value.FieldName + ',');
end;
end;
@ -86,7 +86,10 @@ begin
end;
for lKeyValue in Map do
begin
lSB.Append(':' + lKeyValue.Value.FieldName + ',');
if lKeyValue.Value.Writeable then
begin
lSB.Append(':' + lKeyValue.Value.FieldName + ',');
end;
end;
lSB.Remove(lSB.Length - 1, 1);