Read files in directories with PL/SQL

Hi
Is there any way to read files (just the names) in a directory just using PL/SQL? I mean, finding out the files with .dat extension in a given directory, for example.
Thanks

I don't know Forms but I know SQL*Plus and Oracle database. Normally PL/SQL running on the database can only access files on the host where the database instance is running even if you start PL/SQL with a SQL*Plus connection from another host.
PL/SQL runs only the database instance not on the client side even if you start the PL/SQL code from a remote connection with SQL*Plus.

Similar Messages

  • Read consistency in query with pl/sql functions

    Not sure if this is a bug or feature, but a query containing a user-defined pl/sql function does not include tables accessed within the pl/sql function in the read consistent view of data, eg
    select myfunc from tableA
    myfunc is a stored function that queries tableB and returns a value
    If a change to tableB is committed in another session during fetch phase of select statement, then fetched rows reflect the changes. The database does not recognise tables accessed in the plsql function as being part of the query.
    This happens in 7.3.4 and 8.1.6. Don't have 9i so can't tell.
    Anyone know if this is a bug or feature?
    Aside: you can also drop the plsql function whilst the fetch is running. It will kill the fetch. No DDL lock taken on the plsql function whilst select is running! Seems wrong.

    I don't know Forms but I know SQL*Plus and Oracle database. Normally PL/SQL running on the database can only access files on the host where the database instance is running even if you start PL/SQL with a SQL*Plus connection from another host.
    PL/SQL runs only the database instance not on the client side even if you start the PL/SQL code from a remote connection with SQL*Plus.

  • Snow Leopard cannot read Files or Folders with Accents written by Windows 7

    I upgraded to snow leopard on launch date in the process of ripping all my music to ALAC in OSX.
    I brought it over to windows to encode it in the batch encoder in DV poweramp using Windows 7 RC1.
    When I tried to copy the files back to OSX it could not read any files or folders with an accent in their name if they were written by windows. It thought the folders were aliases and kept trying to figure out what was wrong and mp3s it just continually tried to load.
    It cannot read them on both FAT32 and NTFS partitions however plugging the FAT32 drive in a Vista computer it was perfectly able to read the files. Any ideas why this might be? I may try writing a file with an accent in the name via Vista later.

    Whats odd, accents aren't giving me a problem but a little square unicode character is.
    http://www.fileformat.info/info/unicode/char/25a0/index.htm
    That is sorta what it looks like, maybe a bit smaller, windows can't open folders with that in it.
    Mac chokes on your a accents e and all other varieties.

  • Files and Directories with *'s

    I have a problem where I moved files and folders from a 10.4.8 G4 server on to a new 10.4.8 G5 Server with XSAN 1.4. Some of these files and folders are part numbers and have *'s in the names. Any directory or file with a * in the name appears normally on the local file system. Over AFP and SMB these files and directory names get clobbered and end up looking like 6 characters ~ and one character, or something like ADQEOI~F. Has anyone ever seen this behavior before? I'd love to just rename all of the files and folders but I'm sure my users will not approve. Any suggestions would be appreciated.

    You probably should rename the files.
    A * is specifically not allowed in a file name. What's happening is that the file is stored with the unicode representation of the character. Unicode-aware apps like the Finder can deal with this but most other apps (including the file sharing daemons) cannot and that's why you see the unusual file names.
    You're going to run into all kinds of other problems, too. Renaming your files i the best bet.

  • Reading file from AS with details

    Hi guys,
    I want to read files from a directory on AS.
    I used the FM SUBST_GET_FILE_LIST.
    It works fine, but I'd like to know the file creation date.
    I have to use this date time to decide which file I have to manage.
    I thought the MTIME field was the answer, but it returns to me a number that I don't understand.
    Any idea about it, or is there a FM that give to me the file creation date, modification date ecc
    Regards
    Jampierre

    From the description MTIME is the Unix time - "last modification date, seconds since 1970"; Meaning this number is time in seconds from 1970; Did you check out the MOD_DATE and MOD_TIME fields in the same output table?
    There are lot of threads in SDN regarding this and conversion of unix time to std date/time... please search in SDN,
    Convert UNIX timestamp into Date and Time
    Retrieve File creation date

  • Read file latest entry with time stamp from unix

    Hi
    I have a log file which is being generated with an entry  like this
    Product20080228185707,TRANSPORTED,862067_G,MPITT,20080415,ADEAMICIS,
    Product 20080229151029,TRANSPORTED,862067_G,MPITT,20080415,ADEAMICIS,
    Product 20080320163241,TRANSPORTED,862067_G,MPITT,20080415,ADEAMICIS,
    Product 20080229151111,TRANSPORTED,862067_G,MPITT,20080415,ADEAMICIS,
    I know how to read the file from Unix but How do I pick the entry with latest time stamp ?
    Please help urgent
    thanks

    Hi,
    Do like this.
    1. Declare table with two fields as name(255) type c, timestamp(14) type n.
    2. Loop at your entries and push entry name in name field and time stamp in timestamp field. You can move time stamp as: move file+7(13) to timestamp.
    3. So your new internal table will have entry names and timestamp.
    4. Now sort itab by timestamp descending.
    5. Read itab index 1.
    this will give you latest entry from unix.
    i hope this helps,
    Ags,

  • OAS Create File for Download with PL/SQL Pkg

    On OAS 4.0.8.1, I am trying to create a PL/SQL DB Pkg to allow a WWW user to extract data from the DB and download it to their local workstation, for example, a class list of student names and ids in "tab-separated-values" format.
    I think I have configured OAS and my browser to understand what to do with a MIME type of "TSV"s. I have issued the ora_util.mime_header to change the content type to "text/tab-separated-values", but all it does is send the header and the data to a WWW page. It appears that either the browser or the server does not recognize what to do with it, to prompt the browser to save the data (which is what I would like to have happen).
    I am at my wit's end trying to figure out why it is not working. I have looked at all of the documentation I can lay my hands on, with no luck. Any suggestions, experiences, incantations?
    Is what I am trying to do even reasonable? Is there a better way?
    Phil
    ====
    Phillip Brown
    Administrative Computing
    Information Services
    Oregon State University

    On OAS 4.0.8.1, I am trying to create a PL/SQL DB Pkg to allow a WWW user to extract data from the DB and download it to their local workstation, for example, a class list of student names and ids in "tab-separated-values" format.
    I think I have configured OAS and my browser to understand what to do with a MIME type of "TSV"s. I have issued the ora_util.mime_header to change the content type to "text/tab-separated-values", but all it does is send the header and the data to a WWW page. It appears that either the browser or the server does not recognize what to do with it, to prompt the browser to save the data (which is what I would like to have happen).
    I am at my wit's end trying to figure out why it is not working. I have looked at all of the documentation I can lay my hands on, with no luck. Any suggestions, experiences, incantations?
    Is what I am trying to do even reasonable? Is there a better way?
    Phil
    ====
    Phillip Brown
    Administrative Computing
    Information Services
    Oregon State University

  • Batch Reading with Custom SQL

    Hello,
    Queries
    1. Is it possible to use Batch Reading in conjunction with Custom Stored Procs/ SQL?
    2. Is it possible to map an attribute to a SQL expression (like in Hibernate we have formula columns mapped using the formula* property)?
    Background
    1. We use Toplink 11g (11.1.1.0.1) (not EclipseLink) in our application and are controlling mapping using XML files (not annotations).
    2. We are migrating a legacy application with most of its data retreival logic present in stored procedures to Java.
    3. I am effectively a newbie to Toplink.
    Scenario
    1. We have a deep class heirarchy with ClassA+ at the following having a one-to-many relation with ClassB+ and ClassB+ having a one-to-many relation with ClassC+ and so on and so forth.
    2. For each of these classes the data retreival logic is present in stored procedures (coming from the legacy application) containing not so simple queries.
    3. Also there are a quite a few attributes that actually represent computed values (computed and returned from the stored procedure). Also the logic for computing the values are not simple either.
    4. So to make things easy we configured toplink to use the stored procedures to retreive data for objects of ClassA+, ClassB+ and ClassC+.
    5. But since the class heirarchy was deep, we ended up firing too many stored procedure calls to the database.
    6. We thought we could use the Batch Reading feature to help with this, but I have come across documentation that says that it wont work if you override toplink's queries with stored procedures.
    7. I wrote some sample code to determine this and for the heirarchy shown above it uses the speicifed Custom procedure (I also tried replacing the stored procs with custom SQL, but the behavior is the same) for ClassA+ and ClassB+, but for ClassC+ and below it resorts to its own generated SQL.
    8. This is a problem because the generated SQL contains the names of the computed columns which is not present in the underlying source tables.
    Thanks
    Arvind

    Batch reading is not supported with custom SQL or stored procedures.
    Join fetching is though, so you may wish to investigate that (you need to ensure you return the correct data from the stored procedure).
    James : http://www.eclipselink.org

  • [Urgent] How to read files from different directories?

    I am new to Java Programming, I would like to know how to read files from directories other than the current one? (example as follows)
    ProjectDirectory
    |--MainDirectory
    |--MainProgram.java
    |--SupplementDirectory
    |--SupplementProgram.java
    |--Pictures
    |--Image.gif
    What should I write in the MainProgram.java so that I can use the supplementProgram.java from MainProgram and read the Image.gif file from the MainProgram.java?
    Thanks

    Run through the I/O tutorial here. It should get you up to speed on this sort of thing...

  • Using VCD file in Director

    Hello, all.
    I have this project intended to be a hybrid cd - it can be
    played as a VCD if inserted ina DVD player, and if used in a
    computer it is played as a Director projector. The issue is that
    the video file is too big, so I can´t have it duplicated, so
    I'm trying to make director read the DAT file used in the VCD. It's
    a kind of mpeg, but I can't get it right. I know it can be
    acomplished because i've seen it.
    Can anyone help me, please? Thanks in advance.

    you can create an application with VB to launch a media
    player that plays a specific DAT file.
    then launch that exe file from director with :
    _player.open("","you VB exe file path")
    or
    you can just launch a default media player (maybe, windows
    media player) from director with :
    _player.open("your DAT file path","media player of your
    choice path")
    but, this is not recommended as we don't know what media
    player applications the customer had in his/her computer.
    Try the first step. That should work.

  • How to read files in container

    I would like to read some settings from a file in my web application (deployed to to Tomcat-6.0.18). I can read files every where with this statemet: new FileReader("Settings.ini") but when I deploy my application to Tomcat It doesn't work.
    I use some JSF pages in my application when I try to read from this file in backing bean, I see this error message in console:
    java.io.FileNotFoundException: Settings.ini (The system cannot find the file specified)
         at java.io.FileInputStream.open(Native Method)
         at java.io.FileInputStream.<init>(Unknown Source)
         at java.io.FileInputStream.<init>(Unknown Source)
         at java.io.FileReader.<init>(Unknown Source)
    I put Settings.ini in all folders but still I see the message above. please help me.

    Use an absolute path rather than a relative path. The working directory might differ per environment.
    Or just place the file in the classpath and use ClassLoader#getResource() or getResourceAsStream().

  • Reading a CSV file with PL/SQL

    Hello:
    I have a CSV file provided to me by a client. We want to insert the data from this file into a table and perform other processing.
    Is it possible to call a CSV file within PL/SQL? If so, how do I begin?
    Thanks.

    Nawneet wrote:
    CSV file can load it using SQL loader
    go through the below link
    http://www.orafaq.com/wiki/SQL*Loader_FAQ
    SQL*Loader doesn't work very well in PL/SQL.
    Better is External Tables:
    http://www.morganslibrary.org/reference/externaltab.html

  • I have an external hard drive that was formatted by a PC and has files and directories etc. I want to format it and use it on my IMAC for backup but I can't seem to write to it nor can I delete current content. How do I initialize it for use with the MAC?

    I have an external hard drive that was formatted by a PC and has files and directories copied to it etc. I want to use it on my IMAC for backup. I see it on my my IMAC . I can open files etc.  But I can't seem to write to it nor can I delete current content. I don't care if I lose current content. How do I initialize it for use with the MAC?

    You can't write to it because it's formatted as NTFS which OS X will read but not write to. If you want to continue using the drive with both a PC and OS X you will need to download and install NTFS-3G so you can then write to it from your Mac. You can get NTFS-3G at:
    http://www.macupdate.com/app/mac/24481/ntfs-3g
    If you want to use the drive exclusively with your Mac then move the data off it and reformat it in Disk Utility (Applications - Utilities - Disk Utilities) as Mac OS Extended (Journaled.)

  • Is there a way to lock selected file directories with password?

    I'd like to prevent third party access to selected directories in my computer. So, I'd like to be able to lock selected directories with a password, like we can do for word/XL files. I do not prefer to create a new user for my notebook as the people  who will be using my notebook needs to use it while I am logged in.

    OS X has no such feature. However, you can encrypt the folder using Disk Utility, or create an empty encrypted container of a selected size, which will open as a mounted folder/disk when you try to access it via a password.
    http://support.apple.com/kb/HT1578
    There may be other solutions, but it would be a third party application.

  • Read files from multiple directories

    Hy to all! I have a little problem with reading files from a hierarchy of directories,something like this: directory A contains: 4 filed and directory B, and also B contains 3 files and 2 directories and so on. i want to make a method that reads all the files from directory A (including all files from subdirectory). I know i have to use recursive programming, i need a method that will be use to do this. Can U help me to do this????? Thank you all.

    Can U help me to do this?Sure. First, review basic File IO in Java: [http://java.sun.com/docs/books/tutorial/essential/io/file.html]
    Second, have a look at the numerous examples available on the Internet: [http://www.google.com/search?q=java+traverse+directory]
    Third, let us know if you run into any specific problems.
    Good luck!

Maybe you are looking for