This question comes up from time to time and I'm generally extremely uncomfortable documenting it, as SQLAlchemy carefully protects its reputation as being 100% bind-parameter driven and in no way wants to encourage the rendering of data directly into SQL strings. This is the one real area of SQL where security is a concern.
However, I've added a wikipage for this use case which has a level of disclaimer I think will be OK, which you can see at http://www.sqlalchemy.org/trac/wiki/UsageRecipes/BindsAsStrings . On Jan 11, 2011, at 10:14 AM, Harkirat wrote: > Hi All, > When I run this > > delete_stmt = appname.delete(appname.c.appid==1) > print delete_stmt > > I get output > > DELETE FROM appname WHERE appname.appid = ? > > Is there any way I can print out raw sql statments with the parameters > included e.g. > DELETE FROM appname WHERE appname.appid = 1 > > Thanks! > > Harkirat > > -- > You received this message because you are subscribed to the Google Groups > "sqlalchemy" group. > To post to this group, send email to [email protected]. > 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. > -- You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To post to this group, send email to [email protected]. 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.
