• Welcome to the upgraded JDELIST forum and thank you for your patience.
    Please restrict discussions and issues regarding the new forum software to the Off Topic forum. We will be monitoring that forum for issues.
    If you have trouble logging in, please reset your password using the forgotten password form: https://www.jdelist.com/community/index.php?lost-password/
    If you are unable to successfully reset your password, please contact us: Click here!
    We hope that you enjoy the upgraded forum.
  • Introducing Dark Mode! Switch by clicking on the lightbulb icon next to Search or by clicking on Default style at the bottom left of the page!

Multiple where clause SDNXTR

Any ideas why an E1 online user process would generate this :
SELECT SDAN8,SDLOCN,SDUOM,SDLITM,SDDOCO,SDKCOO,SDDCTO,SDPDDJ,SDLOTN,SDSOQS,SDMCU,SDFRTH,SDITM,SDSHAN,SDTRDJ,SDLTTR,SDPPDJ,SDLNTY,SDRSDJ,SDNXTR,SDSWMS,SDSFXO,SDSONE,SDSHPN,SDDSC1,SDLNID,SDDSC2,SDCORD,SDCARS,SDAITM,SDDRQJ,SDOPDJ,SDCO,SDEMCU,SDCRCD,SDBCRC FROM PRODDTA.F4211

WHERE (((SDSHPN = :1 AND
SDNXTR <= :2 AND SDNXTR <= :3 AND SDNXTR <= :4 AND SDNXTR <= :5 AND SDNXTR <= :6 AND SDNXTR <= :7 AND SDNXTR <= :8 AND SDNXTR <= :9 AND SDNXTR <= :10 AND SDNXTR <= :11 AND SDNXTR <= :12 AND SDNXTR <= :13 AND SDNXTR <= :14 AND SDNXTR <= :15 AND SDNXTR <= :16 AND SDNXTR <= :17 AND SDNXTR <= :18 AND SDNXTR <= :19 AND SDNXTR <= :20 AND SDNXTR <= :21 AND SDNXTR <= :22 AND SDNXTR <= :23 AND SDNXTR <= :24 AND SDNXTR <= :25 AND SDNXTR <= :26 AND SDNXTR <= :27 AND SDNXTR <= :28 AND SDNXTR <= :29 AND SDNXTR <= :30 AND SDNXTR <= :31 AND SDNXTR <= :32 AND SDNXTR <= :33 AND SDNXTR <= :34 AND SDNXTR <= :35 AND SDNXTR <= :36 AND SDNXTR <= :37 AND SDNXTR <= :38 AND SDNXTR <= :39 AND SDNXTR <= :40 AND SDNXTR <= :41 AND SDNXTR <= :42 AND SDNXTR <= :43 AND SDNXTR <= :44 AND SDNXTR <= :45 AND SDNXTR <= :46 AND SDNXTR <= :47 AND SDNXTR <= :48 AND SDNXTR <= :49 AND SDNXTR <= :50 AND SDNXTR <= :51 AND SDNXTR <= :52 AND SDNXTR <= :53 AND SDNXTR <= :54 AND SDNXTR <= :55 AND SDNXTR <= :56 AND SDNXTR <= :57 AND SDNXTR <= :58 AND SDNXTR <= :59 AND SDNXTR <= :60 AND SDNXTR <= :61 AND SDNXTR <= :62 AND SDNXTR <= :63 AND SDNXTR <= :64 AND SDNXTR <= :65 AND SDNXTR <= :66 AND SDNXTR <= :67 AND SDNXTR <= :68 AND SDNXTR <= :69 AND SDNXTR <= :70 AND SDNXTR <= :71 AND SDNXTR <= :72 AND SDNXTR <= :73 AND SDNXTR <= :74 AND SDNXTR <= :75 AND SDNXTR <= :76 AND SDNXTR <= :77 AND SDNXTR <= :78 AND SDNXTR <= :79 AND SDNXTR <= :80 AND SDNXTR <= :81
AND SDNXTR <= :82 AND SDNXTR <= :83 AND SDNXTR <= :84 AND SDNXTR <= :85 AND SDNXTR <= :86 AND SDNXTR <= :87 AND SDNXTR <= :88 AND SDNXTR <= :89 AND SDNXTR <= :90 AND SDNXTR <= :91 AND SDNXTR <= :92
AND SDNXTR <= :93 AND SDNXTR <= :94 AND SDNXTR <= :95 AND SDNXTR <= :96 AND SDNXTR <= :97 AND SDNXTR <= :98 AND SDNXTR <= :99 AND SDNXTR <= :100 AND SDNXTR <= :101
AND SDNXTR <= :102 AND SDNXTR <= :103 AND SDNXTR <= :104 AND SDNXTR <= :105 AND SDNXTR <= :106 AND SDNXTR <= :107 AND SDNXTR <= :108
AND SDNXTR <= :109 AND SDNXTR <= :110 AND SDNXTR <= :111 AND SDNXTR <= :112 AND SDNXTR <= :113 AND SDNXTR <= :114 AND SDNXTR <= :115
AND SDNXTR <= :116 AND SDNXTR <= :117 AND SDNXTR <= :118 AND SDNXTR <= :119 AND SDNXTR <= :120 AND SDNXTR <= :121 AND SDNXTR <= :122
AND SDNXTR <= :123 AND SDNXTR <= :124 AND SDNXTR <= :125 AND SDNXTR <= :126 AND SDNXTR <= :127 AND SDNXTR <= :128 ) AND (SDMCU = :129 OR SDMCU BETWEEN :130 AND :131 OR SDMCU = :132 OR SDMCU = :133 OR SDMCU = :134 OR SDMCU = :135 )) AND (SDCO = :136 OR SDCO = :137 OR SDCO = :138 OR SDCO = :139 )) ORDER BY SDDOCO ASC , SDDCTO ASC , SDKCOO ASC , SDLNID ASC
 
Banta1234,

Assuming that you are using E9.1 or greater, the user may be using the user query facility (top right corner of the screen on the same row as the form heading/name to the left of the "i" button). If it were anything else (for e.g. custom code) I would expect that you would be aware of it.
 
Thanks, not been able to pick it up when its active, to check, but the list of where clauses just keeps on growing with each execution (its up to 574 at the last count)

SELECT SDAN8,SDLOCN,SDUOM,SDLITM,SDDOCO,SDKCOO,SDDCTO,SDPDDJ,SDLOTN,SDSOQS,SDMCU,SDFRTH,SDITM,SDSHAN,SDTRDJ,SDLTTR,SDPPDJ,SDLNTY,SDRSDJ,SDNXTR,SDSWMS,SDSFXO,SDSONE,SDSHPN,SDDSC1,SDLNID,SDDSC2,SDCORD,SDCARS,SDAITM,SDDRQJ,SDOPDJ,SDCO,SDEMCU,SDCRCD,SDBCRC FROM PRODDTA.F4211 WHERE (((SDNXTR = :1 AND SDSHAN = :2 AND SDNXTR <= :3 AND SDNXTR <= :4 AND SDNXTR <= :5 AND SDNXTR <= :6 AND SDNXTR <= :7 AND SDNXTR <= :8 AND SDNXTR <= :9 AND
....
....
AND SDNXTR <= :573 AND SDNXTR <= :574 ) AND (SDMCU = :575 OR SDMCU = :576 OR SDMCU BETWEEN :577 AND :578 OR SDMCU = :579 OR SDMCU = :580 )) AND (SDCO = :581 OR SDCO = :582 OR SDCO = :583 OR SDCO = :584 )) ORDER BY SDDOCO ASC , SDDCTO ASC , SDKCOO ASC , SDLNID ASC
 
The issue is with the Find button in P42040 .

It is appending the data selection using the following system function

Button Clicked
00015 | | Set Selection(FC Grid, F4211, "NXTR", <Greater Than or Equal To>, FC LTT2-Status From (wf), <And>)
00016 | | Set Selection(FC Grid, F4211, "NXTR", <Less Than or Equal To>, FC NXT2-StatusThru (wf), <None>)

without clearing the selection first.
 
The issue has been solved by clearing selection when a user clicks the Find Button.

The fact the button uses system Append Data Selection was the issue. It kept appending the 2 lines above to the select each time.
00029 | // Append where clause for record fetching from F4211
00030 | Set Selection Append Flag(FC Grid, <Yes>)

00043 | // Append where clause for record fetching from F4211
00044 | Set Selection Append Flag(FC Grid, <Yes>)

This must be on other peoples systems too and things like Watch Lists must be driving this query higher faster.
Our issue was a user in this screen all day clicking Find repeatedly
 
Last edited:
Top