By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,905 Members | 902 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,905 IT Pros & Developers. It's quick & easy.

a little trouble passing values to Oracle using bind variables

P: n/a

As the subject line says, I am having some trouble passing bind variables to
Oracle. When I pass a printable string value, such as 'NM', I get data.
When I try to pass a non-printable character, such as 'return' - chr(13), I
get no data back. I can't simply make NactionCode = chr(13), as python
would change the value of NactionCode to '\r' and Oracle sees this as a two
byte character, and not chr(13). I have looked into how Oracle might accept
something like '\x00' for chr(0), but to no avail.

Any thoughts?


def goGetIt( NactivityDt, NactionCode ):

dataQuery = '''select a, b, c
from %s
where activityDt = :NactivityDt
and actionCode = :NactionCode
order by %s
''' % ( schema.tableName )

dbm.cursor.execute(dataQuery, NactivityDt = activityDt, NactionCode =
actionCode )
result = dbm.cursor.fetchall()

return result

NactivityDt = '12-apr-2005'
NactionCode = 'NM'
act1 = goGetIt( NactivityDt, NactionCode )

NactivityDt = '12-apr-2005'
NactionCode = 'chr(13)'
act2 = goGetIt( NactivityDt, NactionCode )

NactivityDt = '12-apr-2005'
NactionCode = chr(13)
act3 = goGetIt( NactivityDt, NactionCode )
__________________________________________________ _________________
The information contained in this message and any attachment may be
proprietary, confidential, and privileged or subject to the work
product doctrine and thus protected from disclosure. If the reader
of this message is not the intended recipient, or an employee or
agent responsible for delivering this message to the intended
recipient, you are hereby notified that any dissemination,
distribution or copying of this communication is strictly prohibited.
If you have received this communication in error, please notify me
immediately by replying to this message and deleting it and all
copies and backups thereof. Thank you.

Jul 19 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.