Subject | Re: [firebird-support] Renumbering records |
---|---|
Author | Martijn Tonies |
Post date | 2004-08-27T08:01:56Z |
> I need to "renumber" records in a table according to some "grouping"Side note:
> fields, and I though of doing it with this stored procedure:
>
> ----------
> CREATE PROCEDURE RENUM (
> SIFKOR VARCHAR(10),
> GOD INTEGER,
> ORGJ SMALLINT,
> START INTEGER)
> AS
> DECLARE VARIABLE D DATE;
> DECLARE VARIABLE N INTEGER;
> begin
> select gen_id(tmp$gen, 0) from rdb$database into :n;
n = gen_id(tmp$gen, 0);
works fine as well. There's no need for the SELECT here.
With regards,
Martijn Tonies
Database Workbench - developer tool for InterBase, Firebird, MySQL & MS SQL
Server.
Upscene Productions
http://www.upscene.com