Sql Where

72 views
Skip to first unread message

Noam Honig

unread,
Apr 20, 2025, 2:34:24 AMApr 20
to Migrated By Firefly
How many of you are struggeling with the sql where filters that were migrated?
For example:
Where.Add("{0} = ' ' or {0} = {1} .... {2} .... {34})",a,b,c,)


Harry Kleinsmit

unread,
Apr 23, 2025, 5:38:53 AMApr 23
to Migrated By Firefly

Hi Noam,

 

I see it is not too much used in our latest migrated application. Only 12 times in 2500+ programs and 2 of those could have also been migrated as .IsDifferentFrom(). For me this is okay except when the expression becomes to long. It that case it becomes completely unreadable. Example:

Where.Add("{0}={1} AND {2}=1 AND {3}=0 AND {4}=0 AND {5}=0 AND {6}-{7}<>0 AND CASE WHEN {8}<>'' THEN 1 ELSE 0 END={9} AND CASE WHEN {10}<>'' THEN 1 ELSE 0 END={11} AND CASE WHEN {12}<>'' THEN 1 ELSE 0 END={13}", CH1.Bedrijf, Application.g_Bedrijf, CH1.StatusRecord, CH1.Vooruitbetaling, CH1.KredbepAfgetrokkenVV, CH1.BetkortAfgetrokkenVV, CH1.FactBedragVV, CH1.BetaaldVV, CH1.GebruikerAccordering_1, CH1.Geaccordeerd_1, CH1.GebruikerAccordering_2, CH1.Geaccordeerd_2, CH1.GebruikerAccordering_3, CH1.Geaccordeerd_3);

 

Anyway, I have more problems with the (newly added?) u.And() and u.Or() that are used. I would prefer the old notation AND and OR, of course translated in C# as && and ||. Too bad I didn’t notice this before because we were not programming in the migrated versions (only testing). Only after the last migration when it was already too late (too many changes done already).

 

Best regards,

Harry Kleinsmit.


Op zondag 20 april 2025 om 08:34:24 UTC+2 schreef no...@fireflymigration.com:
Reply all
Reply to author
Forward
0 new messages