Subject Re: Stored Proc Problem
Author spencerr99
--- In firebird-support@yahoogroups.com, "Martijn Tonies"
<m.tonies@u...> wrote:
> Hi,
>
> > execute procedure newrowid( 'person', 1 )
> >
> > I get this:
> >
> > ISC ERROR CODE:335544327
> >
> > ISC ERROR MESSAGE:
> > invalid request handle
> >
> > STATEMENT:
> > TIBOInternalDataset:
> > "<TApplication>.frmMain.dlgWisql.<TIBOQuery>.<
TIBOInternalDataset>."
> >
> >
> > Statement: execute procedure newrowid( 'person', 1 )
> >
> > Any ideas?
>
> Does that procedure return any values/parameters?
>
>
> With regards,
>
> Martijn Tonies
> Database Workbench - developer tool for InterBase, Firebird & MS SQL
Server.
> Upscene Productions
> http://www.upscene.com

Thanks, and yes, it calls a generator which returns the next generated
number.

Here is the stored proc code:

COMMIT WORK;
SET AUTODDL OFF;
SET TERM ^ ;

/* Stored procedures */

CREATE PROCEDURE "NEWROWID"
(
"TABLENAME" VARCHAR(31),
"STEP" NUMERIC(8, 0)
)
RETURNS
(
"ID" NUMERIC(16, 0)
)
AS
BEGIN EXIT; END ^


ALTER PROCEDURE "NEWROWID"
(
"TABLENAME" VARCHAR(31),
"STEP" NUMERIC(8, 0)
)
RETURNS
(
"ID" NUMERIC(16, 0)
)
AS
BEGIN
if( tableName = 'person' ) then
id = GEN_ID( personr_id_gen, step );
END
^

SET TERM ; ^
COMMIT WORK;
SET AUTODDL ON;

-----------

As I said before, this works fine in IBConsole and using InterClient
JDBC. But it fails in both IBOConsole AND the Firebird JDBC. So the
problem is probably not the JDBC driver, because it seems the main SQL
parsing engine is failing.

TIA,
Spencer