Page 1 of 1

SQLProcessor pbm

Posted: 01.04.2008, 15:14
by akli_agha
Hi,

I wrote an SQL script which works fine on IBExpert but when I tried to execute it under an SQLProcessor, I had this error :
Invalid request BLR at offset 291 bad parameter number.

I'm using Zeos 6.6.2, Firebird 2.0.3 and D7.

An idea about this message ?? Thanks.

Posted: 01.04.2008, 16:27
by gto
hum! and your SQL script, can you post it? ;)

Posted: 01.04.2008, 17:03
by akli_agha
Here is the script :

Code: Select all

SET TERM ^ ;

CREATE OR ALTER PROCEDURE GET_PROV_BUD_GLOB (
    mychap char(5),
    myart char(2),
    mypar char(2),
    myaln char(2))
returns (
    tot_bp decimal(15,2),
    tot_bs decimal(15,2),
    tot_br decimal(15,2),
    tot_vir_e decimal(15,2),
    tot_vir_d decimal(15,2))
as
begin
      /* BP */
      select sum(dotation) from budget
      where budget='P' and chap=:myChap and Art=:myArt and
            par=:myPar and aln=:myAln
      into tot_bp;
    
      /* BS */
      select sum(dotation) from budget
      where budget='S' and chap=:myChap and Art=:myArt and
            par=:myPar and aln=:myAln
      into tot_bs;
    
      /* BR */
      select sum(dotation) from budget
      where budget='R' and chap=:myChap and Art=:myArt and
            par=:myPar and aln=:myAln
      into tot_bR;
    
      /* VIR D */
      select sum(MONTANT) from virement
      where Sens='D' and chap=:myChap and Art=:myArt and
            par=:myPar and aln=:myAln
      into tot_vir_D;
    
      /* VIR E */
      select sum(MONTANT) from virement
      where Sens='E' and chap=:myChap and Art=:myArt and
            par=:myPar and aln=:myAln
      into tot_vir_E;
  suspend;
end^

SET TERM ; ^

GRANT SELECT ON BUDGET TO PROCEDURE GET_PROV_BUD_GLOB;

GRANT SELECT ON VIREMENT TO PROCEDURE GET_PROV_BUD_GLOB;

GRANT EXECUTE ON PROCEDURE GET_PROV_BUD_GLOB TO SYSDBA;

PS : DelimiterType set to dtSetTerm.


Thanks.

Posted: 02.04.2008, 18:35
by akli_agha
Hi GTO,

Is my script correct or bugged ??

Need other information ??

Regards.

Posted: 02.04.2008, 21:21
by gto
Hello akli_agha!

I can't see any errors in your SQL, really.

Looking through internet, it looks like a firebird error. Check if version selected in IBExpert is the same version as in Zeos.

There's something too:

http://dn.codegear.com/article/25848

Another thing I see in google is that's something related with UDFs. Do you use them?