1

Topic: values in stored procedures

All greetings.
For a basis update  it was required to make the mechanism  procedures and triggers (to , in Firebird there is no command "recompile"). Also came across the following riddle  which in any way I can not explain:
In a data structure there is a procedure with default arguments and the colleague uses such possibility in other procedure.
At compilation in IBExpert no problems arise neither at SQL-Statement, nor at SQL-Executive.
In a Delphi-code throws out the following error:

 Invalid token.
SQL error state =07001
Invalid request BLR at offset 98.
Input parameter mismatch for procedure SP_CHECK_ARTIKEL_N.
Error while parsing procedure SP_CHECK_EINL_NL's BLR. 

[sub]

 CREATE OR ALTER PROCEDURE SP_CHECK_EINL_NL (
ARTIKELCODE VARCHAR (20)
)
RETURNS (
OUT_CHECK INTEGER
)
AS
declare variable VCHECK1 integer;
declare variable VCHECK integer;
begin
OUT_CHECK = 0;
select OUT_LAGER_STATUS
from [b] SP_CHECK_ARTIKEL_N (:ARTIKELCODE) [/b]
into:vcheck
;
--vielleicht Prozedur vorziehen und zweite Prozedur nur aufrufen wenn man im zeitlichen Fenster ist
select OUT_LAGER_STATUS
from SP_FIRST_AHT_LOAD
into:vcheck1
;
IF ((vcheck=1) and (vcheck1=1)) then OUT_CHECK = 1;
suspend;
end 

[/sub]
Procedure SP_CHECK_ARTIKEL_N has the following title:
create or alter procedure SP_CHECK_ARTIKEL_N (
P_ARTIKELCODE varchar (20);
P_DEL_ARTIKEL integer = 0 )
returns (
OUT_LAGER_STATUS integer)
as
declare variable AHT_LIMIT float;
.....
If to correct SP_CHECK_EINL_NL with a call of the second parameter all transits safely.
PS:  parameter on
P_DEL_ARTIKEL integer default 0
Conducts to the same result.

2

Re: values in stored procedures

svd wrote:

In a Delphi-code

I  a typical error of beginners: exhibiting CheckParams in true at TIBSQL.

3

Re: values in stored procedures

Dimitry Sibiryakov;
, forgot to specify: in Delphi operation is conducted with FIBPlus. The specified class there is not present.

4

Re: values in stored procedures

svd;
CheckParams ungear. At included components at prepare start to search for parameters in the request text, and transfer to their server. And such parameter in the text dll is not present.

5

Re: values in stored procedures

Thanks!