RE: Bad code (was: Thoughts on Logical Log use requested)
Posted in 2006
Dirk
This might not be that bad coding, if you where looking for speed. If
you change this code to a IN ("Y",..) and NOT IN (51.....) you would
find that this is the fastest way. Maybe someone can explain to me why,
the IN and NOT IN is slower than this sort of coding.
Regards
David Reed
-----Original Message-----
From: informix-list-bounces@iiug.org
[mailto:informix-list-bounces@iiug.org] On Behalf Of Dirk Moolman
Sent: Thursday, March 23, 2006 15:18 PM
To: informix-list@iiug.org
Subject: RE: Bad code (was: Thoughts on Logical Log use requested)
I was looking for info on my system today, and found some very scary
code. A lot of things on our system is hardcoded, and not normalised.
Here is an example:
if var1 = "Y" or g_var2 = "Y" or var3 = "Y" then
if (code != 51 and
code != 275 and
code != 10 and
code != 213 and
code != 3 and
code != 201 and
code != 5 and
code != 207 and
code != 228) then
let l_status = "A"
let p_amount = l_amount
let code = l_code
end if
end if
Just one of many examples ....... :-/ I am sure there are many
other bad stories out there too, though I sometimes wonder if it could
be worse
-----Original Message-----
From: informix-list-bounces@iiug.org
[mailto:informix-list-bounces@iiug.org] On Behalf Of
mweallans@panacea.co.uk
Sent: 15 March 2006 05:42 PM
To: informix-list@iiug.org
Subject: Re: Thoughts on Logical Log use requested
Well I found mine. As usual it is BAD applications developers.
How's this for classic code
SELECT * from tablename INTO TEMP tabtemp1;
SELECT * FROM tabtemp1
WHERE .....
INTO tabtemp2;
SELECT * FROM tablename2 INTO TEMP tabtemp3;
SELECT * FROM tabtemp3
WHERE ....
INTO tabtemp4;
SELECT ... FROM tabtemp2 WHERE join_condition;
>
The information on this e-mail including any attachments relates to the
official business of DigiCare (Pty) Ltd. The information is confidential
and legally privileged and is intended solely for the addressee. Access
to this e-mail by anyone else is unauthorised and as such any
disclosure, copying, distribution or any action taken or omitted in
reliance on it is unlawful. Please notify the sender immediately if it
has inadvertently reached you and do not read, disclose or use the
content in any way.
>
No responsibility whatsoever is accepted by DigiCare (Pty) Ltd if the
information is, for whatever reason, corrupted or does not reach its
intended destination. The views expressed in this e-mail are the views
of the individual sender and should in no way be construed as the views
of DigiCare (Pty) Ltd, except where the sender has specifically stated
them to be the views of DigiCare (Pty) Ltd.
>
_______________________________________________
Informix-list mailing list
Informix-list@iiug.org
http://www.iiug.org/mailman/listinfo/informix-list