oracle - how to give relative path of local filesystem in pl/sql block -


i trying insert clob xml file in local file system. below piece of pl/sql block.

declare     xmlclobfile bfile := bfilename(bfile_dir, 'clob.xml');     tempclob clob; begin execute immediate 'create or replace directory bfile_dir '||''''||'/home/abc/data/emp/clobs'||''''  --clob insert dbms_lob.createtemporary(tempclob, true); dbms_lob.open(xmlclobfile, dbms_lob.lob_readonly); dbms_lob.loadfromfile(tempclob, xmlclobfile, dbms_lob.lobmaxsize);   execute immediate 'insert emp_data (id, clob_data) values (1000, :1)' using tempclob; end; / 

here when give absolute path (/home/abc/data/emp/clobs) works. when give relative path(like data/emp/clobs) , run sql /home/abc, doesn't work.

  [exec] error @ line 1:  [exec] ora-22285: non-existent directory or file fileopen operation  [exec] ora-06512: @ "sys.dbms_lob", line 937  [exec] ora-06512: @ line 57 

how provide relative path here, want run in machine , not mine. highly appreciated.

thanks

the relative path, if derive directory oracle "start" command run, e.g. /home/oracle. 1 way test this, , verify relative paths work (not used them myself) create directory pointing ".", , run test create file, search file. directory find find in start path. however, think unsafe, since oracle started folder (potentially), depending on if autostarted, or whichever dba on hand start it.


Comments

Popular posts from this blog

javascript - Jquery show_hide, what to add in order to make the page scroll to the bottom of the hidden field once button is clicked -

javascript - Highcharts multi-color line -

javascript - Enter key does not work in search box -