OpenEdge Static Query Vs Dynamic Query

Posted by rrajan on 29-Jan-2013 07:38

Hi Everyone,

I would like to understand the difference between a static query and a dynamic query. Which one would be the ideal one to use in an applications and what are the advantage in using a specific querying type.



All Replies

Posted by on 29-Jan-2013 08:06

1 difference:

Dynamic queries are re-usable and static queries need to be defined each use.

Posted by gus on 29-Jan-2013 11:26

dynamic queries are constructed "on the fly" at run time thus the same code can produce different queries each time it is executed. The query is compiled when you prepare the query. Access rights to the data are determined when the query is prepared.

static quereis are constructed at compile time (though you can include variables in the expressions in the query's static where clause).

This thread is closed