Oleg Broytmann <[EMAIL PROTECTED]> writes: > On Tue, Apr 24, 2007 at 01:01:18AM -0300, Jorge Godoy wrote: >> # INSubquery comes from sqlbuilder >> if amostras_ids: >> resultados = model.VAuditoriaResultado.select(INSubquery( >> model.VAuditoriaResultado.q.amostraID, amostras_ids)) > > INSubquery() is intended to be used internally for subqueries: > > INSubquery(model.VAuditoriaResultado.q.amostraID, Select(["id"], "table", > ...)) > > Try to use IN(): > > resultados = model.VAuditoriaResultado.select(IN( > model.VAuditoriaResultado.q.amostraID, amostras_ids)) > > When I have said "intended to be used internally" I meant IN() is clever > enough to distinguish this from > > IN(model.VAuditoriaResultado.q.amostraID, Select(["id"], "table", ...)) > > IN() in this case is automatically replaced by INSubquery(), you don't > need to call it manually.
I was looking for IN indeed... But I couldn't "see" it in the docs... I remembered seeing something like that but when I didn't see IN and saw INSubquery I thought I was mistaken. Using "IN" directly solved the problem. As I've just answered at the other post, I was looking at sqlbuilder and not directly at SQL Object (maybe I was trying to do things the hard way ;-)). Thanks again! -- Jorge Godoy <[EMAIL PROTECTED]> ------------------------------------------------------------------------- This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ _______________________________________________ sqlobject-discuss mailing list sqlobject-discuss@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/sqlobject-discuss