RWDBTracer and asString() method behave differently in DBTools 4.0.0

Article ID: 834
Last updated: 31 Jan, 2008
Article ID: 834
Last updated: 31 Jan, 2008
Revision: 1
Views: 2668
Posted: 21 Jan, 2000
by Dean J.
Updated: 31 Jan, 2008
by Dean J.
Problem


Running the following DBTools code produces different results with the 4.0.0 version

RWDBSelector sel = aDB.selector();
sel << rwdbCount();
sel.where(aDB.table(customer)[ID] > 3);
cout << sel.asString() << endl;

DBTools version 3.2.1
SELECT COUNT(*) FROM customer t0 WHERE t0.ID > 3

DBTools version 4.0.0
SELECT COUNT(*) FROM customer t0 WHERE t0.ID > :ph0



Cause





Action


Version 4.0.0 of DBTools now uses bound expressions in all of the SQL statements it generates in order to speed up database access. The RWDBTracer class and asString() methods show the exact commands that have been sent to the database. This means the actual values of the bound expressions are not displayed using these methods.

DBTools version 4.10  and above versions provide an additonal feature for RWDBTracer to view the values passed into the placeholders.
Here is sample code

    RWDBTracer& aTracer = db.tracer();
    aTracer.setOn(RWDBTracer::SQL);
 aTracer.setOn(RWDBTracer::BoundBuffers);
    aTracer.stream(cout);

 

This article was:   Helpful | Not helpful
Report an issue
Article ID: 834
Last updated: 31 Jan, 2008
Revision: 1
Views: 2668
Posted: 21 Jan, 2000 by Dean J.
Updated: 31 Jan, 2008 by Dean J.

Others in this category