Subject | Re: [firebird-support] Initializing Generators in Stored Procs |
---|---|
Author | Helen Borrie |
Post date | 2003-09-18T10:08:35Z |
At 11:44 AM 18/09/2003 +0200, you wrote:
CREATE PROCEDURE INITIALIZE_TRANSTYPES
AS
DECLARE VARIABLE OLD_GEN BIGINT;
DECLARE VARIABLE NEW_GEN BIGINT;
BEGIN
OLD_GEN = GEN_ID("GEN_TXNTYPE", 0);
NEW_GEN = GEN_ID("GEN_TXNTYPE", (-1 * :OLD_GEN));
END
But Oh! don't do it except on a completely shut-down database.
h.
>How do I do the following ?:Try this:
>
>CREATE PROCEDURE INITIALIZE_TRANSTYPES
>AS
>BEGIN
> SET GENERATOR "GEN_TXNTYPE" TO 0;
>END
>
>When I try to create the Stored Procedure, I get the following error :
>
>SQL error code = -104
>Token unknown - line 4, char 4
>SET
>Statement: CREATE PROCEDURE INITIALIZE_TRANSTYPES
>AS
>BEGIN
> SET GENERATOR "GEN_TXNTYPE" TO 0;
>END
CREATE PROCEDURE INITIALIZE_TRANSTYPES
AS
DECLARE VARIABLE OLD_GEN BIGINT;
DECLARE VARIABLE NEW_GEN BIGINT;
BEGIN
OLD_GEN = GEN_ID("GEN_TXNTYPE", 0);
NEW_GEN = GEN_ID("GEN_TXNTYPE", (-1 * :OLD_GEN));
END
But Oh! don't do it except on a completely shut-down database.
h.