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)
str=str+","+m
Thanks,
Smaran
On Sun, Nov 25, 2012 at 7:09 PM, Smaran Harihar <[email protected]>wrote:
> Hi Guys,
>
> I am connecting to postgres database and fetching the table names but it
> seems that they are being returned in <type 'tuple'>
>
> How can I convert them to string?
>
> --
> Thanks & Regards
> Smaran Harihar
>
>
--
Thanks & Regards
Smaran Harihar
--
http://mail.python.org/mailman/listinfo/python-list