Can anybody assist with this code?
The second select statement causes
"Invalid request BLR at offset 243
undefined message number"
Note that if the parameter :N is replaced with a number eg 1 then all is fine. Why can't the parameter be used?
Geoff Marshall
alter procedure ValidateStock returns (stockref integer, Purchased integer, sold integer, stockheld numeric(15,2), correctedstock integer, Error char(1))
as
declare variable N integer;
begin
for select stockkey, sum(stockqty) from accounts where stockkey is not null
group by stockkey
into N, Purchased
do
begin
stockref = N;
select instock from stock where stockkey = :N into stockheld;
/* line above causes the problem*/
suspend;
end
end