Re: [Tutor] SQL headache with column

2005-07-20 Thread Cedric BRINER
did you heard about sqlobject ? give a try...http://www.sqlobject.org/ Ced. -- Cedric BRINER ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] SQL headache with column

2005-07-19 Thread Bernard Lebel
Stupid me, you're right. Thanks Danny Bernard On 7/19/05, Danny Yoo <[EMAIL PROTECTED]> wrote: > > > On Tue, 19 Jul 2005, Bernard Lebel wrote: > > > Ah yeah I to mention that I indeed tried fetchall(), but Python would > > raise an attribute error: > > Hi Bernard, > > The cursor itself

Re: [Tutor] SQL headache with column

2005-07-19 Thread Danny Yoo
On Tue, 19 Jul 2005, Bernard Lebel wrote: > Ah yeah I to mention that I indeed tried fetchall(), but Python would > raise an attribute error: Hi Bernard, The cursor itself holds some internal state that mutates when we call cursor.execute(). So we use cursor.execute() often for it's side-effe

Re: [Tutor] SQL headache with column

2005-07-19 Thread Bernard Lebel
Ah yeah I to mention that I indeed tried fetchall(), but Python would raise an attribute error: def getTableColumns( sTableName ): """ Lists and returns the list of columns from a given table. """ oConnection = connect2db() oCursor = oConnection.cursor()

Re: [Tutor] SQL headache with column

2005-07-19 Thread Danny Yoo
> oResult = oCursor.execute( "SHOW COLUMNS FROM " + sTableName + "" ) Hi Bernard, Try using oCursor.fetchall() after the execution. The return value of execute() are the number of rows affected, and you can then pull each fetched value by using either oCursor.fetchone() or oCursor.fetchall