Subject Re: stored procedure and IB_DSQL
Author rs@sawsoft.de
Hi,

many thanks for your fast reply.. I tried it and it works really
great.

Best greetings

Ronni

--- In IBObjects@yahoogroups.com, Daniel Rail <daniel@a...> wrote:
> Hi,
>
> At December 17, 2003, 13:52, rs@s... wrote:
> > I have a problem using IB_DSQL. I try to create a stored
procedure
> > as follows :
>
> > create procedure saw_getarttext (artikelnr varchar(20),
> > groesse varchar(10))
> > returns (text varchar(255))
> > as
>
> > begin
> > select artikeltext from Artikel
> > where artikelnr = :artikelnr
> > and groesse = :groesse
> > into :text;
>
> > suspend;
> > end
>
> > the following code shows an error :
>
> > IB_DSQL1.SQL.LoadfromFile('C:\saw_getarttext.prc');
> > if IB_Transaction1.InTransaction then IB_Transaction.Commit;
> > IB_Transaction.StartTransaction;
> > IB_DSQL1.Execute; // or IB_DSQL1.ExecSQL; same error occurs
> > IB_Transaction.Commit;
>
> > An errormessage is shown like :
> > Unkown Datatype : 0
>
> > I also tried it with : Set Term ^;
> > But then an errormessage is shown like : unknown token at line 1
> > position 5 : term
>
> > What is wrong with it?
>
> Use TIB_Script instead of TIB_DSQL. And, don't forget to use SET
> TERM, before and after your CREATE PROCEDURE, as follows:
>
> SET TERM ^ ;
> CREATE PROCEDURE...
> BEGIN
> ...
> END^
> SET TERM ; ^
>
> The second SET TERM is just to reset the terminator back to a
> semi-colon.
>
> --
> Best regards,
> Daniel Rail
> Senior System Engineer
> ACCRA Group Inc. (www.accra.ca)
> ACCRA Med Software Inc. (www.filopto.com)