RE: [Zope] ZSql Strange Error
Cesar A. K. Grossmann wrote: Hi! I'm trying to emulate an outter join in a Z SQL, but Zope crashes every time I try the query. ... What is wrong? What I can do to get the job done (I need to fill an multiselect with 'codigo', 'nome' from 'cad_exportacao', and if exists any 'codigo' for 'username' in 'user_codigo', the option must be selected - I tryed the "Filling MULTIPLE SELECT ... HOWTO', but it doesn't works for me, and I don't know why)? I'm not sure why this should *crash* zope, but you can do it with a much simpler query and a little DTML coding. The following should work (UNTESTED): Z SQL Method (named sql_query): select codigo, nome, tipo from cad_exportacao; DTML Method: select dtml-in sql_query option value="dtml-codigo;" dtml-if "tipo=='E'"Selected/dtml-if dtml-var nome/option /dtml-in /select hth, Casey D. ___ 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] ZSql Strange Error
I'm not sure why this should *crash* zope, but you can do it with a much simpler query and a little DTML coding. The following should work (UNTESTED): It cannot help me. I have two tables. One called cad_exportacao, and the other is called user_codigo. The table user_codigo maps every username with one or more rows at cad_exportacao. I wanna fill a SELECT input with all rows in cad_exportacao, but wanna all the records that exists for 'username' in user_codigo to be selected. There was the howto that explains how to do this at http://www.zope.org/Members/Roug/select_with_multiple, but it not works for me... []s -- César A. K. Grossmann http://members.xoom.com/ckant/ ___ 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] ZSql Strange Error
Duh, maybe I should learn to read. Maybe try this sql: select codigo, nome, case when codigo in select codigo from user_codigo where username = dtml-sqlvar username type=string and tipo = 'E' ) then 'selected' else null end as select_attr from cad_exportacao; Then your dtml method: select dtml-in sql_method option value="dtml-codigo" dtml-var select_attr missingdtml-var nome/option /dtml-in /select Let me know if this is any better, Casey D. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Thursday, November 02, 2000 12:08 PM To: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Subject: Re: [Zope] ZSql Strange Error I'm not sure why this should *crash* zope, but you can do it with a much simpler query and a little DTML coding. The following should work (UNTESTED): It cannot help me. I have two tables. One called cad_exportacao, and the other is called user_codigo. The table user_codigo maps every username with one or more rows at cad_exportacao. I wanna fill a SELECT input with all rows in cad_exportacao, but wanna all the records that exists for 'username' in user_codigo to be selected. There was the howto that explains how to do this at http://www.zope.org/Members/Roug/select_with_multiple, but it not works for me... []s -- César A. K. Grossmann http://members.xoom.com/ckant/ ___ 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] ZSql Strange Error
Casey Duncan wrote: Duh, maybe I should learn to read. :-) Let me know if this is any better, It worked! Thanks. []s -- César A. K. Grossmann http://members.xoom.com/ckant/ ___ 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 )