On Dec 31, 2007, at 12:45 PM, Alexandre da Silva wrote:

>
> Is there any way to execute a database query without a mapper or  
> class?
> it would be useful to perform arbitrary inserts on database.
>

http://www.sqlalchemy.org/docs/04/sqlexpression.html

if you mean that youd like to execute using the "Session" itself, use  
the execute() method on Session and  you probably want to bind your  
Session to the engine directly:

http://www.sqlalchemy.org/docs/04/session.html#unitofwork_sql


> and another question, is there any way to execute a sql file from
> sqlalchemy session, the reason is the same as above, make arbitrary
> inserts and/or updates on database.

like a flat SQL file ?  just read the file and execute each  
line....for line in file('myfile.txt'):  engine.execute(line)



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to sqlalchemy@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to