[SQLObject] select from multiple tables
SQLObject is a Python ORM.
Brought to you by:
ianbicking,
phd
From: Ivan H. <i.h...@al...> - 2006-09-08 14:01:39
|
Dear sqlobject, i would like to select fields from more tables here is the code, what i have: fields =3D [VssHistory.q.username, VssObjects.q.type,= VssObjects.q.objFile, VssHistory.q.datetime, VssHistory.q.comment] where =3D sqlbuilder.AND(VssHistory.q.username =3D=3D= self.cUserName, VssObjects.q.id =3D=3D VssHistory.q.objectsID) orderby =3D [VssHistory.q.datetime, VssObjects.q.type] sql =3D conn.sqlrepr(sqlbuilder.Select(fields, where,= orderBy=3Dorderby)) it creates this sql command: SELECT history.username, objects.type, objects.obj_file, history.datetime,= history.comment FROM objects, history WHERE (((history.username) =3D= ('Ivan')) AND ((objects.id) =3D (history.objects_id))) ORDER BY= (history.datetime, objects.type) when i execute with res =3D conn.queryAll(sql) i receive OperationalError: (1241, 'Operand should contain 1 column(s)') error please help me what is wrong? Best regards, Ivan Horvath Chief Programmer Alcatel ISD PMS 2000 Product Team H-1116, Budapest Kondorfa u. 10. Tel.: +36 1 209 9546 Fax.: +36 1 209 9599 Mobil: +36 30 257 0235 VOIP: +49 511 676 478010 i.h...@al... Anyone who has never made a mistake has never tried anything new. /Albert Einstein/ |