Dynamic Query Question

jdpjamesp

ProgressTalk.com Moderator
Staff member
This is making me feel rather dense because I can't work it out!
A simple query against sports2000.
Code:
FOR EACH s2k.Customer NO-LOCK , EACH  s2k.Order NO-LOCK WHERE s2k.Order.CustNum EQ s2k.Customer.CustNum

As a static query that reads:
Table Name read
Order 3954
Customer 1118

But when run dynamically reads are
Table Name read
Order 7906
Customer 5070

Code:
CREATE QUERY QueryHandle. 
Tables = fn-GetTables(QueryString).
DO i = 1 TO NUM-ENTRIES(Tables):
  QueryHandle:ADD-BUFFER(ENTRY(i,Tables)).
END. 
QueryHandle:QUERY-PREPARE(QueryString).
QueryHandle:QUERY-OPEN().


i = 0. 
DO WHILE QueryHandle:GET-NEXT():
  i = i + 1.
END. 

IF VALID-HANDLE(QueryHandle) THEN 
  DELETE OBJECT QueryHandle.

Progress 11.5.1.

What is my tired brain missing?!
 
I can't get it to behave differently... message QueryString and make sure it is actually doing the same thing.
 
---------------------------
Message (Press HELP to view stack trace)
---------------------------
FOR EACH s2k.Customer NO-LOCK , EACH s2k.Order NO-LOCK WHERE s2k.Order.CustNum EQ s2k.Customer.CustNum
---------------------------
OK Help
---------------------------
 
---------------------------
Message (Press HELP to view stack trace)
---------------------------
-pf C:\Progress\OpenEdge\startup.pf,-cpinternal ISO8859-1,-cpstream ISO8859-1,-cpcoll Basic,-cpcase Basic,-d dmy,-numsep 44,-numdec 46,-debugalert,-Mm 8192,(end .pf),-s 200,-mmax 65534,-T C:\OpenEdge\WRK,-db s2k.db,-H localhost,-S 1001,-debugalert,-rereadnolock,-h 10,-inp 16000,-tok 4000,-nosplash,-p C:\Progress\OpenEdge\oeide\eclipse\plugins\com.openedge.pdt.debug.core_11.5.1.00\abl\_debuglauncher.p
---------------------------
OK Help
---------------------------
Will it be the -rereadnolock setting? Not 100% sure where that's coming from. Hmmm.
 
That somewhat explains it... Now I am curious enough to look into why the -rereadnolock impacted the dynamic query but not the static query...

Or was it two different sessions?
 
And unless you want complete insanity to take over, put the -rereadnolock back in pronto!
 
And you only connect with one single session? As soon as you have multiple fat client sessions or multiple AppServer / WebSpeed agents working for you madness will creep in.
 
Just a single session - it's sports2000 - I'm using it for preparation for my talk at the PUG - profiling queries.
 
Back
Top