Subject | Re: [firebird-support] Auto increment |
---|---|
Author | Martijn Tonies |
Post date | 2004-11-05T09:44:55Z |
Hello,
Period.
If you want some weird sequence, you need to maintain it yourself.
With regards,
Martijn Tonies
Database Workbench - developer tool for InterBase, Firebird, MySQL & MS SQL
Server.
Upscene Productions
http://www.upscene.com
> I have the following situation: I have a table which contains dataYou cannot use a generator like that. Generators generate numbers.
> based on an auto incremented value. But instead of only 1 item for
> each increment a increment can have as many items as needed. Within an
> increment the first part of the key is the auto incremented number,
> the second part is also a number that needs to be auto incremented
> within the first key.
>
> So a part of the table could look like this:
>
> Part 1, Part 2
> 1 1
> 1 2
> 2 1
> 1 3
> 2 2
> 3 1
> 1 4
> 3 2
>
> What is the best way to solve this? I think I need a generator which
> gets the last number (part 2) there is for a given entry (part1) and
> increment that value.
Period.
If you want some weird sequence, you need to maintain it yourself.
With regards,
Martijn Tonies
Database Workbench - developer tool for InterBase, Firebird, MySQL & MS SQL
Server.
Upscene Productions
http://www.upscene.com