Read the names of files in a windows directory

Hello
I want to read the names of files in a Windows directory.
The grant of java is as follows
DBMS_JAVA.grant_permission ('USIDAS', 'java.io.FilePermission', 'N:\T050D2', 'read, write, delete');

The procedure to create a temporary table:
BEGIN
RUN IMMEDIATELY "DROP TABLE DIRLIST CASCADE CONSTRAINTS;

EXECUTE IMMEDIATE 'create a global temporary table DIRLIST '.
|| '( '
|| 'VARCHAR2 (255 BYTE) FILE NAME'
|| ') '
|| "ON COMMIT PRESERVE ROWS";
EXCEPTION
WHILE OTHERS
THEN
NULL;
END;

The java procedure:
CREATE OR REPLACE AND COMPILE the JAVA SOURCE NAMED 'DirList '.
LIKE import java. IO;
import java.sql. *;

public class DirList
{
Public Shared Sub getList (string directory)
throws SQLException
{
Path = new file (directory);
List of strings [] = path.list ();
Element string;

for (int i = 0; i < list.length; i ++)
{
item = list;
#sql {INSERT INTO DIRLIST (FILENAME)
{VALUES (: element)};
}
}

}
/

the PL/SQL procedure to call the Java procedure:
CREATE or REPLACE procedure get_dir_list (oracle_directory in)
VARCHAR2)
like java language
name 'DirList.getList (java.lang.String);
/


The call to SQL * more

SQL > exec get_dir_list ('N:\T050D2')
BEGIN get_dir_list ('N:\T050D2'); END;

*
ERROR on line 1:
ORA-29532: Java completed by eception Java exception appeal:
java.lang.NullPointerException
ORA-06512: at "USIDAS. GET_DIR_LIST', line 1
ORA-06512: at line 1

Versions:
SQL > select * from v version $;

BANNER
--------------------------------------------------------------------------------

Oracle Database 11 g Enterprise Edition Release 11.1.0.7.0 - 64 bit Production
PL/SQL Release 11.1.0.7.0 - Production
CORE Production 11.1.0.7.0
AMT for HP - UX: 11.1.0.7.0 - Production Version
NLSRTL Version 11.1.0.7.0 - Production

Can someone help me solve this problem?
Thank you
Siegwin

exec get_dir_list ('N:\T050D2')

Are you sure that N:\T050D2 is a valid directory on the DB server and not on your local PC?

Max
[My Italian blog Oracle | http://oracleitalia.wordpress.com/2010/01/31/le-direttive-di-compilazione-pragma/]

Tags: Database

Similar Questions

  • The list of all the names of files in a directory

    Hello everyone,

    I need to write a script in PL/SQL (oracle 10g) that lists all the names of files in a specific directory on a client computer and import the files into the database (xml files). After you import the file, they must be removed.

    I was looking for a solution for this because I've never met a challenge like this.
    What I found was that I could use the procedure dbms_backup_restore.searchfiles of the SYS schema.
    Now, I need to know how this procedure works. There is very little documentation available.
    Can I give the procedure to a folder name on my customer's computer that contains xml files and let the procedure from the list of these files?

    Can anyone help me please with this. I have no idea.

    Thanks in advance.
    Kind regards
    Mariane

    Stored procedures generally are running on the database server, so they can access only files that are visible on the database server. Unless you have a rather unconventional configuration where your server has mounted the directory of the client in question, no code that runs on the database server will be able to access the files on your client system.

    Is there a client application that runs on the computer client connection to the database server? If Yes, this client application could handle some file manipulation is necessary?

    Justin

  • How to display the name of file or the path of the photos on my screensaver when the value for 'My images' using Vista?

    I simply marked the box in 'settings' of the screen saver under Windows XP, but Vista does not display this option!

    When an image appears on my screen saver, I want to find it among the thousands of photos by reading the name of the file or the path at the top of the screen.

    Hello

    This screensaver Vista version doesn't have this option.

    The feature is now part of the Windows Live Photo Gallery.  You can go to http://get.live.com to download the program.  .

  • Event Viewer error "there was an error while trying to read the local hosts file." file "hosts" but good

    Hello

    In Event Viewer, I see a lot of mistakes like:

    Source: The customers DNS events

    There was an error trying to read the local hosts file.

    I read that threat indicating to rename the hosts for "hosts" file

    http://answers.Microsoft.com/en-us/Windows/Forum/Windows_7-networking/system-log-shows-repeating-error-code-3221225485/3700e855-ded4-4F12-960f-1577f6132c04

    HOWEVER, the name of the file in my computer appears as it should

    C:/Windows/System32/drivers/etc / "hosts".

    and the content of the file is as it is supposed to be according to: http://support.microsoft.com/kb/972034

    What should I do to fix this error?

    P.S. I suspect my computer is compromised. Last weekend, Security Essentials has reported a malicious file backdoor and it has been deleted, but I have a weird behavior of the computer

    Thank you

    Veronica

    Try to re-create the hosts file.

    Open Notepad as administrator (click right on the Notepad icon or shortcut and click Run as admin) and type the following information in it:

    127.0.0.1 localhost

    : 1 localhost

    The '1' in the '127.0.0.1' must be in the first column of the line and there must be at least one space between "127.0.0.1" and "localhost". In the second line, there must be at least one space between ": 1" and "localhost".

    Save the file with name "hosts" in the C:\windows\system32\drivers\etc folder.

    Source: http://www.sevenforums.com/system-security/130518-hosts-file-missing-should-i-worry.html

    You seem to have a hard drive problem. Please provide a copy of your system information file. Type the system information in the search box above the Start button and press the ENTER key (alternative is select Start, all programs, accessories, System Tools, system information). Select file, Export and give the file a name noting where it is located. Not to place the cursor in the body of the report before exporting the file. The system creates a new information file system each time system information is available. You must allow a minute or two before the file is completely filled before exporting a copy. Please download to your OneDrive (formerly Sky Drive), share with everyone and post a link here. Normal mode preferred report. Please say if the report was obtained in safe mode.

  • Can I globally change the names of files and or directory to lowercase to uppercase?

    in Windows XP or in Windows 7, globally change the names of files and or directory to lowercase to uppercase?

    A single configuration change probably will not accomplish this.

    Your best bet is probably the freeware "Bulk Rename Utility" program which has a section dedicated to change the case of file names.

    Bulk Rename Utility: <> http://www.bulkrenameutility.co.uk/Main_Intro.php >

    HTH,
    JW

  • Want to copy and paste the names of files only, not the content

    I have organized hundreds of files in several folders of dozens and that you must first create a list or map of all files.  I want only the names of files, not other thing.  I found some freeware that seems designed to do this, but am reluctant to download.  Can it be done without additional software?  If I can't do the regular windows environment, someone suggest what software is the easiest to achieve?

    There are a lot of reliable freeware websites.  What program have you found, and this web site is on?

    To do the work of the normal Windows environment, click Start > all programs > Accessories > command prompt and enter these commands:

    CD /d "" path ".
    dir/b/s >"" file
    ".

    where:

    path = full path to the file
       file = name of the file to write

    For example, to create a list of files in My Documents and write it to a file named My Documents.txt :

    CD/d "C:\Documents and Settings\Utilisateur\Mes Documents"
    dir/b/s > "My Documents.txt."

    The /s parameter lists the files in the selected folder and all its subfolders.  The omit if you want just the files in the selected folder. Boulder computer Maven
    Most Microsoft Valuable Professional

  • How can I print a list of the names of files on a hard drive

    I try to print the names of files on drive "C".

    Hello

    Use this excellent free program.

    Karen - free directory printer - print the name of every file on a disk, as well as the size of the file, date and time
    last modified and attributes (read-only, hidden, system and Archive)! And now, the list of files can be
    Sort by name, size, date created, date last modified, or last access date.
    http://www.KarenWare.com/PowerTools/ptdirprn.asp

    I hope this helps.
    Rob - bicycle - Mark Twain said it is good.

  • highlighting the names of files in Explorer


    Is there a way to clear or color code of the names of files in windows Explorer?

    Hi Ron,

    Please contact Microsoft Community.

    I understand you want to know the possibilities by highlighting the names of color code file in Windows Explorer.

    It is not possible to design problem. I suggest you use your favorite search engine to search for any third party software that can help to correct the problem.

    WARNING: Using third-party software, including hardware drivers can cause serious problems that may prevent your computer from starting properly. Microsoft cannot guarantee that problems resulting from the use of third-party software can be solved. Software using third party is at your own risk.

    I hope it helps. If you have any questions about Windows in the future, please let us know. We will be happy to help you.

  • Net Oracle does not read the tnsnames.ora file.

    I am running 11.2.0.3 on Solaris 10 SPARC x 64. I'm trying to configure oracle net for a new database on hold in order to be able to use rman duplicate to create. LDAP is what we mainly use for all of our connections and, possibly, what I could use very well for my goal of rman duplication. But, I fear that I do nothing seems to allow me to read the tnsnames.ora file.

    My SQLNET. ORA file is as follows:

    NAMES. DIRECTORY_PATH = (LDAP, TNSNAMES)

    NAMES. DEFAULT_DOMAIN = mydomain.com

    My TNSNAMES file. ORA file is as follows on both servers:

    WLDB_HERE =
    (DESCRIPTION =
    (ADDRESS_LIST =
    (ADDRESS = (PROTOCOL = TCP)(HOST = primary_server) (PORT = 1521))
    )
    (CONNECT_DATA = (SERVICE_NAME = wldb_here.mydomain.com))
    )

    WLDB_THERE =
    (DESCRIPTION =
    (ADDRESS_LIST =
    (ADDRESS = (PROTOCOL = TCP)(HOST = standby_server) (PORT = 1521))
    )
    (CONNECT_DATA = (SERVICE_NAME = wldb_there.mydomain.com))
    )

    I have a static entry in the remote listener.ora file so I can connect to create the instance:

    SID_LIST_LISTENER =
    (SID_LIST =
    (SID_DESC =
    (GLOBAL_DBNAME = wldb_there.mydomain.com)
    (ORACLE_HOME = / u01/app/oracle/product/OraHome112)
    (SID_NAME = WJZI)
    )
    )

    LISTENER =
    (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = standby_server) (PORT = 1521))
    )

    Permissions on my .ora files in $ORACLE_HOME/network/admin are

    -rw - r - r - 1 oracle dba

    The user that I am connected to who is oracle.

    I have set up several times before, but for some reason that I can't get this to work. I get

    AMT-03505: failed to resolve host

    Of

    tnsping wldb_there

    or

    tnsping wldb_here

    I have not tried to take the LDAP Protocol on my sqlnet.ora because I need, but I really want to know if anyone has had an experience like this before.

    Thank you-

    gregb wrote:

    I am running 11.2.0.3 on Solaris 10 SPARC x 64. I'm trying to configure oracle net for a new database on hold in order to be able to use rman duplicate to create. LDAP is what we mainly use for all of our connections and, possibly, what I could use very well for my goal of rman duplication. But, I fear that I do nothing seems to allow me to read the tnsnames.ora file.

    My SQLNET. ORA file is as follows:

    NAMES. DIRECTORY_PATH = (LDAP, TNSNAMES)

    NAMES. DEFAULT_DOMAIN = mydomain.com

    My TNSNAMES file. ORA file is as follows on both servers:

    WLDB_HERE =
    (DESCRIPTION =
    (ADDRESS_LIST =
    (ADDRESS = (PROTOCOL = TCP)(HOST = primary_server) (PORT = 1521))
    )
    (CONNECT_DATA = (SERVICE_NAME = wldb_here.mydomain.com))


    )

    Because you have NAMES. DEFAULT_DOMAIN = mydomain.com in your sqlnet.ora, when you try to connect to "WLDB_HERE", before tnsnames.ora is read, sqlnet will transform your application in "WLDB_HERE.mydomain.com".  And that's what he's going to get.

    You do not have an entry in your tnsnames.ora to 'WLDB_HERE.mydomain.com '.

    WLDB_THERE =
    (DESCRIPTION =
    (ADDRESS_LIST =
    (ADDRESS = (PROTOCOL = TCP)(HOST = standby_server) (PORT = 1521))
    )
    (CONNECT_DATA = (SERVICE_NAME = wldb_there.mydomain.com))
    )

    I have a static entry in the remote listener.ora file so I can connect to create the instance:

    SID_LIST_LISTENER =
    (SID_LIST =
    (SID_DESC =
    (GLOBAL_DBNAME = wldb_there.mydomain.com)
    (ORACLE_HOME = / u01/app/oracle/product/OraHome112)
    (SID_NAME = WJZI)
    )
    )

    LISTENER =
    (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = standby_server) (PORT = 1521))
    )

    Permissions on my .ora files in $ORACLE_HOME/network/admin are

    -rw - r - r - 1 oracle dba

    The user that I am connected to who is oracle.

    I have set up several times before, but for some reason that I can't get this to work. I get

    AMT-03505: failed to resolve host

    Of

    tnsping wldb_there

    or

    tnsping wldb_here

    I have not tried to take the LDAP Protocol on my sqlnet.ora because I need, but I really want to know if anyone has had an experience like this before.

    Thank you-

  • Can I automate PDF file merger based on the correspondence of the names of files with Acrobat Pro?

    I want to automate the task of merging PDF files from a directory on a local computer with PDF files that have the same name on a network directory.  Essentially, the process would be to read the name of the local pdf file then procedure step by step the structure of network directories to find a corresponding file name.  If a match is found then merge the local (including bookmarks) file in the network file (insert before page 1).  If the merger success, delete the local file.  If an error occurs, announce the error and move the local file to a local folder that is named MergeErrors.  If no match is found move the local file to a local folder named NoMatches. This process should be repeated until all files were them merged or moved.  Can I do this with Actions in Acrobat Pro?

    Not directly - Actions have no logic so can not react to mistakes or perform some filtering.

    You can use a JavaScript script to the folder level and the command doc.insertPages () to combine a file into another, but you'd have to hardcode the paths. There is no directory, listing or search feature in Acrobat JavaScript.

  • AS3, obtain the names of files in the Flash .exe or .app folder, no Air

    I build a Flash project that will read a file to get the names of the images & videos, so they can be added dynamically in the Flash project. The .swf, the .app or .exe, but I pulled out the final version, will run on a PC or a Mac that is hooked up to a monitor large flat screen.

    If the project was used on the web, I would say just a .php script to clear the names of files in an .xml file. However, the Flash and the computer will be offline.

    I have not built anything with air, so I did not have enough time to get in tune with him in order to to use. I know that AIR as3 has a FileListEvent class that has a method getDirectoryListingAsync to read a directory.

    So my question is, is it possible to read the names of a directory in a folder when Flash is running in offline mode?

    I was wondering if it would be feasible to running a script BACK or a script similar to Mac BACK.

    Or is there a better way?

    Thanks in advance for your reply,

    Zak

    sinious,

    a colleague of mine told me that apache & .php are integrated in Mac OS X. There is a good chance I'll run the flash on a Mac so I can take advantage of this option.

    http://foundationphp.com/tutorials/php_leopard.php

    Zak

  • How to extract the names of file/URL of all files in a folder (in the same directory of site)?

    I am creating an online music player, simple Flash-based; the user clicks on a song in a DataGrid, and then he plays, simple. I displays the information of the song with the ID3 method in the class 'sound', but I don't want to hardcode all the songs in the ActionScript code, because I change them. I created a folder "tracks" in the directory of the site; How can I extract the names of the files in this folder without knowing how many there are by nature, and files without knowing the URL?

    Use PHP or another script server to read the contents of the folder and to deliver the names of files for Flash in the form of data (xml or txt).

  • read the names of clip from movie from XML

    I am trying to use an XML file containing the names of occurrence of clips. I can read the names, but they are when they come with strings. How can I make Flash recognized as instance names?

    Never mind. Rather than change the channel to a clip, all I have to do is reference movieclip.name, which returns the name of the instance as a string.

  • just reinstall my xp I had to jump the Msxml6.dll file and c:\windows\system32\mucltui.dll.MUI how to fix?

    original title: Please help

    just reinstall my xp I had to jump the Msxml6.dll file and c:\windows\system32\mucltui.dll.MUI how to fix?

    Hello

    1A Windows XP installed properly on your computer?

    2. If it is installed, you face any problem with Windows XP?

    I suggest you try the methods mentioned below and check if it helps:

     

    Method 1:

    Try to do a Scan SFC (System File Checker). The scan will look bad system files and will attempt to fix them, if possible.

    (a) click the Start button.
    (b) type: cmd.exe in the search results.
    (c) right click the cmd.exefile and select 'run as administrator '.
    (d) in the CMD window, type:sfc/scannowand press the Enter key.
    (e) restart and see if that solves the problem.

    Description of Windows XP and Windows Server 2003 System File Checker (Sfc.exe)

    http://support.Microsoft.com/kb/310747

    Hope this information is useful.

  • Client Windows 7 Professional DNS fails to resolve the name - when connectin to a Windows Server 2003

    A professional Windows 7 workstation is unable to resolve the name when connecting to a Windows Server 2003 server.

    I ran the Portqry tool and discovered a problem with the Port 53 and open this Port in the Windows Firewall on the client and Windows Server 2003.  However, it may not always resolve the name and I can't get the Windows 7 workstation to join the domain.

    Our DNS server is at the ISP, but enabled DNS on Windows Server 2003.  I can ping the IP address of the server from the Windows 7 client

    nslookup is solved using the FULL domain name.

    Any ideas on other settings, I need change and port that I need to open to allow?

    Thank you.

    To help with this problem, please go to the TechNet Windows Server forums .  They can help you better than we can in the Windows Vista forum. Boulder computer Maven
    Most Microsoft Valuable Professional

Maybe you are looking for