Subject Re: [ib-support] Stored Procedure Error - Invalid Request BLR at ofset 218
Author Cagatay Tengiz
Helen, thanks for your quick reply.

I was using a TIB_Script component, and I was able to execute the statement.
However FB gives error when I try to commit the statement.

If statement was wrong, shouldn't I get the error when trying to execute it?

By the way rec_alternatifno_bul is also a stored procedure which is defined
as

ALTER PROCEDURE REC_ALTERNATIFNO_BUL( IDREV
DECIMAL ( 18, 0 ) )
RETURNS ( ANO INTEGER )
AS
declare variable tmpno integer;
BEGIN
select max(alternatif_no) from rec where id_rev = :idrev into :tmpno;
if (:tmpno is null) then tmpno = 0;
ano = :tmpno + 1;
SUSPEND;
END
, so
"select ano from rec_alternatifno_bul (:hedev_rev)" is not legal also?

Cagatay
----- Original Message -----
From: Helen Borrie
To: ib-support@yahoogroups.com
Sent: Monday, November 18, 2002 5:01 PM
Subject: Re: [ib-support] Stored Procedure Error - Invalid Request BLR at
ofset 218


At 03:26 PM 18-11-02 +0200, you wrote:
>Hi,
>
>When I am trying to commit this stored procedure using IBO

- using a TIB_Script component, presumably? You cannot use a statement
component (TIB_DSQL, TIB_Cursor) for this as the CREATE PROCEDURE statement
is a composite statement.

Use the SQL property of the script component.

Begin the script with

SET TERM ^;

There are some errors inside your procedure which will cause complications,
too. Try the following to avoid the subselects (fixing errors where
required):

create PROCEDURE cp_rec(kaynak_recid numeric (18, 0), hedef_rev numeric
(18,0))
RETURNS (sonuc_recid numeric (18, 0))
AS
declare variable v_tanim varchar(30); /* replace with correct type */
declare variable v_miktar_baz varchar(30); /* replace with correct type */
declare variable v_ano integer; /* replace with correct type */
BEGIN
sonuc_recid = gen_id(GN_REC, 1);

select r.tanim, r.miktar_baz from rec r
where r.id = :kaynak_recid
into :v_tanim, :v_miktar_baz;
/* not legal: select ano from rec_alternatifno_bul hedev_rev */
select ano from rec_alternatifno_bul
where [some criteria to guarantee a scalar result]
into :v_ano;

insert into rec
(ID, TANIM, ID_REV, MIKTAR_BAZ, ALTERNATIF_NO)
values (
:sonuc_recid,
:v_tanim,
:hedef_rev,
:v_miktar_baz,
:v_ano );

END ^
SET TERM ; ^

heLen



Yahoo! Groups Sponsor
ADVERTISEMENT




To unsubscribe from this group, send an email to:
ib-support-unsubscribe@egroups.com



Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.

__________________________________________________
Do You Yahoo!?
Everything you'll ever need on one web page
from News and Sport to Email and Music Charts
http://uk.my.yahoo.com