Hello, I have to port a complex database application which has no fix SQL statements. The user builds the statement while interacting with some menus and after having done some selections a database query is builded depending from several options. Any hint how this can be performed using Zope? Kind regards Andreas.
Hi, Zope DAs have a "manage_test" method. The docstring says : results = someDA.manage_test(query, REQUEST=None) Executes the SQL in parameter query and returns results Note you must set the proxy to "manager" to a python script or DTML that executes this method. HTH --Gilles ----- Original Message ----- From: "Tille, Andreas" <TilleA@rki.de> To: "Zope user list" <zope@zope.org> Sent: Monday, May 13, 2002 1:40 PM Subject: [Zope] Building SQL statements dynamically : Hello, : : I have to port a complex database application which has no fix SQL : statements. The user builds the statement while interacting with : some menus and after having done some selections a database query : is builded depending from several options. : : Any hint how this can be performed using Zope? : : Kind regards : : Andreas. : : : _______________________________________________ : Zope maillist - Zope@zope.org : http://lists.zope.org/mailman/listinfo/zope : ** No cross posts or HTML encoding! ** : (Related lists - : http://lists.zope.org/mailman/listinfo/zope-announce : http://lists.zope.org/mailman/listinfo/zope-dev ) :
[Tille, Andreas]
I have to port a complex database application which has no fix SQL statements. The user builds the statement while interacting with some menus and after having done some selections a database query is builded depending from several options.
Any hint how this can be performed using Zope?
Building the query string may be hard, but it has nothing to do with Zope specifically. Once the query string has been constructed, you could execute it using a ZSQL method by putting something as simple as &dtml-querystring; into the zsql method, where "querystring" is the name of the variable that holds the query. This could be somewhat dangerous, though, and you really need to work out some safeguards to protect against unfriendly query strings that could damage the database. Cheers, Tom P
On Mon, 2002-05-13 at 06:40, Tille, Andreas wrote:
Hello,
I have to port a complex database application which has no fix SQL statements. The user builds the statement while interacting with some menus and after having done some selections a database query is builded depending from several options.
Any hint how this can be performed using Zope?
If the dynamic queries are used to select data from the database you may want to take a look at the <dtml-sqlgroup> tag. You can create dynamic queries with optional\required arguments based on user input. http://www.zope.org/Documentation/Guides/ZSQL-HTML/ZSQL.1.5.4.html Jon
On Monday, May 13, 2002, at 09:40 PM, Tille, Andreas wrote:
Hello,
I have to port a complex database application which has no fix SQL statements. The user builds the statement while interacting with some menus and after having done some selections a database query is builded depending from several options.
Any hint how this can be performed using Zope?
ZSQL methods allow you to build complex SQL easily. You can even build the entire SQL from Python or an external program and pass it to the ZSQL method for execution. -- Stuart Bishop <zen@shangri-la.dropbear.id.au> http://shangri-la.dropbear.id.au/
participants (5)
-
Gilles Lenfant -
Jon Erickson -
Stuart Bishop -
Thomas B. Passin -
Tille, Andreas