|
@@ -715,6 +715,23 @@ function TSQLDBRestDBHandler.GetGeneratorValue(const aGeneratorName: String
|
|
|
): Int64;
|
|
|
|
|
|
begin
|
|
|
+{$IFDEF VER3_0_4}
|
|
|
+ // The 'get next value' SQL in 3.0.4 is wrong, so we need to do this sep
|
|
|
+ if (IO.Connection is TSQLConnector) and SameText((IO.Connection as TSQLConnector).ConnectorType,'Sqlite3') then
|
|
|
+ begin
|
|
|
+ With CreateQuery('SELECT seq+1 FROM sqlite_sequence WHERE name=:aName') do
|
|
|
+ Try
|
|
|
+ ParamByName('aName').AsString:=aGeneratorName;
|
|
|
+ Open;
|
|
|
+ if (EOF and BOF) then
|
|
|
+ DatabaseErrorFmt('Generator %s does not exist',[aGeneratorName]);
|
|
|
+ Result:=Fields[0].asLargeint;
|
|
|
+ Finally
|
|
|
+ Free;
|
|
|
+ end;
|
|
|
+ end
|
|
|
+ else
|
|
|
+{$ENDIF}
|
|
|
Result:=IO.Connection.GetNextValue(aGeneratorName,1);
|
|
|
end;
|
|
|
|