Subject | Re: complex select |
---|---|
Author | duilio_fos <irel_llc@libero.it> |
Post date | 2003-02-16T19:52:38Z |
--- In ib-support@yahoogroups.com, "Marco Menardi <mmenaz@l...>"
<mmenaz@l...> wrote:
My code has become:
delete from tb_eva;
/* prendi tutte le matricole da tb_per */
insert into tb_eva (mat) SELECT mat FROM tb_per;
/* elimina gli indisponibili */
delete from tb_eva where mat in (select mat from Unavaiable
(:Data) );
/* elimina quelli gia' presenti nel turno corrente */
delete from tb_eva where mat in (select mat from Working
(:Data,:Turno,:Sol);
/* elimina quelli della notte, se il turno corrente non e'
staccato di almeno 8h dall'orario di uscita della notte */
delete from tb_eva where mat in (select mat from
HaveWorkedTheNightBefore(:Data,:Turno,:Sol) );
...
This way, I can test the SPs one by one and the code becomes much
clearer.
Grazie
Duilio
<mmenaz@l...> wrote:
> You CAN use SP in a select.perfect.
My code has become:
delete from tb_eva;
/* prendi tutte le matricole da tb_per */
insert into tb_eva (mat) SELECT mat FROM tb_per;
/* elimina gli indisponibili */
delete from tb_eva where mat in (select mat from Unavaiable
(:Data) );
/* elimina quelli gia' presenti nel turno corrente */
delete from tb_eva where mat in (select mat from Working
(:Data,:Turno,:Sol);
/* elimina quelli della notte, se il turno corrente non e'
staccato di almeno 8h dall'orario di uscita della notte */
delete from tb_eva where mat in (select mat from
HaveWorkedTheNightBefore(:Data,:Turno,:Sol) );
...
This way, I can test the SPs one by one and the code becomes much
clearer.
Grazie
Duilio