I'm facing a strange problem when doing queries in my sql application. I'm working with python3 and cx_Oracle 5.1.2. My test table is organized as it follows:
CREATE TABLE people ( sin CHAR(15), name VARCHAR(40), PRIMARY KEY (sin))
with the following values inserted (sin, name):
('1','a'), ('2','b'), ('3','c')
When I do a simple select using an unsafe query:
curs.execute("select name from people where sin = '1'")
The result is 'a', as expected, but if I use bindings:
curs.execute("select name from people where sin = :v", v='1')
The result is empty. I already tried to change this to the positional '?' parameter, set the size of 'v' through setinputsizes(v=15) but nothing appears to work.
Is there something that I am missing?
Thanks,
curs.execute("select name from people where sin = :v", {'v':'1'})?