Open File from PL/SQL

Problem:
Can not specify path to read a file from stored procedure.
Potential cause:
Improper configuration
Description:
I have created a procedure that opens a tab-delimited file, reads
it, and inputs it into the database. In the procedure I specify
path and name as follows:
p_FileDir := 'the_path';
p_FileName := 'file_name';
*the_path and file_name are actual paths and names.
The procedure compiles fine, but when I go to execute it I get
this error:
SQL> execute loaddata
BEGIN loaddata; END;
ERROR at line 1:
ORA-20054: LoadData: Invalid Path
ORA-06512: at "FRO.LOADDATA", line 165
ORA-06512: at line 1
I am running Oracle on Sum Solaris.
Can someone please help?
Leo.

You need to ensure that the paths you are trying to read from
are listed in the UTL_FILE_DIR init file param for your
database. Also make sure that the paths are not specified with a
trailing '/' in the init param or in the procedure input.
In case you need to update the UTL_FILE_DIR param, database will
need to be restarted for the new values to be read.
Oracle does not allow any reads for an OS path not present in
this init param. The only case when it does do so is if the
value '*' is found in the param, however I do not recommend
doing this as it could lead to a major security loophole.
Ta!

Similar Messages

  • Best way to spool DYNAMIC SQL query to file from PL/SQL

    Best way to spool DYNAMIC SQL query to file from PL/SQL [Package], not SqlPlus
    I'm looking for suggestions on how to create an output file (fixed width and comma delimited) from a SELECT that is dynamically built. Basically, I've got some tables that are used to define the SELECT and to describe the output format. For instance, one table has the SELECT while another is used to defined the column "formats" (e.g., Column Order, Justification, FormatMask, Default value, min length, ...). The user has an app that they can use to customize the output...which leaving the gathering of the data untouched. I'm trying to keep this formatting and/or default logic out of the actual query. This lead me into a problem.
    Example query :
    SELECT CONTRACT_ID,PV_ID,START_DATE
    FROM CONTRACT
    WHERE CONTRACT_ID = <<value>>Customization Table:
    CONTRACT_ID : 2,Numeric,Right
    PV_ID : 1,Numeric,Mask(0000)
    START_DATE : 3,Date,Mask(mm/dd/yyyy)The first value is the kicker (ColumnOrder) as well as the fact that the number of columns is dynamic. Technically, if I could use SqlPlus...then I could just use SPOOL. However, I'm not.
    So basically, I'm trying to build a generic routine that can take a SQL string execute the SELECT and map the output using data from another table to a file.
    Any suggestions?
    Thanks,
    Jason

    You could build the select statement within PL/SQL and open it using a cursor variable. You could write it to a file using the package 'UTL_FILE'. If you want to display the output using SQL*Plus, you could have an out parameter as a ref cursor.

  • How to call one .sql file from other .sql

    I am trying to call no of .sql files from one .sql file.
    But it gives me error in SQL*PLUS that unable to open file.
    Suggest me solution.
    Thanks
    Chanda

    Are the sql files in the current directories where sqlplus has been started ?
    If not, did you give the full path name for the called sql files when calling them from sqlplus ?
    Could you give us the complete sqlplus command that you use to call your files and the physical location of the called files with the exact error message ?

  • How can i open file from adobe reader..i already have adobe read

    how can i open file from adobe reader..i already have adobe reader installed and cannot open a
    file and i cannot convert my file into pdf..

    Is the file really a PDF? Where is it? Have you tried opening it from within Reader?

  • The dialog box open twice when open file from the server

    I use the following code to download/open file from the server:
    <%
    String filename = "MengxianhuiDocTest.doc";
    String filepath = "D:\\";
    response.setContentType("APPLICATION/OCTET-STREAM");
    response.setHeader("Content-Disposition",
    ??attachment; filename=\"" + filename + "\"");
    java.io.FileInputStream fileInputStream =
    new java.io.FileInputStream(filepath + filename);
    int i;
    while ((i=fileInputStream.read()) != -1) {
    out.write(i);
    fileInputStream.close();
    out.close();
    %>
    If the application runs, the Open or Save dialog box display.When I select open the file,
    the dialog box will display twice.
    Pls help me.
    Thanks.

    thx
    but I tried it and it did't work.
    The dialog box also display twice.

  • Open files from a specific directory

    Dear all,
    I have the following source code that simply selects files from a directory.
    private void openFile()
    JFileChooser fileChooser = new JFileChooser();
    fileChooser.setFileSelectionMode(
    JFileChooser.FILES_ONLY );
    int result = fileChooser.showOpenDialog( this );
    // user clicked Cancel button on dialog
    if (result == JFileChooser.CANCEL_OPTION )
    return;
    File filename = fileChooser.getSelectedFile();
    if (filename == null || filename.getName().equals( "" ))
    JOptionPane.showMessageDialog( this,
    "Invalid File Name",
    "Invalid File Name", JOptionPane.ERROR_MESSAGE );
    else
    // open the file
    try
         // Open an input stream
         FileInputStream fin1 = new FileInputStream(filename);
    // Read and print a line of text
    BufferedReader d1 = new BufferedReader(new InputStreamReader(fin1));
    abs = d1.readLine();
    outputArea1.setText("");
    outputArea1.append(abs + "\n\n");
    outputArea1.setCaretPosition(0);
    // Close our input and output stream
    fin1.close();
    catch (IOException e5) {
    JOptionPane.showMessageDialog(this, "Error Opening File", "Error", JOptionPane.ERROR_MESSAGE);
    } // end catch
    } // end else
    } // end private
    My question is: Can I force it to open files from a specific directory, and NOT from MyDocuments directory????
    thanks,
    vxc

    \r = return
    \n = linefeed
    \j = illegal escape character
    JFileChooser fileChooser = new JFileChooser("C:\j2sdk1.4.2\bin");
    You could/should use:
    (new File).pathSeparator
    or
    (new File).pathSeparatorChar
    and
    (new File).separator
    or
    (new File).separatorChar
    http://java.sun.com/j2se/1.4.1/docs/api/java/io/File.html

  • Can't open files from iCloud Drive on Mac

    Hi,
    Can't open file from iCloud Drive on my MacBook Air (OS X 10.10.1).
    I created new file (in Numbers for example). Then Numbers->File->Open->iCloud Drive->my_file.numbers and it says "Can't open file my_file.numbers".
    I can preview the file by pressing Space, but openning from application and double-click on it doesn't work.
    Files that were created earlear also not opened.
    Does anybody know how to solve this problem? thanks.

    Using smtp.mail.me.com - also tried smtp.me.com
    SSL yes
    port 587
    SMTP Authentification Yes
    Security SLS/TLS - also tried STARTTLS
    User full **@me.com email address - also tried user name without @me.com
    I have spoken to apple support this afternoon and we tried the variations shown above.
    Support told me to wait for a day and try again!
    After the iCloud authentication problem last night I changed all my passwords I wonder if there is an SMTP problem at me.com perhaps not reading the updated passwords?
    I'll try and use the old passwords later.

  • How can I list open files from the same application

    I often have several different files open in Word, Excel or Adobe.  However only one is visible.  How do I get a quick list of the other open files from an application?

    Many applications have a Window menu at the top of the screen. Clicking on it will list all the open windows, as well as providing other options depending on the application.
    (113485)

  • Hi, I just downloaded and installed Photoshop cc and the Camera Raw version is not the latest one available,so now I can no longer open files from my Nikon D750!  Can I update ACR?

    I just downloaded and installed Photoshop cc and the Camera Raw version is not the latest one available,so now I can no longer open files from my Nikon D750!  Can I update ACR?
    I have been using the new version of ACR with PS6 and have been able to open the D750 files,now I'm stuck.
    Thanks,
    Greg E

    You were probably using the Release Candidate version of camera raw 8.7, which one gets from Adobe Labs.
    http://labs.adobe.com/technologies/cameraraw8-7-cc/index.html

  • PSCS6 no longer recognizes my CR2 files and will not open. Using Canon 5DMark III with updated Camera Raw . It has worked before but now won't open files from this camera.

    I have been able to open files from this camera before but still checked for latest Camera Raw download. Still won't open files from this camera. Opens files from my 60D just fine. I downloaded the latest and it has worked before. What the heck is going on?

    Glad to be of help. But I'm curious (not critical of what you are doing) to know why so many people like to use Nikon Transfer to transfer their files to the computer. It is still necessary to import them into Lightroom. And, from my perspective, it seems simpler and maybe even a little quicker to use the Lightroom import dialog. I have Nikon cameras, and have never even installed the Nikon Transfer utility. What is so unique about it?

  • Can't open files from Bridge in CS6

    All was good with CS6 until today - it will not open files from Bridge. Jpg and RAW, neither will open, it's driving me bananas! Any suggestions?
    Edit: Problem solved. I had overlooked an old version of PS 7.0 was still in my program files and CS6 Bridge had picked it up as default editor. Deleted PS 7.0 and everything is back to normal. Phew!

    Lots of questions here, will see what I can add.
    For the file problem go to preferences/file type associations.  You should have the option selected CS6 for the extenstion as the default.  Might try the radio button on the bottom first to set them to default settings.
    If the 1.77g file you are refering to is the one you downloaded and used for installation you can delete it.  It is a wise choice to save it to a DVD first so in case you need it in the future you will have it.  Also save the serial number in safe place.  Acutally safe is not the right word, need to save in place where you can find it if you need it next year.  HD can fail.
    There are still thrid party plug-ins that do not work in 64 bit mode, hence the 32 bit version.  Also there is no 64 bit TWAIN so some still like to use that for scanning.
    Some users experience file association and other problems with an uninstall of past versions.  So it is safest to leave them be.
    If you want to clean up a little resist the urge to move any Adobe programs once is is installed.  Can really foul it up.

  • Why can't I open and retrieve my files from iPhoto and my address book after importing the files from my Power mac G5 to my new Mac Pro? I get a warning that says the new OS on my Pro doesn't open files from a Power Mac. Any idea how I can fix this?

    Why can't I open and retrieve my files from iPhoto and my Address Book after importing the files from my Power Mac G5 to my new Mac Pro? I get a warning that says the new OS on my Pro doesn't open files from a Power Mac. Any idea how I can fix this?

    For your addressbook, export the files to vCard on the PowerMac, then bring them over to your Mac Pro. For your iPhoto, copy the Users -> yourname -> Pictures folder to your Desktop on the Mac Pro, and open iPhoto on the Mac Pro holding the command and option keys.  Select the library file from that Pictures folder and open it.  It should import all the pictures into iPhoto as part of the rebuild process.  Other PowerPC to Intel migration issues are covered here: https://discussions.apple.com/docs/DOC-2295

  • How do I open files from an external drive?  It's plugged into the second slot to the end.

    How do I open files from an external drive?  It's plugged into the second slot to the end.  Did I plug it into the right place and how do I find the drive when trying to attach a file in an email? 

    Files on an external hard drive open just like files on the internal drive - but I get the idea that you are having a problem just finding and seeing those files. Is that correct?
    What operating system is running on your MacBook?

  • Windows client - error opening file from OS X Server

    We discovered, that some files cannot be read from windows applications via the server - Xserve 10.4.8 Server.
    When we try to open files from applications (open dialog, or double click ) via the server, the apps stop reading with errors. These errors occour not with all files!
    A copy of these files to the local Win-machines of course can be read.
    But, using a normal Win XP machine as a "server" will work fine.
    We use the latest Xserve and Software and Win XP-64 Clients with a 1000BaseT Network.
    Is there a samba issue, or can we modify some settings?
    This is really frustrating, because this was the reason why we bought the Xsever.
    Can anyone help me?
    Regards Markus

    The only thing I can offer you is a "me too".
    I have the same issue, but it only appears in some applications. My guess is that the method the application uses to open files makes the problem appear; other applications the users are using do not have this issue.

  • DW CS3 no longer opens files from SourceSafe

    Dreamweaver CS3 no longer opens files from Visual SourcesSafe
    2005 when you right-click and choose to View with DW, even if DW is
    the registered application.
    DW receives the focus, but nothing happens.
    This used to function with DW 8. I have tried it on two
    machines, both of which were fresh installs, so could not be
    conflicting with DW 8 in anyway.
    Is this a known bug?
    Matt

    It seems this is a known issue with Dreamweaver. I was able to access the files just fine by deselecting "display external links" in the view menu. Strange that I did not have to do this before.
    For anyone interested, here are some links about this: http://www.adobe.com/cfusion/webforums/forum/messageview.cfm?forumid=12&catid=18 9&threadid=1262486&highlight_key=y&keyword1=design%20mode and http://kb.adobe.com/selfservice/viewContent.do?externalId=kb401608&sliceId=1

Maybe you are looking for

  • Loading a .wav file from hard drive

    Is there an easy way to load a .wav from your hard drive? Everything I see requires applets and a URL. I don't want to use any extra packages either..I just want to use the standard ones. Thank you!

  • Can't open a text message

    Hi I received a text message from my bankwith the heading "Buddy name". However, I can't open it. when I click on it, there is not message present. Also, the message remains as unread with a blue dot next to it. I've tried quiting the Messages app an

  • AS 3.0 how to set event target?

    Hi, I am trying to execute an event on a specific target and I am not successful in doing this in AS 3.0 since event.target is read only. Here is the scenario: - I have a button and the path to this button is: DataEntry0._UpdateDeleteProd1.Form10.For

  • Check Double Invoice

    Hi, I would like to ask if there is a possible way to check for duplicate invoices for customers same as in the vendors. thanks Caglar

  • Corrupted image files

    I create files using PS.  Sometimes, these files will fail to open in PS at a later date.  The error msg is that the file is corrupted.  I can open them in Illustrator to view them.  But they are lost to opening in PS.  Why? And what can I do to corr