db-torque-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ivano Luberti <lube...@archicoop.it>
Subject Re: get the SQL to be executed
Date Thu, 19 Jan 2012 17:38:24 GMT
Thanks all for your responses.
Just to clarify, I need to generate sql commands inside my code to
generate a file that can be used by another software (not written by me)
to import data.

I would like not to execute commands but only write them (because this
is what I need).
If I cannot find alternatives, I can execute them and use one of the
logging facilities that have been suggested.

Il 19/01/2012 16:05, Greg Monroe ha scritto:
> 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.carter@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.Fox@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-unsubscribe@db.apache.org
>> For additional commands, e-mail: torque-user-help@db.apache.org
>>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
> For additional commands, e-mail: torque-user-help@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-unsubscribe@db.apache.org
> For additional commands, e-mail: torque-user-help@db.apache.org
>
>

-- 
==================================================
dott. Ivano Mario Luberti
Archimede Informatica societa' cooperativa a r. l.
Sede Operativa
Via Gereschi 36 - 56126- Pisa
tel.: +39-050- 580959
tel/fax: +39-050-9711344
web: www.archicoop.it
==================================================


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


Mime
View raw message