Subject RE: [ib-support] stored procedure
Author Richard Pendered
See below:
but basically, when doing select into you need exactly the same number of
selected columns as you have 'into' variables.

Rich P...

-----Original Message-----
From: Regina Phandu [mailto:regina@...]
Sent: 28 September 2002 01:26
To: ib-support@yahoogroups.com
Subject: [ib-support] stored procedure


Hi all,

I'm trying this procedure, but i get an error. I'm new with firebird.
hope anyone would help me here!


set term !!;
create procedure sp_tot_prod_qty (prod_code integer)
returns (tot_prod_qty float)
as
declare variable qty_display float;
declare variable qty_warehouse float;

begin

/* HERE - do not use prod_code */
select prod_code, qty
from tm_pos_product
where prod_code = :prod_code
into :qty_display;

/* HERE same */
select prod_code, qty
from tm_warehouse
where prod_code = :prod_code
into :qty_warehouse;

:tot_prod_qty=(qty_display + qty_warehouse)

end !!
set term ;!!

thanks in advance!

Regina


[Non-text portions of this message have been removed]



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



Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/