Output parameters in Firebird stored procedures

Posts   
 
    
Diego
User
Posts: 15
Joined: 06-Jul-2005
# Posted on: 06-Jul-2005 16:42:41   

Hello,

I'm using the 1.0.2004.2 version of the LLBLGen Pro and Firebird 1.5, and I'm having some troubles with this stored procedure.


CREATE PROCEDURE DETAIL_ID_GETTER (
    STEP INTEGER)
RETURNS (
    NEW_ID INTEGER)
AS
BEGIN 
  NEW_ID = GEN_ID(DETAIL_ID_GENERATOR, STEP);
END

Perhaps I'm doing something wrong, but according to this paragraph of the LLBLGen Pro Help the NEW_ID param must appear in the signature of the RetrievalProcedures.DetailIdGetter.

Output parameters are also supported. When a stored procedure has an output parameter, a parameter representing the output parameter in the stored procedure is added to the method heading and is defined as 'ref' (C#) or 'ByRef' (VB.NET).

Thus I was expecting a method like this:

DataTable RetrievalProcedures.DetailIdGetter(int step, ref int keyId)

however I obtain only this:

DataTable RetrievalProcedures.DetailIdGetter(int step)

The weird thing is that when I'm using the designer, if I expand this stored procedure tree node, I can see both the input and output parameters but the output parameter doesn't seem to get generated.

Is there some way of forcing the generation of the output parameter in the retrieval procedure?

Thanks.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39933
Joined: 17-Aug-2003
# Posted on: 07-Jul-2005 10:42:49   

When a procedure has a resultset, it has output parameters, which form the columns of the resultset (in firebird).

So when the driver sees a resultset (in this case, output parameters), it will set the # of resultsets to 1, hence the retrievalprocedure.

Setting it to 0 will make it an action procedure, though refreshing the catalog will make the refresher see it as: "oh, it now returns a resultset! let's make it a resultset proc!", the manual action to set it to 0 isn't preserved at the moment.

An issue has been filed to fix this in the next upgrade, as some code has to be added and the project file has to be adjusted to get this fixed.

While testing I ran into an issue with the firebird driver as well, which I fixed and which I'll upload later this morning.

Frans Bouma | Lead developer LLBLGen Pro