Subject | Re: [IBO] Retrieving generator values |
---|---|
Author | Martijn Tonies |
Post date | 2007-03-07T09:57:23Z |
> CREATE PROCEDURE GET_GENERATOR_VALUEA quick note, "60" seems a bit too short, given that:
> (
> GENERATOR_NAME VARCHAR(31)
> )
> RETURNS
> (
> GENERATOR_VALUE BIGINT
> )
> AS
> declare variable stmt varchar(60) = '';
select gen_id (,1) from rdb$database
is already 40 characters :-)
> BEGINrdb$database';
> if (generator_name is not null) then
> begin
> stmt = 'select gen_id (' || generator_name || ', 1) from
> execute statement (stmt) into :generator_value;Martijn Tonies
> SUSPEND;
> end
> END
Database Workbench - tool for InterBase, Firebird, MySQL, NexusDB, Oracle &
MS SQL Server
Upscene Productions
http://www.upscene.com
My thoughts:
http://blog.upscene.com/martijn/
Database development questions? Check the forum!
http://www.databasedevelopmentforum.com