|| | |||Browse by category|
DBTools.h++ generates a unique table alias each time a SQL select statement is executed.
For example the statement:
select name from customer
gets translated by DBTools.h++ the first time to
select t1.name from customer t1The next time the statement is executed, DBTools.h++ generates the following:
select t2.name from customer t2
and so forth.
Since each SQL statement is unique, Oracle is forced to re-load and re-parse the statement each time, which is very inefficient.
You can work around this problem by using the tag() method on the RWDBTable object. This forces DBTools.h++ to use the user provided alias. For example,
RWDBTable custTable = m_Database.table(CUSTOMER).tag(CUST)
causes DBTools.h++ to generate
select CUST.name from customer CUST
Using the tag() method as well as RWDBBoundExpr should force DBToolsh++ to generate SQL that Oracle can re-use.