67453593

Date: 2021-05-09 02:40:46
Score: 7
Natty:
Report link

do you have a similar syntax for teh pl/sql stored procedure too. i am trying to call the stored procedure in python to insert the xml data but not working :(

here are details -

create or replace procedure t(a in XMLType, b out number) as
begin
  b := 5;
end;
/

code is -

xmlData = """<?xml version="1.0"?>
        <customer>
            <name>John Smith</name>
            <Age>43</Age>
            <Designation>Professor</Designation>
            <Subject>Mathematics</Subject>
        </customer>"""
xmlval=cx_Oracle.CLOB
xmlval = xmlData
try:
  
    r=c.var(cx_Oracle.NUMBER)
    c.callproc("T", [xmlval,r])
    print("Result = ",r.getvalue(pos=0))
 
    c.close()
except cx_Oracle.DatabaseError as ex:
    err, =ex.args
    print("Error code    = ",err.code)
    print("Error Message = ",err.message)
    os._exit(1)
Reasons:
  • Blacklisted phrase (1): but not working
  • Blacklisted phrase (1): i am trying to
  • Blacklisted phrase (1): :(
  • RegEx Blacklisted phrase (2): do you have a similar
  • RegEx Blacklisted phrase (1.5): do you have a
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Unregistered user (0.5):
  • Low reputation (1):
Posted by: vibhor