a little trouble passing values to Oracle using bind variables

Discussion in 'Python' started by Michael.Coll-Barth@VerizonWireless.com, May 17, 2005.

  1. Guest

    All,

    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?

    thanks,
    Michael



    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.
     
    , May 17, 2005
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. mr2_93
    Replies:
    1
    Views:
    3,625
    mr2_93
    Oct 2, 2005
  2. Benson, John
    Replies:
    1
    Views:
    2,241
    Aurelio Martin
    Jan 28, 2004
  3. ThaDoctor
    Replies:
    3
    Views:
    393
    Alan Woodland
    Sep 28, 2007
  4. Feyruz
    Replies:
    4
    Views:
    2,244
    Sherm Pendley
    Oct 14, 2005
  5. Daniel
    Replies:
    1
    Views:
    220
    Bart van Ingen Schenau
    Jul 9, 2013
Loading...

Share This Page