Hi, I want to execute multiple SQL statements in one SQL-Method. In the mailinglist archives i found the answer but when i try it i get an error: Error, exceptions.ValueError: multiple selects are not allowed I used a simple Z SQL Method query (Zope 2.2.2) just to try: select * from GENEESM_DIER <dtml-var sql_delimiter> select * from TOED_WIJZE What am i doing wrong? Diny DIVA, Faculty of Veterinary Medicine Utrecht University, The Netherlands http://www.vet.uu.nl
from ZSQL Methods User's Guide, last row on pag. 22: "Note that no more than one SQL select statement may be used in a single SQL Database Method." Diny van Gool wrote:
Hi,
I want to execute multiple SQL statements in one SQL-Method. In the mailinglist archives i found the answer but when i try it i get an error:
Error, exceptions.ValueError: multiple selects are not allowed
I used a simple Z SQL Method query (Zope 2.2.2) just to try:
select * from GENEESM_DIER
<dtml-var sql_delimiter>
select * from TOED_WIJZE
What am i doing wrong?
Diny
DIVA, Faculty of Veterinary Medicine Utrecht University, The Netherlands http://www.vet.uu.nl
_______________________________________________ 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 )
----- Original Message ----- From: "Jose Soares" <jose@sferacarta.com> Subject: Re: [Zope] multiple selects are not allowed
from ZSQL Methods User's Guide, last row on pag. 22:
"Note that no more than one SQL select statement may be used in a single SQL Database Method."
Diny van Gool wrote:
Hi,
I want to execute multiple SQL statements in one SQL-Method. In the mailinglist archives i found the answer but when i try it i get an error:
Diny, why do you need to execute multiple selects in one SQL-Method? Maybe there is another way of doing it? /dario - -------------------------------------------------------------------- Dario Lopez-Kästen Systems Developer Chalmers Univ. of Technology dario@ita.chalmers.se ICQ will yield no hits IT Systems & Services
Hi, Thank you for your answer. At 15:19 13-12-00 +0100, Dario Lopez-Kästen wrote:
----- Original Message ----- From: "Jose Soares" <jose@sferacarta.com> Subject: Re: [Zope] multiple selects are not allowed
from ZSQL Methods User's Guide, last row on pag. 22: "Note that no more than one SQL select statement may be used in a single SQL Database Method."
Diny, why do you need to execute multiple selects in one SQL-Method?
Belief me, you don't want to know ;) I'm building a database application for the drugstore department. Veterinarians can find medicines by searching on animal, ingredients, diseases etc. When they've found one medicine all the detailed information about this particular medicine is being displayed. At this point i thought i could use the multiple selects. The medicine has a 1 to many relationship with animals, ingredients, diseases etc. all stored in different tables. When i use one single select statement with several where conditions, and one relationship isn't filled, the query returns nothing at all.
Maybe there is another way of doing it?
I'll split up one complex ZSQL method into several simple methods. Regards, Diny DIVA, Faculty of Veterinary Medicine Utrecht University, The Netherlands http://www.vet.uu.nl
Diny, why do you need to execute multiple selects in one SQL-Method?
Belief me, you don't want to know ;)
I'm building a database application for the drugstore department. Veterinarians can find medicines by searching on animal, ingredients, diseases etc. When they've found one medicine all the detailed information about this particular medicine is being displayed. At this point i thought i could use the multiple selects. The medicine has a 1 to many relationship with animals, ingredients, diseases etc. all stored in different tables. When i use one single select statement with several where conditions, and one relationship isn't filled, the query returns nothing at all.
Maybe there is another way of doing it?
I'll split up one complex ZSQL method into several simple methods.
Without seeing your queries, I would say use sql's UNION command, eg, SELECT name FROM animals WHERE id =21 UNION SELECT name FROM diseases WHERE id =21; regards, Ivan
participants (4)
-
Dario Lopez-K�sten -
Diny van Gool -
Ivan Cornell -
Jose Soares