Subject | Re: [firebird-support] Re: Problem with quotes |
---|---|
Author | Jason Dodson |
Post date | 2005-10-10T19:29:07Z |
I think it would be more correct in saying that a "real" programmer wouldn't be
doing this at all.
Jason
Ali Gökçen wrote:
doing this at all.
Jason
Ali Gökçen wrote:
> However, real programmers do this: ;)
>
> CREATE PROCEDURE PROC_NOVA_SIFRA_GEN(GEN VARCHAR(50))
> RETURNS (SIF BIGINT)
> AS
> begin
>
> execute statement 'select gen_id('||GEN||',1) from rdb$database'
> into :SIF;
>
> if(SIF is not null) then suspend;
>
> WHEN SQLCODE -104 DO
> begin
> execute statement 'CREATE GENERATOR '||GEN;
> execute statement 'select gen_id('||GEN||',1) from rdb$database'
> into :SIF;
> SUSPEND;
> end
>
> end
>
> Don't forget, if more than one user call this proc at the same time
> and there is no GEN named GENERATOR, FB will throw an exception
> because of DUPLICATE Generator name creation. You should commit
> the transaction ASAP if SIF returns as 1.
>
> Regards.
> Ali
>
>
>
> --- In firebird-support@yahoogroups.com, "miki_avramovic"
> <miki.avramovic@g...> wrote:
>
>>Thanks a lot Ali Gökçen!
>>It works correct!
>>
>>With Best Regards!
>>Miki A
>
>
>
>
>
>
>
>
> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
>
> Visit http://firebird.sourceforge.net 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
>
>
>
>
>
>
>
>
>
>