Subject | Re: [firebird-support] Update generators inside a stored procedure |
---|---|
Author | Martijn Tonies |
Post date | 2007-02-16T12:24:15Z |
Hi,
EXECUTE STATEMENT 'delete from mytable';
Martijn Tonies
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
> I would like to update (or reset) the values of the generators definedEXECUTE STATEMENT uses a string parameter, eg:
> in the database inside a stored procedure.
>
> I'm trying to do the following:
>
> create procedure UpdateGenTest
> as
> begin
> execute statement gen_id(gen_test, 1);
> end
EXECUTE STATEMENT 'delete from mytable';
> and this does update the value of the generator, BUT it gives themyint = gen_id(mygen, 1);
> following error:
>
> Invalid token.
> Dynamic SQL Error.
> SQL error code = -104.
> Token unknown - line 1, char 1.
> <new value of generator>.
>
> I would be most helpful if anybody could help me out.
Martijn Tonies
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