[Zope] ZSql Strange Error

Casey Duncan casey.duncan@state.co.us
Thu, 2 Nov 2000 13:03:53 -0700


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 missing>><dtml-var
nome></option>
</dtml-in>
</select>

Let me know if this is any better,

Casey D.

-----Original Message-----
From: cesar@rotnet.com.br [mailto:cesar@rotnet.com.br]
Sent: Thursday, November 02, 2000 12:08 PM
To: casey.duncan@state.co.us
Cc: zope@zope.org
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/