Skip to Main Content
  • Questions
  • The same SQL, but different result: dbms_xslprocessor.clob2file

Breadcrumb

Question and Answer

Connor McDonald

Thanks for the question, Zhuang.

Asked: September 15, 2016 - 1:57 pm UTC

Last updated: September 30, 2016 - 9:29 am UTC

Version: 12.1.0.2

Viewed 1000+ times

You Asked

Actually this has been resolved.

It is OS directory permission issue. Directly login used group permission while "oracle" is the part of the group. The sqlnet login might need the owner permission I think? After asking the system change the file permission: to have the directory owned by "oracle", then it worked.

Just in case that other people come cross the simailar issue.

Best wishes,

Zhuang

====================================================
Hi Tom,

Hope you can answer this:

The following SQL
</>

DECLARE

v_file_contents CLOB := 'test';
v_filename VARCHAR2(100) := 'test.txt';
v_filepath VARCHAR2(1000) := 'ELEMENTSFEED';

BEGIN

dbms_xslprocessor.clob2file(
cl => v_file_contents,
flocation => v_filepath,
fname => v_filename,
csid => nls_charset_id('UTF8')
);

END;
</>

If I login to the database directly by "sqlplus username/password", it runs successfully.
but if run as "sqlplus username/password@tnsname", it gives the following error:
ERROR at line 1:
ORA-29283: invalid file operation
ORA-06512: at "SYS.UTL_FILE", line 536
ORA-29283: invalid file operation
ORA-06512: at "XDB.DBMS_XSLPROCESSOR", line 121
ORA-06512: at line 9

Why @tnsnames make such big difference? It only happened on one database.

Thanks,

Zhuang


and Connor said...

Thanks for getting back to us.

Is this answer out of date? If it is, please let us know via a Comment

More to Explore

CLOB/BLOB/etc

Complete documentation on Securefiles and Large Objects here