Subject | RE: [firebird-support] Access to Stored Procedure |
---|---|
Author | Thomas Steinmaurer |
Post date | 2004-03-22T11:54:54Z |
> I have created a stored procedureReplace the EXIT with a SUSPEND.
>
>
>
>
>
> CREATE PROCEDURE "TESTPROC"
>
> RETURNS
>
> (
>
> "ID" CHAR(30) CHARACTER SET WIN1252
>
> )
>
> AS
>
> DECLARE VARIABLE xpart VARCHAR(30);
>
> DECLARE VARIABLE NewNum INTEGER;
>
> BEGIN
>
> NewNum = GEN_ID(CCPART_GEN,1);
>
> xPart = Cast(Newnum as INTEGER);
>
> WHILE (STRLEN(xPart)<6) DO
>
> BEGIN
>
> xPart = ('0'||xPart);
>
> END
>
> ID= ('CCS-'||Xpart);
>
> EXIT;
>
> END
> My query is how do access this from my application or IbConsoleThe usage of the stored procedure as a selectable SP is fine, but
>
> Using
>
> SELECT ID FROM TESTPROC
>
> activates the procedure and increments the generator but I get null as a
> result.
you need to use SUSPEND. See above.
HTH,
Thomas Steinmaurer
LogManager Serie - Logging/Auditing Suites supporting
InterBase, Firebird, Advantage Database and MS SQL Server
Upscene Productions
http://www.upscene.com