How do we refer Sub directories using UTL_FILE command

Hi Gurus,
I have created a DIRECTORY My_project using CREATE DIRECTORY COMMAND. This directory is linked to my OS D:\My_project folder.
There are several sub directories under My_project folder such as D:\My_project\Outfile folder which I would like to refer while using UTL_FILE command to process files.
When I try to run the following PLSQL
DECLARE
out_file utl_file.file_type;
l_line VARCHAR2(100);
BEGIN
out_file :=UTL_FILE.FOPEN('My_project\Outfile','abc.txt','w');
l_line := 'HELLO TESTING';
utl_file.put_line(out_file,l_line);
UTL_FILE.FCLOSE(out_file);
EXCEPTION
WHEN no_data_found then
UTL_FILE.FCLOSE(out_file);
when others then
raise_application_error(-20912, 'Others ' ||sqlerrm);
END;
I get
ORA-29280: invalid directory path
error.
As there are many directories involved under My_project folder and there will be new directories created in the future as well, so I was wondering if there is a way to read files from any sub directory of My_project directory
Please advise. Thanks for all your help.

Hi Anto!
Try it like this:
out_file :=UTL_FILE.FOPEN('My_project','Outfile\abc.txt','w');I hope this helps!
your sincerely
Florian W.

Similar Messages

  • How to get Systemstate Backup size using PowerShell command in Windows 2008 R2

    Hi,
    We using WBSummary command to get completed backup status.
    I need to find how much data is backed up  using powerShell command .
    Is there any way to get the details , i can see the GUI but no in command.
    Please advise
    Regards Gopi K

    Hi,
    You mentioned that you can see the system state backup size in the GUI. Does the backup size mean the amount of date transferred?
    It seems that there is no such a PowerShell to get Systemstate Backup size. You may need to you need a PowerShell scripts to do this work.
    http://social.technet.microsoft.com/Forums/windowsserver/en-US/home?forum=ITCG
    Regards,
    Mandy
    We
    are trying to better understand customer views on social support experience, so your participation in this
    interview project would be greatly appreciated if you have time.
    Thanks for helping make community forums a great place.

  • How to load the boot menu using the command line , after the configuration change ?

    how to load the boot menu using the command line , after the configuration change ?

    Hi @Bask-48 
    Welcome to the HP Forums!
    It is a terrific place to find answers.
    For you to have the best experience in the HP forum I would like to direct your attention to the HP Forums Guide Learn How to Post and More
    I grasp you are trying to change the boot order.  Here is a link to Configuring the Boot Order in the System BIOS
    that will assist you.
    Good Luck and Happy Holidays!
    Sparkles1
    I work on behalf of HP
    Please click “Accept as Solution ” if you feel my post solved your issue, it will help others find the solution.
    Click the “Kudos, Thumbs Up" on the bottom right to say “Thanks” for helping!

  • How to verify ISAKMP Aggressive mode using show command only?

    How to verify ISAKMP Aggressive mode using show command only?

    Ah OK, my mistake. I was thinking ASA - I believe you are using an IOS-based VPN.
    The state after establishment should be "QM Idle" (quick mode) - whether the Phase 1 was MM or AM.
    I think you'll only see the AM in the debugs (like you have) or if you watch the output of the "show cry isa sa" command during establishment of the Phase 1 SA. If you're quick, you may see it cycle through as shown in this reference:
    http://www.cisco.com/c/en/us/td/docs/ios-xml/ios/security/s1/sec-s1-cr-book/sec-cr-s3.html#wp5743341910

  • How to read a .CSV file using UTL_FILE

    HI,
    How do i read a .csv file line by line using UTL_FILE?
    Thanks in advance
    Regards,
    Gayatri

    ----do open the file logic
    begin
    ----Let's say this file is delimited by ','
    ---declare variables
    v_startPos number; -- starting position of field
    v_Pos number; -- position of string
    v_lenString number; -- length
    v_first_field varchar2(30);
    v_second_field varchar2(30);
    v_third_field varchar2(30);
    v_fourth_field varchar2(30);
    input_String varchar2(1000); -- buffer for each line of file
    ----Say you have a 4 column file delimited by ','
    delimitChar varchar2(1) := ','
    Joe;Joan;People;Animal
    Teddy;Bear;Beans;Toys
    begin
    loop
    utl_file.get_line(input_file, input_String); -- get each line
    ---- this will get the first field as specified by the last number
    v_Pos := instr(input_String,delChar,1,1);
    v_lenString := v_Pos - 1;
    v_first_field := substr(input_String,1,v_lenString);
    v_startPos := v_Pos + 1;
    -- this will get the second field
    v_Pos := instr(inString,delChar,1,2);
    v_lenString := v_Pos - v_startPos;
    v_second_field := substr(input_String,v_startPos,v_lenString);
    v_startPos := v_Pos + 1;
    -- 3rd field
    v_Pos := instr(inString,delChar,1,3);
    v_lenString := v_Pos - v_startPos;
    v_third_field := substr(input_String,v_startPos,v_lenString);
    v_startPos := v_Pos + 1;
    -- last field -- there is no delimiter for last field
    v_Pos := length(input_String) + 1;
    v_lenString := v_Pos - v_startPos;
    v_fourth_field := substr(input_String,v_StartPos,v_lenString);
    end;
    EXCEPTION
    WHEN no_data_found then
              fnd_file.put_line(FND_FILE.LOG, 'Last line so exit');
              exit;
    end loop;

  • How I search only sub directories in my bookmarks?

    If I do search Firefox searches through all my bookmarks. I only want it to search in the current directory and/or sub directories.
    I do not want to use tags. I just want to search for the name.

    Is there any add-ons that I can use to make searching my bookmarks useful. It is now getting beyond frustrating. I can not believe this program doesn't have a useful way to search.

  • How do I create a partition using diskutil command

    I've shrunk my original partition and now filevault2 has converted it to corestorage, as follows:
    $ diskutil list
    /dev/disk0
       #:                       TYPE NAME                    SIZE       IDENTIFIER
       0:      GUID_partition_scheme                        *500.1 GB   disk0
       1:                        EFI                         209.7 MB   disk0s1
       2:          Apple_CoreStorage                         315.3 GB   disk0s2
       3:                 Apple_Boot Recovery HD             650.0 MB   disk0s3
    Now Disk Utility tells me it won't create any new partitions, and to use the command line "diskutil". I guess it doesn't work with anything other than HSF or FAT.
    But, reading "man diskutil" reveals no command option to add an individual partition. Can someone help .. what is the option to add an additional partition without disturbing the others? As I read it, partitionDisk and splitPartition are both destructive. I see that resizeVolume is non-destruction, but I'm fearful of making any changes to the 4 existing partions, since they're all System partitions.
    And, while I'm asking, I also don't see any remove option listed .. maybe mergePartitions, but again, I'd be reluctant to merge something into one of these system partitions for fear of killing it?
    regards,
    Paul

    AFAIK, you have to turn off FV2, restart, and then repartition. But, that's just a WAG.

  • How to encrypt file on linux using Gnupg command in Java Embedding in BPEL.

    Hi All,
    I am trying to invoke a command script using the java embedding in BPEL Process.I am using the below code to execute the particular command to encrypt the file :-
    try {    
            Runtime rt = Runtime.getRuntime();    
    Process pr = rt.exec(new String[] {"/bin/bash", "-c", "/u01/GnuPG/bin/gpg", "-e", "-r", "Developer","/u01/oracle/ConfigFiles/Adapter_controlDir/abc.csv"});    
             int exitVal = pr.waitFor();            
            String result = "SUCCESS: Process exit with " + exitVal;         
            addAuditTrailEntry("result = "+result);      
            setVariableData("outputVariable","payload","/client:processResponse/client:result",result);    
    } catch(Exception e) {    
            e.printStackTrace();      
      String result = "FAILURE: Exception with " + e.toString();    
            addAuditTrailEntry("result = "+result);      
            setVariableData("outputVariable","payload","/client:processResponse/client:result",result);    
    The above statement does nothing. I am not sure what command i need to use to access to the command line.
    When i try this particular statement from linux machine command prompt :- /u01/GnuPG/bin/gpg -e  -r  Developer /u01/oracle/ConfigFiles/Adapter_controlDir/abc.csv
    It works absolutely fine and it creates the encrypted files also.
    Please suggest , which command i need to use from the java embedding.
    Please suggest!!
    Regards,
    Shah

    I think, you can try, writing these commands into a separate shell script and call that shell script from bpel via Java embedding. However, you might not get a return response.. but you can still give a shot.
    Hope it helps.

  • How to change to.pac file using CLI command ?

    I've asked this before but have not had much luck getting an easy fix.
    I need to change a large number of machines over to using a pac file instead of the current settings for secure and web proxys.
    It's not possible using 10.4 CLI command networksetup but I'm wondering if anyone may have another way of doing this ? Possibly a script or something ???
    Mitch

    Hi Min,
    You should move this question to Unified Communications Application community to get the expert answer on IP phone configuration. This community is for Cisco WebEx Meetings Server and Cisco Unified MeetingPlace products.
    Thank you.
    -Dejan

  • How to look at DB size using ESSCMD commands.

    Hi,
    Is there anyway in ESSCMD to find the db size??
    Pls suggest.
    TIA,
    Vamsikrishna.

    Or you could move away from esscmd if possible and try some maxl
    Query database dbname list all file information;
    Cheers
    John
    http://john-goodwin.blogspot.com/

  • How to upload data using utl_file when you dont know the exact file name

    Hi
    i want to upload data from a flat file to a table.
    i dont know the exact file name. i want to make a search for filename. like i want to make a search on file (say test*) which will give me all the files with test.
    i want to upload data using these files.
    how can i do this by using UTL_FILE.
    Regards
    Manish

    Thank you very much.
    Thing is previously we are using sqlloader and shell script for loading the data.
    now i am creating a procedure (if possible without parameters).
    Is there any other way i can do that.
    can i make a wild card search using utl_file.
    Thanks n Regards
    Manish

  • Can't read text file using UTL_FILE

    Hi All,
    how can I read notepad file using UTL_FILE package.I have specified the UTL_FILE_DIR in the init.ora file.My objective is to when a button is clicked, the contents of the file will display in a text item.Here is my code written in WHEN_BUTTON_PRESSED trigger.
    DECLARE
         file_handle UTL_FILE.FILE_TYPE;
    data_line Varchar2(100);
    BEGIN
         file_handle := UTL_FILE.FOPEN('E:\vimal','abc.txt','R');
              message('directory created');
         UTL_FILE.GET_LINE(file_handle, data_line);
         :block2.t1 := data_line;
         UTL_FILE.FCLOSE(file_handle);
    END;

    Why don't you use text_io? Don't forget that UTL_FILE is reading directories from the database point of view. The E drive for the database is a different E then on your client pc. I presume your database is on a different computer. Are you getting any errors?

  • ADD A SECOND LISTENER USING SRVCTL COMMAND

    Hi All,
    My RAC has w nodes (10g 10.2.0.4)
    it already has a default listener (NODE1_LISTENER1 in ASM home port 1521) register with the CRS and i already create a second listener manually on both nodes.
    My question is how to add this listener (NODE1_listener1) using srvctl command not the netca
    Thanks in advance.
    Regard,
    Tom

    srvctl add listener is not support in 10g ,
    but in 11g you can add listener using srvctl
    10g:
    http://download.oracle.com/docs/cd/B19306_01/rac.102/b14197/srvctladmin.htm#RACAD5002
    11g:
    http://download.oracle.com/docs/cd/B28359_01/rac.111/b28254/srvctladmin.htm#CDCEECFB
    So, You need to use netca to help on 10g

  • 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.)

  • How do I use UTL_FILE to insert a large number of fields to a file?

    Hi
    I am trying to use UTL_FILE for the first time in a Stored Procedure. I need to run a complex query to select 50 fields from various tables. I need these to be inserted into one line in the output file for all rows. Is this possible? My procedure so far is like the following
    CREATE OR REPLACE PROCEDURE PROC_TEST IS
    output_file UTL_FILE.FILE_TYPE;
    BEGIN
    FOR query in (SELECT FIELD1, FIELD2, ..........FIELD50)
    FROM TABLE A, TABLE B
    WHERE A.ID = B.ID
    ETC
    LOOP
    UTL_FILE.PUT_LINE(output_file, <put all 50 fields for all records into file> );
    END LOOP;               
    UTL_FILE.FCLOSE (output_file);
    EXCEPTION
    WHEN NO_DATA_FOUND THEN
    NULL;
    WHEN OTHERS THEN
         UTL_FILE.FCLOSE_ALL;
    RAISE;
    END PROC_TEST;
    Do I need to define 'query' (after the FOR) anywhere, also please advise with how I put all of the fields into the file.
    Thanks
    GB

    Thanks Steve,
    I have the UTL_FILE working fine now.
    I have other queries to run and conditions to apply in the same procedure, and I need to schedule via Enterprise Manager, therefore using UTL_FILE in a procedure seemed the best option. I looked up Data-pump but this seems to be an 11g feature, and we are still on 10g therefore I will not be able to use it.
    Thanks for your help.
    GB

Maybe you are looking for

  • Menu Bar SubMenu position issue

    Hi, I have an horizontal menu on my site which works, but I'm starting a new version of the site and there my submenus display in a weird position (in IE only) and with a transparent background. I read about the z-index bug, but couldn't find or unde

  • Edi inbound order

    dear all i created sales order with the help of inbound idoc and order is created in the system..but i want see the idoc(inbound) from my sales order..not in we02 or we05 i searched VA03 there is field called SERVICE FOR OBJECT...but it is saying no

  • Audio input volume in System Preferences, but not Mainstage

    Hi, I am trying to get Mainstage 2 to work with an audio interface (TASCAM US-122 MKII). I've installed the drivers for the interface, and it shows up on my system both in System Preferences under Audio and in Mainstage. When I go to system preferenc

  • Strange bug in GO-OpenOffice 3.1 regarding file opening of long names

    I've noticed a very annoying bug regarding go-openoffice 3.1.0.99.2-1, reproduced by me multiple times. When I try to open some kind of file, regardless of what it is (could be an .ODT or .DOC), and do this by selecting it with File->Open, OpenOffice

  • 11i patches for windows 2000 server

    Can any one let me know about the patches that have been released for 11i installations on windows 2000 server.