Re: callproc dbms_metadata.add_file

Doug Henderson <[email protected]>
Newsgroups gmane.comp.python.db.cx-oracle
Message-ID <CAJ1FpuOCuH9wOYuUm9W8nG-UEMudRO+ggSH3GE-TE74NY2s6GA@mail.gmail.com>
On 24 September 2014 13:18, Werner Moser wrote:


> DBMS_DATAPUMP.ADD_FILE (
>    handle     IN NUMBER,
>    filename   IN VARCHAR2,
>    directory  IN VARCHAR2,
>    filesize   IN VARCHAR2 DEFAULT NULL,
>    filetype   IN NUMBER DEFAULT DBMS_DATAPUMP.KU$_FILE_TYPE_DUMP_FILE),
>    reusefile  IN NUMBER DEFAULT NULL;

Note the misplaced ")" from the original Oracle document.

> cur.callproc('dbms_datapump.add_file', [handle,'test.log','EXP_IMP',102400,'KU$_FILE_TYPE_LOG_FILE'])

Try replacing 'KU$_FILE_TYPE_LOG_FILE' with the constant value defined
in the DBMS_DATAPUMP package. If that works, you could try extracting
that value by fetching the result of "select
DBMS_DATAPUMP.KU$_FILE_TYPE_LOG_FILE from dual". Off the top of my
head, I don't know an easier way to get a constant out of a package
from python.

BTW, in my tests, failures while defining the data pump job would
result in a situation where I could not define a new job with the same
name. I did not discover a way of clearing a job in the defining state
other than a database stop/start cycle. You could not attach to the
job because it was not running and you could not open it because it
already existed. Without a handle, you could not

Doug


-- 
Doug Henderson, Calgary, Alberta, Canada

------------------------------------------------------------------------------
Meet PCI DSS 3.0 Compliance Requirements with EventLog Analyzer
Achieve PCI DSS 3.0 Compliant Status with Out-of-the-box PCI DSS Reports
Are you Audit-Ready for PCI DSS 3.0 Compliance? Download White paper
Comply to PCI DSS 3.0 Requirement 10 and 11.5 with EventLog Analyzer
http://pubads.g.doubleclick.net/gampad/clk?id=154622311&iu=/4140/ostg.clktrk
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.