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