I know this question have been asked before but any of the answers was helpful for me, I am using Basic module(psycopg2) in python trying to pass an external parameter row[1] into a Postgres Query which is:
print row[1], type(row[1])
630776863141535744
<type 'str'>
when I run the following code I face TypeError: not all arguments converted during string formatting
for row in rows:
t=row[1]
PSQL1="SELECT occorrenza.tag from occorrenza where tweet=%s and tag in ( select pk_tag from hashtag where isentity=FALSE);"
c.execute(PSQL1,t)
also I have tried the following code and have the same error :
for row in rows:
c.execute("SELECT occorrenza.tag from occorrenza where tweet=%s and tag in ( select pk_tag from hashtag where isentity=FALSE);",row[1])
I have changed many other parts like putting '%s'instead of %s
but I still have error!