Re: [Zope] multiple selects are not allowed
> > >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 ___ Zope maillist - [EMAIL PROTECTED] 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 )
Re: [Zope] multiple selects are not allowed
Hi, Thank you for your answer. At 15:19 13-12-00 +0100, Dario Lopez-Kästen wrote: >- Original Message - >From: "Jose Soares" <[EMAIL PROTECTED]> >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 ___ Zope maillist - [EMAIL PROTECTED] 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 )
Re: [Zope] multiple selects are not allowed
- Original Message - From: "Jose Soares" <[EMAIL PROTECTED]> 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 [EMAIL PROTECTED] ICQ will yield no hitsIT Systems & Services ___ Zope maillist - [EMAIL PROTECTED] 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 )
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: > > 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 > > > > 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 - [EMAIL PROTECTED] > 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 ) ___ Zope maillist - [EMAIL PROTECTED] 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 )
[Zope] multiple selects are not allowed
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 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 - [EMAIL PROTECTED] 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 )