Thread: How can I create a array with all files from a directory


Permlink Replies: 6 - Pages: 1 - Last Post: Jun 4, 2008 9:49 PM Last Post By: Mike McLaughlin
user639116

Posts: 4
Registered: 05/29/08
How can I create a array with all files from a directory
Posted: May 29, 2008 12:08 PM
Click to report abuse...   Click to reply to this thread Reply
How can I create a array of files or varchar with all files from a directory?
Etbin

Posts: 1,494
Registered: 09/20/07
Re: How can I create a array with all files from a directory
Posted: May 29, 2008 12:14 PM   in response to: user639116 in response to: user639116
Click to report abuse...   Click to reply to this thread Reply
user639116

Posts: 4
Registered: 05/29/08
Re: How can I create a array with all files from a directory
Posted: May 29, 2008 12:28 PM   in response to: user639116 in response to: user639116
Click to report abuse...   Click to reply to this thread Reply
Do I really need to create a Java function? Doesn´t PL/SQL provides a function for that?!
Etbin

Posts: 1,494
Registered: 09/20/07
Re: How can I create a array with all files from a directory
Posted: May 29, 2008 12:53 PM   in response to: user639116 in response to: user639116
Click to report abuse...   Click to reply to this thread Reply
Use the solution provided as a snippet (I don't know Java too) and fill your array retrieving your data from the GTT (or change your design and use the GTT directly)
I think Tom Kyte would just simply point to the existing function instead of providing the solution he did.

Regards

Etbin
Shailender Mehta

Posts: 178
Registered: 03/20/06
Re: How can I create a array with all files from a directory
Posted: May 29, 2008 7:42 PM   in response to: user639116 in response to: user639116
Click to report abuse...   Click to reply to this thread Reply
Do I really need to create a Java function? Doesn´t PL/SQL provides a function for that?!

Which DB version are you using ?

Shailender Mehta
Kamran Agayev

Posts: 808
Registered: 09/03/03
Re: How can I create a array with all files from a directory
Posted: May 29, 2008 8:57 PM   in response to: user639116 in response to: user639116
Click to report abuse...   Click to reply to this thread Reply
Don't wonder about Java function. Just create it and call it from PL/SQL
Mike McLaughlin

Posts: 268
Registered: 11/08/05
Re: How can I create a array with all files from a directory
Posted: Jun 4, 2008 9:49 PM   in response to: user639116 in response to: user639116
Click to report abuse...   Click to reply to this thread Reply
I thought the example could be improved upon. I've posted a solution on my blog that doesn't require writing the directory list to a table. It simply returns it as a nested table of files as a SQL datatype. You can find it here:

http://maclochlainn.wordpress.com/2008/06/05/how-you-can-read-an-external-directory-list-from-sql/
Legend
Guru Guru : 2500 - 1000000 pts
Expert Expert : 1000 - 2499 pts
Pro Pro : 500 - 999 pts
Journeyman Journeyman : 200 - 499 pts
Newbie Newbie : 0 - 199 pts
Oracle ACE Director
Oracle ACE Member
Oracle Employee ACE
Helpful Answer (5 pts)
Correct Answer (10 pts)

Point your RSS reader here for a feed of the latest messages in all forums