Re: [Zope] run raw sql

2010-07-27 Thread Andreas Jung
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Andreas Jung wrote:
> Garry Saddington wrote:
>> Is there any way to run raw sql statements from within a python script?
>> Any help at all much appreciated.
> 
> Free out of my head:
> 
> - write a ZSQL method "genericSQL.sql" containing something like
>   
> 
> - call the method from Python using acquisition:
> 
>   context.genericSQL(query='drop table ')
> 
> The risk regarding SQL injection etc. is at you.

In addition: most database adapters from a generic method
(usually query()?) that could be used...you might check the
code of the database adapter you are using.

- -aj
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.10 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkxPC/0ACgkQCJIWIbr9KYzB6wCgjGoKlN0mOfyS9uxkzy2158Uz
uGYAn2a/J7W405pFIS8feP/0oQCkM5WK
=ytKn
-END PGP SIGNATURE-
<>___
Zope maillist  -  Zope@zope.org
https://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 https://mail.zope.org/mailman/listinfo/zope-announce
 https://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] run raw sql

2010-07-27 Thread Andreas Jung
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Garry Saddington wrote:
> Is there any way to run raw sql statements from within a python script?
> Any help at all much appreciated.

Free out of my head:

- - write a ZSQL method "genericSQL.sql" containing something like
  

- - call the method from Python using acquisition:

  context.genericSQL(query='drop table ')

The risk regarding SQL injection etc. is at you.

- -aj
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.10 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkxPC34ACgkQCJIWIbr9KYwu7gCfWThum4zjekhRnGJCg1T32OmS
eTQAn1BY/kPulI8mGP0+s/7gGZl/MshR
=nFgz
-END PGP SIGNATURE-
<>___
Zope maillist  -  Zope@zope.org
https://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 https://mail.zope.org/mailman/listinfo/zope-announce
 https://mail.zope.org/mailman/listinfo/zope-dev )