Oracle's UTL

xiaoxiao2021-03-13  195

Oracle8 may not access the directory as follows

Create Directory UTL_NET AS 'C: / Files'; Grant Read, Write on Directory UTL_NET TO DBUSER; GRANT WRITE DIRECTORY UTL ON DBUSER

UTL_FILE.FOPEN ('UTL2', '1.csv', 'W');

However, the setting can be accessed as follows, ie direct directory (the following program can be copied to SQLPLUS)

Declare

FHANDE UTL_FILE.FILE_TYPE;

Begin

FHANDLE: = UTL_FILE.FOPEN ('D: /', '1.csv', 'W');

UTL_FILE.PUT_LINE (Fhandle, 'Eygle Test Write ");

UTL_FILE.PUT_LINE (FHANDE, 'Eygle Test Write Two');

UTL_FILE.FCLOSE (FHANDLE);

END;

/

转载请注明原文地址:https://www.9cbs.com/read-128992.html

New Post(0)