If you are trying to generate an initial data scripts rather
than a "audit log", you might look at the dumpdata and datasql
tasks that Torque supplies.  I have used these to create 
initial data sets that applications need (e.g. initial user
entry, rights entry, etc.)

If you need to do this inside the code, you might look at
the apache ddlutils project db.apache.com/ddlutils.  This has
some code callable functions to generate various SQL scripts.

If you don't need SQL, but are really looking for a way to 
export/import data between Torque applications, look at
sf.net/projects/torque-addons.  This has a framework for 
easily creating XML exports of records.  You may need to
write some record handler code to deal with foreign keys.

Greg 

-----Original Message-----
From: Joe Carter [mailto:joe.car...@gmail.com] 
Sent: Thursday, January 19, 2012 3:32 AM
To: Apache Torque Users List
Subject: Re: get the SQL to be executed

You can use a logging driver such as p6spy to see your SQL statements.
http://sourceforge.net/projects/p6spy/

On 19 January 2012 08:25, Thomas Fox <thomas....@seitenbau.net> wrote:
> Perhaps you can use the log output (with some tweaks to the log4j
> configuration). However I'm not sure how and if Torque 3.3 logs the update
> statements. But then again I've heard of drivers which at as a bridge
> between the application and the real driver (e.g
> http://www.squirrelsql.org/) and which can do the logging for you.
>
> Torque 4 will not work because it uses prepared statements for updates,
> this will not give you any sensible sql.
>
>    Thomas
>
>> Hello all, is there a way in Torque to get the SQL that is sent to the
> DB.
>> I have to generate a txt file where I save queries basically INSERT
>> statements of long records.
>> I was thinking of create the Torque classes, populate the objects with
>> data that I get from a local instance of the DB and then, instead of
>> using a save command, get the SQL that would be executed and store it in
>> a file.
>>
>> Alternatively I could use this:
>>
>> http://openhms.sourceforge.net/sqlbuilder/
>>
>> but has dependencies that requires GPL license and I would avoid in this
>> case that kind of license.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: torque-user-unsubscr...@db.apache.org
> For additional commands, e-mail: torque-user-h...@db.apache.org
>

---------------------------------------------------------------------
To unsubscribe, e-mail: torque-user-unsubscr...@db.apache.org
For additional commands, e-mail: torque-user-h...@db.apache.org

DukeCE Privacy Statement:
Please be advised that this e-mail and any files transmitted with
it are confidential communication or may otherwise be privileged or
confidential and are intended solely for the individual or entity
to whom they are addressed. If you are not the intended recipient
you may not rely on the contents of this email or any attachments,
and we ask that you please not read, copy or retransmit this
communication, but reply to the sender and destroy the email, its
contents, and all copies thereof immediately. Any unauthorized
dissemination, distribution or copying of this communication is
strictly prohibited.

---------------------------------------------------------------------
To unsubscribe, e-mail: torque-user-unsubscr...@db.apache.org
For additional commands, e-mail: torque-user-h...@db.apache.org

Reply via email to