469,963 Members | 2,084 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,963 developers. It's quick & easy.

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.MYPROCEDURE(varcharArg => :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 !
Jun 26 '08 #1
3 5216
jlm699
314 100+
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?
Jun 26 '08 #2
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.
Jun 26 '08 #3
jlm699
314 100+
Expand|Select|Wrap|Line Numbers
  1. varChar = 'Some chars'
  2. boolArg = 'TRUE'
  3. query = "begin SYS.MYPACKAGE.MYPROCEDURE(varcharArg %s, booleanArg %s); end;" % (varChar, boolArg)
  4. cursor.execute(query,varList)
Is that what you're looking for?
Jun 26 '08 #4

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

2 posts views Thread by Robert | last post: by
7 posts views Thread by Zlatko Matić | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.