Bogdan
19th March 2007, 17:56
Hi,

Is it possible to retrieve a file attributes (size, date) from Oracle PL/SQL ?
The file is located to a machine (server, workstation) in the network.

Best regards,

Kozure Ohashi
19th March 2007, 22:49
Dear Bogdan,

you can try:

UTL_FILE.FGETATTR('FOR_UTL_FILE', 'test.txt', v_exists, v_len, v_bs);

Regards,

Kozure

victor_cleto
23rd March 2007, 18:35
Directly no. Oracle can only read from a directory that is "local" to the Oracle server (don't know if this will work with shared directories) that has been declared thru an Oracle create directory and permissions given accordingly to the Oracle user for it. For example:

CREATE DIRECTORY MyOraDir AS 'C:\WindowsDir\';
GRANT READ ON DIRECTORY MyOraDir TO MyOraUser;

Now you can read files inside C:\WindowsDir by using in your PL/SQL code MyOraDir.
Search the web for "create directory" for more information.
(start here for example: http://www.psoug.org/reference/utl_file.html)