ViewVC Help
View File | Revision Log | Show Annotations | Download File | View Changeset | Root Listing
root/public/ibx/trunk/design/IBSQLEditFrame.pas
(Generate patch)

Comparing ibx/trunk/design/IBSQLEditFrame.pas (file contents):
Revision 209 by tony, Wed Mar 14 12:48:51 2018 UTC vs.
Revision 263 by tony, Thu Dec 6 15:55:01 2018 UTC

# Line 756 | Line 756 | procedure TIBSQLEditFrame.AddWhereClause
756   var WhereClause: string;
757      Separator: string;
758      Count: integer;
759    Prefix: string;
759      ColumnName: string;
760 +    ColParamName: string;
761   begin
762    Count := 0;
763    WhereClause := 'Where';
764    Separator := ' A.';
765  if UseOldValues then
766    Prefix := ':OLD_'
767  else
768    Prefix := ':';
765    with PrimaryKeys do
766    begin
767      DisableControls;
# Line 778 | Line 774 | begin
774          begin
775            Inc(Count);
776            ColumnName := FieldByName('ColumnName').AsString;
777 +          if UseOldValues then
778 +            ColParamName := 'OLD_' + AnsiUpperCase(ColumnName)
779 +          else
780 +            ColParamName := AnsiUpperCase(ColumnName);
781 +
782            if QuotedStrings then
783 <            WhereClause := WhereClause + Separator + '"' + ColumnName +
784 <                   '" = ' + Prefix+ AnsiUpperCase(ColumnName)
783 >            WhereClause := WhereClause +
784 >                           Separator +
785 >                           '"' + ColumnName + '" = :"' + ColParamName + '"'
786            else
787 <            WhereClause := WhereClause + Separator + QuoteIdentifierIfNeeded(Database.SQLDialect,ColumnName) +
788 <                   ' = ' + Prefix + AnsiUpperCase(ColumnName);
787 >            WhereClause := WhereClause +
788 >                           Separator +
789 >                           QuoteIdentifierIfNeeded(Database.SQLDialect,ColumnName) +
790 >                           ' = :' +
791 >                           QuoteIdentifierIfNeeded(Database.SQLDialect,ColParamName);
792            Separator := ' AND A.';
793          end;
794          Next;
# Line 903 | Line 908 | begin
908      Separator := ':';
909      for I := 0 to FieldNames.Count - 1 do
910        begin
911 <         InsertSQL := InsertSQL + Separator +  AnsiUpperCase(FieldNames[I]) ;
911 >        if QuotedStrings then
912 >          InsertSQL := InsertSQL + Separator +  '"' + AnsiUpperCase(FieldNames[I]) + '"'
913 >        else
914 >          InsertSQL := InsertSQL + Separator +  QuoteIdentifierIfNeeded(Database.SQLDialect,AnsiUpperCase(FieldNames[I])) ;
915           Separator := ', :';
916        end;
917      InsertSQL := InsertSQL + ')';
# Line 961 | Line 969 | begin
969    for I := 0 to FieldNames.Count - 1 do
970      begin
971        if QuotedStrings then
972 <        UpdateSQL := Separator + '"' + FieldNames[I] + '" = :' + AnsiUpperCase(FieldNames[I])
972 >        UpdateSQL := Separator + '"' + FieldNames[I] + '" = :"' + AnsiUpperCase(FieldNames[I]) + '"'
973        else
974 <        UpdateSQL := Separator + QuoteIdentifierIfNeeded(Database.SQLDialect,FieldNames[I]) + ' = :' + AnsiUpperCase(FieldNames[I]);
974 >        UpdateSQL := Separator + QuoteIdentifierIfNeeded(Database.SQLDialect,FieldNames[I]) + ' = :' +
975 >                                 QuoteIdentifierIfNeeded(Database.SQLDialect,AnsiUpperCase(FieldNames[I]));
976        if I < FieldNames.Count - 1 then
977          UpdateSQL := UpdateSQL + ',';
978        SQL.Add(UpdateSQL);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines