how to pass PL/SQL-BOOLEAN argument to procedure in Oracle

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • hydroxide8
    New Member
    • Dec 2006
    • 4

    how to pass PL/SQL-BOOLEAN argument to procedure in Oracle

    hey
    im using cx_Oracle to connect my python code to Oracle database,
    and i wanted to know how can i pass PL/SQL-BOOLEAN argument to procedure ?
    my code is something like "cursor.execute (query,varList) "
    where query is "begin SYS.MYPACKAGE.M YPROCEDURE(varc harArg => :1,booleanArg => :2); end;"
    and varList is my argument list, and the second argument need to be of type BOOLEAN, how can i achive that ?
    thanks !
  • jlm699
    Contributor
    • Jul 2007
    • 314

    #2
    I'm confused on what exactly you're asking.. could you clarify a bit? Are you passing a boolean in Python to an Oracle database or are you passing an Oracle boolean to Python?

    In Python the keywords True and False represent 1 and 0 respectively. There is also the bool() function which evaluates common objects to boolean true or false...

    Anyways, could you provide slightly more specific information on what you're having trouble with?

    Comment

    • hydroxide8
      New Member
      • Dec 2006
      • 4

      #3
      10x for your replay,
      im trying to pass a boolean value in Python to an Oracle database procedure(to PL/SQL BOOLEAN value that my Oracle procedure getting)
      my oracle procedure is getting to values:1. varchar value,2.boolean value
      and i want to execute this procedure from my python code, and i dont know hot to pass the boolean value to the Oracle procedure.

      Comment

      • jlm699
        Contributor
        • Jul 2007
        • 314

        #4
        [code=python]varChar = 'Some chars'
        boolArg = 'TRUE'
        query = "begin SYS.MYPACKAGE.M YPROCEDURE(varc harArg %s, booleanArg %s); end;" % (varChar, boolArg)
        cursor.execute( query,varList)[/code]

        Is that what you're looking for?

        Comment

        Working...