Subject | Re: Little problem with generators |
---|---|
Author | Adam |
Post date | 2006-06-02T05:33:07Z |
--- In firebird-support@yahoogroups.com, "andrew_s_vaz"
<andrew_s_vaz@...> wrote:
it is not there, then create it.
select gen_id(whatever, 0) from RDB$DATABASE;
2. Issue a create command and ignore any exception
Create generator whatever;
3. Interrogate System tables
select
case when exists
(
select *
from RDB$GENERATORS
WHERE Upper(RDB$GENERATOR_NAME) = Upper('whatever')
)
then 'T' else 'F' end as GeneratorExists
from RDB$DATABASE;
** Note: Do not attempt to manipulate the system tables directly,
treat them as read-only or risk database confetti **
Adam
<andrew_s_vaz@...> wrote:
>with
> Hi all,
>
> How can I know if a Generator of name "whatever" already exists? I
> need to create generators automatically and I'm slightly stumped
> this.1. Attempt to get a value from it, and if you get an exception that
>
> Thanks
> Andrew
>
it is not there, then create it.
select gen_id(whatever, 0) from RDB$DATABASE;
2. Issue a create command and ignore any exception
Create generator whatever;
3. Interrogate System tables
select
case when exists
(
select *
from RDB$GENERATORS
WHERE Upper(RDB$GENERATOR_NAME) = Upper('whatever')
)
then 'T' else 'F' end as GeneratorExists
from RDB$DATABASE;
** Note: Do not attempt to manipulate the system tables directly,
treat them as read-only or risk database confetti **
Adam