Subject | Re: [firebird-support] Generator only seems to increment once...? |
---|---|
Author | brian |
Post date | 2015-04-29T06:42:04Z |
On Mon, 27 Apr 2015 19:13:51 +1200, you wrote:
some kind of problem with executing the SQL statements via
FreePascal's TSQLQuery. That narrows it down a bit! I'm surprised that
this is where the problem lies, though. Either there's some very
unlikely bug or I've failed to understand a difference between
FreePascal and Delphi. When I sort out what the problem is, I'll post
back here, just in case someone else is using this combination and
runs into a similar problem.
Brian.
>At 09:58 a.m. 27/04/2015, brian brian@... [firebird-support] wrote:I confirm that this works correctly from isql. OK, so I'm looking for
>
>>Hi folks,
>>
>>Has anything changed with regard to generators after Firebird 1.5?
>>I've got Helen Borrie's first version as my reference book, and in
>>there I read
>>
>>SELECT GEN_ID(<name>,<step>) FROM RDB$DATABASE;
>>
>>as the way to increment the value returned from a generator.
>>
>>I guess I should say now that I'm using the embedded server v2.5.2
>>from Lazarus/FreePascal under 64-bit Debian.
>>
>>Everything else seems to be working, I can create the database, the
>>tables, the indices, all works fine, but when I try to return values
>>from the generator it never increments. I can vary the value returned
>>by varying the step, but it's always returning (1+step) no matter how
>>many calls I make to the routine. Does anybody have any idea what I'm
>>missing, please?
>
>Did you actually create a generator?
>Assuming you're using isql from the /bin/directory of your Firebird installation:
>
>CREATE GENERATOR MYGEN;
>COMMIT;
>SELECT GEN_ID (MYGEN,1) FROM RDB$DATABASE as MyNumber;
>-- repeat this a few times.
>
some kind of problem with executing the SQL statements via
FreePascal's TSQLQuery. That narrows it down a bit! I'm surprised that
this is where the problem lies, though. Either there's some very
unlikely bug or I've failed to understand a difference between
FreePascal and Delphi. When I sort out what the problem is, I'll post
back here, just in case someone else is using this combination and
runs into a similar problem.
Brian.