Subject | Re: [IBO] select view crashes a remote Firebird Server |
---|---|
Author | Helen Borrie |
Post date | 2004-05-31T14:42:15Z |
At 01:55 PM 31/05/2004 +0000, you wrote:
the view. You must use aliases on *everything* in joins:
select
h.DtNaixement,
h.Parts,
h.Parts,
h.Comentari,
/* the following three columns */
CurLoc1,
CurLoc2,
CurLoc3,
coalesce(/* this column */ parts,0)+coalesce(/* this column */ iniparity,0),
/* this column */ CurPreWeaneds,
h.Mare,
h.DtEntrada,
h.Genetics,
h.codi,
h.herd_id,
case when /* this column */ dtbaixa is null then 1 else 0 end,
h.lacstatus,
f.lfAbortions,
f.lfliveBorn*1.00 / nullif(h.parts,0),
f.lfStillBorn*1.00 / nullif(h.parts,0),
(f.lfliveBorn+f.lfstillborn+f.lfmummies)*1.00 / nullif(h.parts,0),
/* this column */ lflittersweaned,
f.lfLiveborn,
/* this column */ LFLIVEBORNLITWEANED,
f.lfMummies,
f.lfnetadded,
/* this column */ LfNetFostered,
f.LFPREWEANEDDEATHS,
100.0 - 100.0* /* all of these columns*/
lftotalweaned/nullif(lflivebornlitweaned+lfnetfostered,0),
f.lfServices,
f.lfStillborn,
f.lfliveBorn+f.lfstillborn+f.lfmummies,
h.ubicacio,
h.PMorfo,
h.Name,
h.Registre,
h.DtBaixa,
h.CausaBaixa,
h.TipusBaixa,
h.reproStatus,
h.DtRepro-h.DtNaixement,
h.Pare,
case when /* this column */ peticiorepos='F' then 0 else 1 end,
h.UserFieldA0,
h.UserFieldA1 from herd h
inner join herd_females f on h.herd_id=f.herd_id
where h.htype=0;
Fix up the view and then see whether you can reproduce the problem afterwards.
Helen
> > select nullif(0,0)... will return NULLCorrect, it's not true. -- Sorry!
> > select nullif(3,0)... will return NULL
> > Select nullif(NULL,0) will return zero.
> >
>
>
>I think that it is not true:
>In any case, it is not the reason because you can do "select * fromOK, the next thing you'll need to look at is the columns in the SELECT for
>female" and you will be able to see the list of recors without
>problems. I insist that the detonating is the combination of the 2
>selects. One select alone works ok and never crashes the FB server.
the view. You must use aliases on *everything* in joins:
select
h.DtNaixement,
h.Parts,
h.Parts,
h.Comentari,
/* the following three columns */
CurLoc1,
CurLoc2,
CurLoc3,
coalesce(/* this column */ parts,0)+coalesce(/* this column */ iniparity,0),
/* this column */ CurPreWeaneds,
h.Mare,
h.DtEntrada,
h.Genetics,
h.codi,
h.herd_id,
case when /* this column */ dtbaixa is null then 1 else 0 end,
h.lacstatus,
f.lfAbortions,
f.lfliveBorn*1.00 / nullif(h.parts,0),
f.lfStillBorn*1.00 / nullif(h.parts,0),
(f.lfliveBorn+f.lfstillborn+f.lfmummies)*1.00 / nullif(h.parts,0),
/* this column */ lflittersweaned,
f.lfLiveborn,
/* this column */ LFLIVEBORNLITWEANED,
f.lfMummies,
f.lfnetadded,
/* this column */ LfNetFostered,
f.LFPREWEANEDDEATHS,
100.0 - 100.0* /* all of these columns*/
lftotalweaned/nullif(lflivebornlitweaned+lfnetfostered,0),
f.lfServices,
f.lfStillborn,
f.lfliveBorn+f.lfstillborn+f.lfmummies,
h.ubicacio,
h.PMorfo,
h.Name,
h.Registre,
h.DtBaixa,
h.CausaBaixa,
h.TipusBaixa,
h.reproStatus,
h.DtRepro-h.DtNaixement,
h.Pare,
case when /* this column */ peticiorepos='F' then 0 else 1 end,
h.UserFieldA0,
h.UserFieldA1 from herd h
inner join herd_females f on h.herd_id=f.herd_id
where h.htype=0;
Fix up the view and then see whether you can reproduce the problem afterwards.
Helen