See SQL instead of execute

Posts   
 
    
Anderskj1
User
Posts: 33
Joined: 11-Jan-2005
# Posted on: 23-Jan-2005 14:05:58   

Hi

Is it possible somehow to see the sql wich is generated instead of actually running it? It would be nice with eg. (SelfServiceing)

string sql = col.DeleteMulti(x,x,x).GetSql();

Is it placed somewhere deep in the API and i just havent found it? Its a little cumbersome to use the sql tracer to see the SQL.

If your current model can“t pass the sql text bask to EntityCollection then what about writting the sql query to the consol? Eg with a global flag like PrintInsteadOfExcuteQuery = true maybe on DBUtils or something like that.

erichar11
User
Posts: 268
Joined: 08-Dec-2003
# Posted on: 23-Jan-2005 23:12:16   

In the third party section there is a template that allows you to see the sql that's generated, DataAccessAdapter SQL Logger or something like that. It's for adapter, but you might be able to modify it for self servicing. Check it out, it's really helpful.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39927
Joined: 17-Aug-2003
# Posted on: 24-Jan-2005 10:28:31   

Selfservicing's sql generation takes place in the DAO classes, or better: the calls to the query generation. You therefore have to step into the code and when you see a line like IRetrievalQuery selectQuery = ... you have to step over that line and you can examine the query by examining the Command.CommandText property of selectQuery.

Adapter's sql logging can't be reworked for selfservicing, sorry Eric simple_smile

Frans Bouma | Lead developer LLBLGen Pro
jtgooding
User
Posts: 126
Joined: 26-Apr-2004
# Posted on: 24-Jan-2005 16:41:50   

I made a version at one time that works with Self Servicing but I did not release it as it requires you to modify the core support classes.

I tend not to make public the stuff that I do to the core libraries as it raises all of the support, and future version compatiibility issues. Versus the stuff I've made public like my SQL Adapter logger and basic Adapter user defined function execution which can be done through the templates.

I can point you at the places I hooked into the core libraries if you want to make your own Self Servicing logger, but like I said with each release you have to rebuild the core libraries to include the new code.

John