Re: Convert tuples into string

2012-11-25 Thread Tim Chase
On 11/25/12 20:24, Smaran Harihar wrote: > I was able to solve it using the following loop, > > conn=psycopg2.connect(connstr) > cursor=conn.cursor() > cursor.execute("SELECT tablename FROM pg_tables where tablename like '%"+ > inp +"%'") > records = cursor.fetchall() > str="" > for rec in record

Re: Convert tuples into string

2012-11-25 Thread Smaran Harihar
I was able to solve it using the following loop, conn=psycopg2.connect(connstr) cursor=conn.cursor() cursor.execute("SELECT tablename FROM pg_tables where tablename like '%"+ inp +"%'") records = cursor.fetchall() str="" for rec in records: if str == "": str="".join(rec) else: m="".join(rec) st

Re: Convert tuples into string

2012-11-25 Thread Cameron Simpson
On 25Nov2012 19:09, Smaran Harihar wrote: | I am connecting to postgres database and fetching the table names but it | seems that they are being returned in | | How can I convert them to string? Please show: - the code fetching the names; we do not know what library you are using or how

Convert tuples into string

2012-11-25 Thread Smaran Harihar
Hi Guys, I am connecting to postgres database and fetching the table names but it seems that they are being returned in How can I convert them to string? -- Thanks & Regards Smaran Harihar -- http://mail.python.org/mailman/listinfo/python-list