[Zope] can't use a cast operator in a sql query

Oleg Broytmann phd@phd.russ.ru
Tue, 28 Mar 2000 11:33:15 +0000 (GMT)


On Tue, 28 Mar 2000, Graham Chiu wrote:
> select myfield from foo
> 
> works as expected.
> 
> But
> 
> select cast(my_varchar_field as char(140)) from foo
> 
> gives an error with the following traceback...

> ValueError: Empty column name, 

   Give a name to the computed column:
select cast(my_varchar_field as char(140)) as mvf from foo

Oleg.
---- 
    Oleg Broytmann      Foundation for Effective Policies      phd@phd.russ.ru
           Programmers don't die, they just GOSUB without RETURN.