Trouble with bindind date in dictionary in the following statements??
mySQL = 'SELECT day_key FROM timeday WHERE calendar_date =:calendar'
args = {'calendar':'2016/10/16', 'giftcardnbr': '7777083049519090', 'giftcard_amt': '249.8'}
cursor.execute(mySQL,args)
DatabaseError: ORA-01036: illegal variable name/number
Why does this syntax return a different error?
cursor.execute('SELECT day_key FROM timeday WHERE calendar_date =:calendar',{'calendar':'2016/10/16'})
DatabaseError: ORA-01861: literal does not match format string
From mastering Oracle Python
named_params = {'dept_id':50, 'sal':1000}
query1 = cursor.execute('SELECT * FROM employees WHERE department_id=:dept_id AND salary>:sal', named_params)
works fine??
Thanks