db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Shazin Sadakath <shazin.sadak...@gmail.com>
Subject Re: Stored Procedures
Date Mon, 23 Nov 2009 07:00:01 GMT
Hi Rick,

Thanks for that very descriptive reply.

I have some more questions.

1. So what the Create Procedure/Function statement actually does is creating
an Alias to
    a static java method??

2. When the Created Procedure/Function is called at the run time. How does
the loading and execution
   take place?

Thanks,
Shazin

On Fri, Nov 20, 2009 at 7:34 PM, Rick Hillegas <Richard.Hillegas@sun.com>wrote:

> Shazin Sadakath wrote:
>
>> Hi All,
>>
>> Can anyone guide me on what classes in the source are associated with
>> creating a DerbySQL Routine please???
>>
>> Thanks,
>> Shazin
>>
> Hi Shazin,
>
> The processing flow is something like this:
>
> o The parser (sqlgrammar.jj) creates a CreateAliasNode to represent the
> user's CREATE FUNCTION/PROCEDURE
>
> o The rest of compilation for the CREATE FUNCTION/PROCEDURE statement is
> handled by the bindStatement() and makeConstantAction() methods of the
> CreateAliasNode.
>
> o In particular, CreateAliasNode.makeConstantAction() creates the
> execution-time object which does the heavy lifting: a
> CreateAliasConstantAction object.
>
> o At statement-execution time, the CreateAliasConstantAction populates the
> data dictionary. That is the CreateAliasConstantAction adds a persistent
> AliasDescriptor, which describes the new function/procedure.
>
> o The AliasDescriptor is stored in SYS.SYSALIASES. The really interesting
> bits of the AliasDescriptor are the AliasInfo object which it contains. That
> AliasInfo object is stored in the ALIASINFO column of SYS.SYSALIASES.
>
> Hope this helps,
> -Rick
>
>

Mime
View raw message