utl_file 로 지정된 디렉토리의 하위 디렉토리까지 엑세스 가능 한 방법이 있을지요? 0 1 2,852

by 임상준 [2013.07.26 15:52:05]



예를들어 /home/oracle/testdir 을 DIR 이라고 디렉토리를 생성 해 주었을 때
그 하위 디렉토리나 그 안의 파일을 핸들링 할 수 있는 방법이 있을까요?
예를들면 아래 위치의 파일처럼...
/home/oracle/testdir/test1/aaa.txt

원래 불가능한건지 아님 제가 방법을 모르는건지 몰겠네요...
컨셉 상 안되는 것 같은데.. 음...

by park1q [2013.07.31 12:50:01]

메뉴얼을 근거로 보면, 안되네요.
Oracle® Database PL/SQL Packages and Types Reference 11g Release 2 (11.2)

223 UTL_FILE 중에 있습니다.



Given the following:

SQL> CREATE DIRECTORY log_dir AS '/appl/gl/log'; 
SQL> GRANT READ ON DIRECTORY log_dir TO DBA; 
SQL> GRANT WRITE ON DIRECTORY log_dir TO DBA; 

SQL> CREATE DIRECTORY USER_DIR AS '/appl/gl/user''; 
SQL> GRANT READ ON DIRECTORY USER_DIR TO PUBLIC; 
SQL> GRANT WRITE ON DIRECTORY USER_DIR TO PUBLIC; 

The following file locations and filenames are valid and accessible as follows:

File Location Filename READ and WRITE
/appl/gl/log L12345.log Users with DBA privilege
/appl/gl/user u12345.tmp All users

The following file locations and filenames are invalid:

File Location Filename Invalid Because
/appl/gl/log/backup L12345.log # subdirectories are not accessible
/APPL/gl/log L12345.log # directory strings must follow case sensitivity rules as required by the O/S
/appl/gl/log backup/L1234.log # filenames may not include portions of directory paths
/user/tmp L12345.log # no corresponding CREATE DIRECTORY command has been issued

댓글등록
SQL문을 포맷에 맞게(깔끔하게) 등록하려면 code() 버튼을 클릭하여 작성 하시면 됩니다.
로그인 사용자만 댓글을 작성 할 수 있습니다. 로그인, 회원가입