0
votes
#!/usr/bin/python
# -*- coding: UTF-8 -*-

import cx_Oracle

I want to use dbms_logmnr_d.build() in Python, but following error occurs:

Traceback (most recent call last):
File "test.py", line 10, in

x=c.callproc("EXECUTE dbms_logmnr_d.build(dictionary_filename => 'dictionary.ora', 
                dictionary_location =>'/u01/app/oracle/product/11.2.0/xe/LOGMNR')")

cx_Oracle.DatabaseError:
ORA-06550: Line 1, column 15:
PLS-00103: Encountered the symbol DBMS_LOGMNR_D when expecting one of the following:
: = . ( @ % ; immediate
The symbol : = was substituted for DBMS_LOGMNR_D to continue.


Example:

conn=cx_Oracle.connect('example/pass@localhost/XE')
c=conn.cursor()                                         
x=c.callproc("EXECUTE dbms_logmnr_d.build(dictionary_filename => 'dictionary.ora', dictionary_location =>'/u01/app/oracle/product/11.2.0/xe/LOGMNR')")
conn.commit();                  
c.close()                                                 
conn.close() 
1

1 Answers

2
votes

You should not use the execute keyword, and pass arguments separately:

c.callproc("dbms_logmnr_d.build", keywordParameters = dict(dictionary_filename = "dictionary.ora", dictionary_location = "/u01/app/oracle/product/11.2.0/xe/LOGMNR"))