737 |
|
|
738 |
|
function QuoteIdentifier(Dialect: Integer; Value: AnsiString): AnsiString; |
739 |
|
begin |
740 |
+ |
Value := TrimRight(Value); |
741 |
|
if Dialect = 1 then |
742 |
< |
Value := AnsiUpperCase(Trim(Value)) |
742 |
> |
Value := AnsiUpperCase(Value) |
743 |
|
else |
744 |
|
Value := '"' + StringReplace (Value, '""', '"', [rfReplaceAll]) + '"'; |
745 |
|
Result := Value; |
970 |
|
|
971 |
|
function QuoteIdentifierIfNeeded(Dialect: Integer; Value: AnsiString): AnsiString; |
972 |
|
begin |
973 |
+ |
Value := TrimRight(Value); |
974 |
|
if (Dialect = 3) and |
975 |
|
(IsReservedWord(Value) or not IsSQLIdentifier(Value) or (AnsiUpperCase(Value) <> Value)) then |
976 |
|
Result := '"' + StringReplace (TrimRight(Value), '"', '""', [rfReplaceAll]) + '"' |