This is strictly for embedded clients :-)
Sent from my BlackBerry® wireless device

-----Original Message-----
From: Ann Harrison <[email protected]>
Sender: [email protected]
Date: Thu, 9 Feb 2012 17:09:43 
To: <[email protected]>
Reply-To: [email protected]
Subject: Re: [firebird-support] Set generator in execute block

On Thu, Feb 9, 2012 at 4:05 PM, Si Carter <[email protected]> wrote:

> Worked a treat thankyou
>

If you plan to use this in a multi-user environment, do test it there too.

Good luck,

Ann
>>
>> EXECUTE BLOCK
>> AS
>> DECLARE VARIABLE vMaxID INTEGER;
>> DECLARE VARIABLE Dummy INTEGER;
>> BEGIN
>> SELECT MAX(PK_TABLE_B) FROM TABLE_B
>> INTO :vMaxID ;
>> DUMMY = GEN_ID(TABLE_B_GEN, :vMaxID - GEN_ID(TABLE_B_GEN,
>> -GEN_ID(TABLE_B_GEN,0)));
>> END ^
>>
>> The inner GEN_ID will set the generator to 0, the outer to vMaxID.
>>
>> HTH,
>> Set
>>
>>  __._,
>>
>
>
> [Non-text portions of this message have been removed]
>
>
>
> ------------------------------------
>
> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
>
> Visit http://www.firebirdsql.org and click the Resources item
> on the main (top) menu.  Try Knowledgebase and FAQ links !
>
> Also search the knowledgebases at http://www.ibphoenix.com
>
> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
> Yahoo! Groups Links
>
>
>



[Non-text portions of this message have been removed]



------------------------------------

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Visit http://www.firebirdsql.org and click the Resources item
on the main (top) menu.  Try Knowledgebase and FAQ links !

Also search the knowledgebases at http://www.ibphoenix.com 

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/firebird-support/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/firebird-support/join
    (Yahoo! ID required)

<*> To change settings via email:
    [email protected] 
    [email protected]

<*> To unsubscribe from this group, send an email to:
    [email protected]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/

Reply via email to