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?
alter procedure ValidateStock returns (stockref integer, Purchased integer, sold integer, stockheld numeric(15,2), correctedstock integer, Error char(1))
declare variable N integer;
for select stockkey, sum(stockqty) from accounts where stockkey is not null
group by stockkey
into N, Purchased
stockref = N;
select instock from stock where stockkey = :N into stockheld;
/* line above causes the problem*/