Click here to Skip to main content
15,883,982 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
VB
ORA-29283: invalid file operation
ORA-06512: at "SYS.UTL_FILE", line 536


i don't know why...

DECLARE
V VARCHAR2(30);
L_FILE UTL_FILE.FILE_TYPE;
VAR RAW(32760);
t_result VARCHAR2(32767);
V_ARRAY APEX_APPLICATION_GLOBAL.VC_ARR2;
BEGIN
V := DBMS_RANDOM.STRING('U', 8);
t_result := utl_http.request('http://192.168.1.5:8080/getfile/getlist?p=W01:S01:R01:SH01:F0001');
V_ARRAY := APEX_UTIL.STRING_TO_TABLE(t_result,'~');
DBMS_OUTPUT.PUT_LINE('T_RESULT :'||T_RESULT);
T_RESULT := V_ARRAY(1);-- REPLACE(V_ARRAY(1),'/','\\');
EXECUTE IMMEDIATE 'CREATE OR REPLACE DIRECTORY '||V||' AS '''||T_RESULT||'W01/S01/R01/SH01/F0001''';
EXECUTE IMMEDIATE 'GRANT READ, WRITE ON DIRECTORY '||V||' TO PUBLIC';
DBMS_OUTPUT.PUT_LINE('V :'||V);
L_FILE := UTL_FILE.FOPEN(V,'XX.txt','WB');
DBMS_OUTPUT.PUT_LINE('V :'||V);
UTL_FILE.PUT_RAW(L_FILE,VAR);
UTL_FILE.FCLOSE(L_FILE);
EXECUTE IMMEDIATE 'DROP DIRECTORY '||V;
EXCEPTION
WHEN OTHERS THEN
DBMS_OUTPUT.PUT_LINE('Exception Message:'||SQLERRM);
END;
Posted
Comments
Richard MacCutchan 18-Sep-14 3:39am    
So where is line 536?
Jörgen Andersson 22-Sep-14 7:06am    
Inside the package body of SYS.UTL_FILE. :-)
Richard MacCutchan 22-Sep-14 7:09am    
OK, I'll just go and have a look ...

1 solution

Since the package body of SYS.UTL_FILE is wrapped (encrypted) it's impossible to say for sure what the problem is with the info you've supplied.
But a guess is that the user you're running Oracle under is not having the necessary rights in the filesystem to read or write files.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900