Subject RE: [ib-support] Re: mass deletion
Author Nataraj S Narayanan
On Wed, 10 Apr 2002, Tony Mays wrote:

hI Tony

This method is to delete a particular Bill_id ,isnt it?

Should bill_id be parameter or a variable? I presume that the for loop
gets each record and puts the corresponding bill_id of each record in
:bill_id. For each retrieval the statements inside begin and end should
execute . If that is the case is there any relevance for the bill_id that
we pass ?

> try this:
>
> set term ^ ;
> create procedure removal (bill_id int)
> as
> begin
> for select bill_id from drug_bill where bill_date between '01-JAN-2001'
> and '01-FEB-2001' into :bill_id do
> begin
> delete from drug_bill_item where bill_id=:bill_id;
> delete from drug_bill where bill_id=:bill_id;
> end
> end ^
>
> set term ; ^
>
>
> execute as normal with the exception of passing in the parameter
> ie:
>
> execute procedure removal 10 /* if 10 is the bill_id you wish to remove */
>
>
> hope this helps.


regards

Nataraj