something like that should work: open(request.folder+'/bk.csv', 'w').write(str(db(db.table.id).select(db.table.ALL)))
have a look at http://web2py.com/book/default/chapter/06#CSV-%28one-Table-at-a-time%29 for more details Paolo On Tuesday, November 13, 2012 7:24:38 PM UTC+1, dantuluri jaganadha raju wrote: > > Hi., > I want the result of query to be exported to csv file. or .doc > file(if possible). > > In a function I had a result suppose > result=db().select(db.table.ALL) then how > to convert this to csv. Tell me what code has to inserted to where ???? > > Thanks in advance > > > --

