Michael Bayer wrote:
>>
>> engine.execute(query)
>
> its more SQLA not warning you about an argument it doesn't like and then
> it leading into problems.  it should raise an error earlier.   basically
> exists() is like a select() and accepts the list of column expressions as
> a list.   if you were to pass your select inside of a [], you'd get a
> valid SQL expression, though with two levels of "select".
> sql.exists([test])  or exists().select_from(test) would be more effective.
>
> ill try to catch that issue now.

more informative message in r6701

>
>
>>
>>
>> I get an error:
>>
>> Traceback (most recent call last):
>>   File "case.py", line 13, in <module>
>>     subquery = sql.exists(test.select().as_scalar())
>>   File
>> "/usr/local/lib/python2.5/site-packages/sqlalchemy/sql/expression.py",
>> line 520, in exists
>>     return _Exists(*args, **kwargs)
>>   File
>> "/usr/local/lib/python2.5/site-packages/sqlalchemy/sql/expression.py",
>> line 2688, in __init__
>>     s = select(*args, **kwargs).as_scalar().self_group()
>>   File
>> "/usr/local/lib/python2.5/site-packages/sqlalchemy/sql/expression.py",
>> line 238, in select
>>     return Select(columns, whereclause=whereclause, from_obj=from_obj,
>> **kwargs)
>>   File
>> "/usr/local/lib/python2.5/site-packages/sqlalchemy/sql/expression.py",
>> line 3492, in __init__
>>     if columns:
>>   File
>> "/usr/local/lib/python2.5/site-packages/sqlalchemy/sql/expression.py",
>> line 1289, in __nonzero__
>>     raise TypeError("Boolean value of this clause is not defined")
>> TypeError: Boolean value of this clause is not defined
>>
>>
>> I'm not sure if my code is correct.
>> If it is not correct, what it the correct method to define that query?
>>
>>
>>
>> Thanks  Manlio
>> -----BEGIN PGP SIGNATURE-----
>> Version: GnuPG v1.4.10 (GNU/Linux)
>> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
>>
>> iEYEARECAAYFAkth7S4ACgkQscQJ24LbaUQEXgCggBUV3orSFAPPK155cVHplpb4
>> 3U0An1djFkgt3LE6LHQOCHrepVt4F0Vc
>> =hL1p
>> -----END PGP SIGNATURE-----
>>
>> --
>> You received this message because you are subscribed to the Google
>> Groups
>> "sqlalchemy" group.
>> To post to this group, send email to [email protected].
>> To unsubscribe from this group, send email to
>> [email protected].
>> For more options, visit this group at
>> http://groups.google.com/group/sqlalchemy?hl=en.
>>
>>
>
> --
> You received this message because you are subscribed to the Google Groups
> "sqlalchemy" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected].
> For more options, visit this group at
> http://groups.google.com/group/sqlalchemy?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en.

Reply via email to