[Progress Communities] [Progress OpenEdge ABL] Forum Post: RE: Newbie questions about dynamic query preparation in ABL

Status
Not open for further replies.
P

Peter Judge

Guest
Dynamic queries were introduced into the ABL in 1998 (per www.oehive.org/VersionHistory ) . The "dynamic compile of source" approach means that you need a license on the server/host that allows compiles. FWIW the data dictionary still uses passed arguments in places today and so still follows the "compile" approach. I would posit that the "dynamic compile" approach was a workaround to compensate for the lack of dynamic queries. A limit for dynamic queries is the number of buffers allowed in the query (18 I think). I do not believe there are any other limitations for the where clause, other than the query-prepare string being >32k in size (ie the standard ABL 'short'char limit). > How do I introduce arguments to my query predicates? I'm not entirely sure I understand this question. The argument passed to the QUERY-PREPARE() function is a string. But you can build that string from native types. The notable exception is querying on ROWIDs, where you'd have to use a TO-ROWID() function on the string value. > Are there "gotchas" that would prevent the execution plan of QUERY-PREPARE from running the same way as a similar program that is compiled statically? I believe not. The AVM will internally compile the dynamic query in the same fashion it'd compile the same query (or for each) statically. The easiest way to verify that (indexes chosen, blocks read, records returned) would be via the LOG-MANAGER's QUERY-INFO logging with the same WHERE clause(s). > The reason I ask is because I noticed that the Progress product team had omitted some of the new product features/enhancements on this side of things (or at least that the features are delayed) IMO this shouldn't change your expectation that it work the same way. We (PSC) would be explicit and say that things work differently. Hth, -- peter

Continue reading...
 
Status
Not open for further replies.
Top