I am doing a parameter substitution, but when I execute the following
statement I get an error. Could you tell me how should i escape %
signs?
sql="select DATE_FORMAT(FROM_UNIXTIME(my_table.received_date),'%Y %M
%d,%H:%i') from my_table where my_table.from_email=%s"
then
c.execute(sql,('[EMAIL PROTECTED]'))
or
c.execute (sql,(email))
>>> sql="select DATE_FORMAT(FROM_UNIXTIME(my_table.received_date),'%%Y %%M %%d,%%H:%%i') from my_table where my_table.from_email=%s" % ' [EMAIL PROTECTED]'
>>> sql
"select DATE_FORMAT(FROM_UNIXTIME(my_table.received_date),'%Y %M %d,%H:%i') from my_table where my_table.from_email=[EMAIL PROTECTED] "
- Craig
_______________________________________________ DB-SIG maillist - DB-SIG@python.org http://mail.python.org/mailman/listinfo/db-sig