mORMot and Open Source friends
Check-in [4e53b0e50d]
Not logged in

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment: added generic ReplaceParamsByNames() function, which allows 'END;' at the end of a statement to fulfill ticket [4a7da3c6a1]
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 4e53b0e50d4a5487a306b6e7c746587f2e6e7e05
User & Date: abouchez 2013-07-09 11:27:50
Context
2013-07-11
13:03
introduced TSingleDynArray, recognized as such in JSON serialization check-in: feb7b66e26 user: abouchez tags: trunk
2013-07-09
11:27
added generic ReplaceParamsByNames() function, which allows 'END;' at the end of a statement to fulfill ticket [4a7da3c6a1] check-in: 4e53b0e50d user: abouchez tags: trunk
08:30
added TSQLDBConnectionProperties.GetIndexesAndSetFieldsColumnIndexed() internal method, used by SynDBFireDAC and SynDBUniDAC overriden GetFields() implementations check-in: 28e3adc78d user: abouchez tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to SynDB.pas.

175
176
177
178
179
180
181
182

183
184
185
186
187
188
189
....
4974
4975
4976
4977
4978
4979
4980


4981
4982
4983
4984
4985
4986
4987
4988
  - "rowCount": is added in TSQLDBStatement.FetchAllToJSON at the end of the
    non-expanded JSON content, if needed - improves client parsing performance
  - TSQLDBConnectionProperties.SQLSelectAll() now handles spaces in table names
  - TSQLDBStatement.GetParamValueAsText() will truncate to a given number of
    chars the returned text
  - added DoNotFletchBlobs optional parameter to TSQLDBStatement.FetchAllAsJSON()
    FetchAllToJSON(), and ColumnsToJSON() methods (used e.g. by SynDBExplorer)
  - added generic ReplaceParamsByNames() function

  - added missing ColumnToVarData() method to ISQLDBRows interface
  - added TSQLDBConnection[Properties].OnProgress callback event handler
  - now trim any spaces when retrieving database schema text values
  - fixed ticket [4c68975022] about broken SQL statement when logging active
  - fixed ticket [545fbe7579] about TSQLDBConnection.LastErrorMessage not reset
  - fixed potential GPF after TSQLDBConnectionProperties.ExecuteNoResult() method call
  - fixed TSQLDBConnectionProperties.SQLGetField() returned value for dFirebird
................................................................................
    c: array[0..3] of AnsiChar;
    tmp: RawUTF8;
const SQL_KEYWORDS: array[0..17] of AnsiChar = 'ASBYIFINISOFONORTO';
begin
  result := 0;
  L := Length(aSQL);
  while (L>0) and (aSQL[L] in [#1..' ',';']) do


    dec(L); // trim ' ' or ';' right (last ';' could be found incorrect)
  if PosEx('?',aSQL)>0 then begin
    // change ? into :AA :BA ..
    c := ':AA';
    i := 0;
    P := pointer(aSQL);
    if P<>nil then
    repeat






|
>







 







>
>
|







175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
....
4975
4976
4977
4978
4979
4980
4981
4982
4983
4984
4985
4986
4987
4988
4989
4990
4991
  - "rowCount": is added in TSQLDBStatement.FetchAllToJSON at the end of the
    non-expanded JSON content, if needed - improves client parsing performance
  - TSQLDBConnectionProperties.SQLSelectAll() now handles spaces in table names
  - TSQLDBStatement.GetParamValueAsText() will truncate to a given number of
    chars the returned text
  - added DoNotFletchBlobs optional parameter to TSQLDBStatement.FetchAllAsJSON()
    FetchAllToJSON(), and ColumnsToJSON() methods (used e.g. by SynDBExplorer)
  - added generic ReplaceParamsByNames() function, which allows 'END;' at the
    end of a statement to fulfill ticket [4a7da3c6a1]
  - added missing ColumnToVarData() method to ISQLDBRows interface
  - added TSQLDBConnection[Properties].OnProgress callback event handler
  - now trim any spaces when retrieving database schema text values
  - fixed ticket [4c68975022] about broken SQL statement when logging active
  - fixed ticket [545fbe7579] about TSQLDBConnection.LastErrorMessage not reset
  - fixed potential GPF after TSQLDBConnectionProperties.ExecuteNoResult() method call
  - fixed TSQLDBConnectionProperties.SQLGetField() returned value for dFirebird
................................................................................
    c: array[0..3] of AnsiChar;
    tmp: RawUTF8;
const SQL_KEYWORDS: array[0..17] of AnsiChar = 'ASBYIFINISOFONORTO';
begin
  result := 0;
  L := Length(aSQL);
  while (L>0) and (aSQL[L] in [#1..' ',';']) do
    if (aSQL[L]=';') and (L>5) and IdemPChar(@aSQL[L-3],'END') then
      break else // allows 'END;' at the end of a statement
      dec(L);    // trim ' ' or ';' right (last ';' could be found incorrect)
  if PosEx('?',aSQL)>0 then begin
    // change ? into :AA :BA ..
    c := ':AA';
    i := 0;
    P := pointer(aSQL);
    if P<>nil then
    repeat