IBX 2.2.0 Line 2520 of IBExtract.pas, seems to be a bug lazarus / 16-Databases ---------------------------------------------------------------------- RedOctober · 2018-03-16 03:03 Line 2520 of IBExtract.pas:  if not qryValue.EOF then             FMetaData.Add(Format('ALTER SEQUENCE %s RESTART WITH %d;',                  [QuoteIdentifierIfNeeded(FDatabase.SQLDialect, GenName),                   qryValue.FieldByName('GENERATORVALUE').AsInteger])); Parameter values: GenName = 'GEN_CHG_SEQ' The SQL in qryValue is:  'SELECT GEN_ID(GEN_CHG_SEQ,0) as GENERATORVALUE From RDB$Database' The original "QuoteIdentifier" was replaced with "QuoteIdentifierIfNeeded" on the suggestion of Tony W. Error: Project MyProject raised exception class 'RunError(201)'.  In file 'fbintf\client\FBSQLData.pas' at line 1242 [Ignore this exception type] [Break] [Continue] The generator value of GEN_CHG_SEQ is a negative BIGINT: -9223372036846508949 Is this a bug?  Maybe the Format('ALTER SEQUENCE %s RESTART WITH %d;'  is the problem?  Maybe %d isn't big enough to accept such a large integer? ---------------------------------------------------------------------- rvk · 2018-03-16 09:59 Quote from: RedOctober on March 16, 2018, 04:03:17 am-9,223,372,036,846,508,949 Is this a bug?  Maybe the Format('ALTER SEQUENCE %s RESTART WITH %d;'  is the problem?  Maybe %d isn't big enough to accept such a large integer? BIGINT is defined as -2^63 (-9,223,372,036,854,775,808) to 2^63-1 (9,223,372,036,854,775,807) So -9,223,372,036,846,508,949 should fit in a BIGINT. But .AsInteger (which is used) is an integer in FPC. (B.T.W. in Delphi it is a LongInt but effectively the same on 32 bits) So, yeah, that could be a problem. Usually you would do .asInt64 for a BigInt. ---------------------------------------------------------------------- tonyw · 2018-03-16 12:09 Agree. It's a bug