0

I had a procedure that was not working. If I tried to run: "BEGIN proc_name; END;" in SQL Developer or via script I had the same error.

I've fixed the procedure and now when I run that same command in SQL Developer, it's fine, but the script returns an error.

When I try:

...
sql = """EXEC proc_name"""
con = connection.cursor()
con.execute( sql )
...

I get DatabaseError: ORA-00900: invalid SQL statement, but probably is because of that: Problem with execute procedure in PL/SQL Developer and I'm not really worried about it.

What is really making me curious is when I try:

...
sql = """BEGIN proc_name;END;"""
con = connection.cursor()
con.execute( sql )
...

I get the same error that I had before fix the procedure. Do you have any idea what is going on?

PS: This is a python script using cx_Oracle and I'm using Oracle 10g.

1
  • First and second code example are the same? Commented Sep 27, 2011 at 14:54

1 Answer 1

0

Try using the callproc() or callfunc() method on the cursor, instead of execute(). They are not exactly Py DB API compatible, but should do the job for cx_Oracle...

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.