combining commands:

Brian Lee senux at senux.com.NOSPAM
Tue May 29 02:07:34 EDT 2001


kasper37 at caffeinedreams.com wrote:
> 
> is there any way to combine these three commands into 1 line?
> 
> c.execute( "SELECT COUNT(*) from CONCENTRIC" )
> temp = c.fetchone()
> print( temp[0] )

In my case,

def sql(sql):
   // code to connect DB... bla..bal....
   c.execute(sql)
   return c.fetchall()

print sql("SELECT * FROM USER")

You can edit this for your own use.

-- 
Brian Lee <senux at senux.com>
* Please remove NOSPAM in my email adress to reply to me.



More information about the Python-list mailing list