Subject Re: [firebird-support] Re: procedure question or multiple table keys
Author Lista Discussao Interbase
On Tue, 01 Jun 2004 17:40:17 +1000, Helen Borrie <helebor@...> escreveu:

> De: Helen Borrie <helebor@...>
> Data: Tue, 01 Jun 2004 17:40:17 +1000
> Para: firebird-support@yahoogroups.com
> Assunto: Re: [firebird-support] Re: procedure question or multiple table keys
>
> >Thanks Alexandre, I looked at the Release Notes for 15 and 'think' I
> >understand that what I want to do may work, except for one reason. I'm
> > using ADOdb and i don't think that this new feature is in that as
> >yet, or I'm not even certain that procedures can be executed either,
> >so I still have a problem that I don't know how to resolve. Thanks.
>
> Querying the database for a generator value is not a new feature at all.
>
> If you want your key in the application and it uses gen_Something, this
> drop-dead-simple query will allow you to fetch the latest generator value
> into an application variable:
>
> select gen_id(gen_Something, 1) from rdb$database;
>
> Just read the resultset of this query into your variable and you've got
> it. As long as you post the "master" record first, you can create
> "details" with this value as their foreign key in the same transaction, to
> your heart's content.
>
> /heLen
>

Helen,

I have answered two questions posted by Lee.

I think the FB 1.5 feature he mentions on his message, was about another question he post, I told him to look at EXECUTE STATEMENT on FB 1.5 Release notes.

Am I right Lee ?

If I am right:
Lee, the Execute Statement will be inside you procedure, so your access method will not even know you have used it.

The execute statement permits you to dinamically construct SQL statements, so you could solve your problem to insert/update diferent columns based on you Stored Procedure parameters.

See you !

Alexandre Benson Smith
Development
THOR Software e Comercial Ltda.
Santo Andre - Sao Paulo - Brazil
www.thorsoftware.com.br