Syntax to find "utl file"

Hi all,
I request u to pls give me the syntax to find
"utl file" from the v$parameter in oracle database.
thanks and regards
somasi

My version is 11.5.10.2I don't think it is. Unless you've travelled into the future.
The UTL_FILE_DIR parameter, as already mentioned, was deprecated a while back as it leaves your database open to security holes, meaning that unscrupulous people could access files on your o/s and cause disruption and/or loss of data.
The correct method now is to use directory objects e.g.
CREATE OR REPLACE DIRECTORY mydir AS '/user/fred/myfiles';
Then grant read and/or write permissions on that directory object to the required database users.
Then use that directory object in your UTL_FILE functions e.g.
f := UTL_FILE.FOPEN('MYDIR', 'file.txt', 'w');
Note: In the functions the directory object should be specified as a string in UPPERcase as that is how the object is referred to in the data dictionary.
;)

Similar Messages

  • Getting INVALID_OPERATION  while using UTL file

    Hi,
    I have a procedure which makes different UTL files i.e data file, error file and log file for a Purchase order. These 3 sets of files are made for every purchase order.
    So suppose in a cursor i find that there are 10 Purchase orders to process, then it should create 30 UTL files 10 sets of 3 files.
    But when i run this procedure, after processing 3 PO's i.e after creating 9 files i get INVALID_OPERATION error.
    So lets say i have 10 PO's 1 to 10 , i run for first time PO 1,2 and 3 utl files are created and then i get error. Then when i run it again processes PO number 4 to 6 and then again error...
    So i want to know is there any restriction on number of UTL files you can create in a single procedure. i want urgent help, appreciate ur quick replies on this matter.
    thanks,
    Dipin

    Hi,
    There could be several reasons for this...
    1. In inti ora file, what utl file directory was specified? is it 'C:\PLXML\DBDOM'? if not check.
    2. Do u have C:\PLXML\DBDOM\Testfile.txt in your directory?
    3. If you have above file in that directory and you have opened that file for writing purpose, close that.
    Ur program looks ok. Also, dbms_output.put_line will display 255 charcters only(at least in 7.3).
    Koti.
    null

  • Problem with utl file

    Hi to all,
    I have tried the UTL file concept as per the oracle documentation
    I have created a directory name read_flat_file and granted read, write permission to the whm user. I am trying to executing the below code as in Oracle Documentation, but I am getting this below error.
    DECLARE
    V1 VARCHAR2(32767);
    F1 UTL_FILE.FILE_TYPE;
    BEGIN
    F1 := UTL_FILE.FOPEN('READ_FLAT_FILE','HMI PO','R',256);
    UTL_FILE.GET_LINE(F1,V1,32767);
    UTL_FILE.FCLOSE(F1);
    END;
    Error I am getting is
    F1 UTL_FILE.FILE_TYPE;
    ERROR at line 3:
    ORA-06550: line 3, column 4:
    PLS-00201: identifier 'UTL_FILE' must be declared
    ORA-06550: line 3, column 4:
    PL/SQL: Item ignored
    ORA-06550: line 5, column 1:
    PLS-00320: the declaration of the type of this expression is incomplete or
    malformed
    ORA-06550: line 5, column 1:
    PL/SQL: Statement ignored
    ORA-06550: line 6, column 19:
    PLS-00320: the declaration of the type of this expression is incomplete or
    malformed
    ORA-06550: line 6, column 1:
    PL/SQL: Statement ignored
    ORA-06550: line 7, column 17:
    PLS-00320: the declaration of the type of this expression is incomplete or
    malformed
    ORA-06550: line 7, column 1:
    PL/SQL: Statement ignored
    I tried this code from system user but I got the same error.
    When I am trying the same code with the SYS User I got this error.
    declare
    ERROR at line 1:
    ORA-29283: invalid file operation
    ORA-06512: at "SYS.UTL_FILE", line 475
    ORA-29283: invalid file operation
    ORA-06512: at line 5
    I dont understand the UTL_FILE package is granted to PUBLIC role by default.
    In sys user the handler is throwing the error perfectly that invalid file operation. then why this is not occuring with other users.
    Please let me know why this is happening
    Thanks and Regards,
    Vijay

    Hi Vijay,
    There are two problems here...
    The first is that your user doesn't appear to have execute privs on the procedure. As you say, it is usually granted to public, but it doesn't look like it is for you. Check the privileges with:
    select *
    from dba_tab_privs
    where table_name like 'UTL_FILE'
    This will list who has permissions on the package. If you get nothing, grant execute to either public or to your user:
    grant execute on sys.utl_file to <user/public>;
    The second problem is a syntax error on line 5 of your procedure. Remove the ',256' bit - it shouldn't be there.
    F1 := UTL_FILE.FOPEN('READ_FLAT_FILE','HMI PO','R');
    Cheers,
    Andy Barry
    http://www.shutdownabort.com

  • Procedure error with UTL File

    Hi guys, I have got this following error within a procedure which includes the UTL File
    I think its to do with the syntax or could be missing an end if somewhere? Im not too sure.
    Here it is:
    create or replace
    PROCEDURE PJW_PRC
    IS
    -- VARIABLE
    v_out_file UTL_FILE.FILE_TYPE;
    -- VARIABLE
    v_row_Count NUMBER;
    rec_users varchar;
    BEGIN
    ---r_dca variable
    FOR r_dca IN
    ( SELECT *
    FROM dcaadditionaldata
    WHERE directory_name IS NOT NULL
    ) LOOP
    -- Confirm there are actually rows to export
    SELECT COUNT
    INTO v_row_count
    FROM ACCOUNTDETAILS
    JOIN CUSTOMERDETAILS
    ON ACCOUNTDETAILS.CUSTOMERNUMBER = CUSTOMERDETAILS.CUSTOMERS1
    WHERE EXISTS
    --Dependent if rows were found or not, below checks to see if rows are found.
    ( SELECT *
    FROM DCAACCOUNTALLOCATION
    JOIN DEBTEPISODES ON DEBTEPISODES.ACCOUNTID = DCAACCOUNTALLOCATION.ACCOUNTID
    WHERE DCAACCOUNTALLOCATION.dcaid = r_dca.dcaid
    AND DCAACCOUNTALLOCATION.status = 3
    AND DEBTEPISODES.HANDOVERDATE IS NULL
    AND DCAACCOUNTALLOCATION.ACCOUNTID = ACCOUNTDETAILS.ACCOUNTNUMBER
    AND DEBTEPISODES.DCAORLAWYER = 'DCA'
    -- Checks to see if any rows are available to export, in this case, if there are no rows (0) returned, then.
    IF v_row_count = 0 THEN
    -- No rows to export so do nothing
    NULL;
    -- Anything Else, then
    ELSE
    BEGIN
    -- Output file
    v_out_file := utl_file.fopen (r_dca.directory_name, 'DCAExport_1_' || TRIM(TO_CHAR(SYSDATE,'DDMMYYYY_HH24MISS')) || '.txt', 'W');
    -- Header
    utl_file.PUT_LINE(v_out_file,'TASK3');
    -- REC_USERS = the variable
    FOR rec_users IN
    ( SELECT
    ACCOUNTDETAILS.CUSTOMERNUMBER,
    ACCOUNTDETAILS.ACCOUNTNUMBER,
    CUSTOMERDETAILS.CDTITLE,
    CUSTOMERDETAILS.CDFIRSTNAME,
    CUSTOMERDETAILS.CDLASTNAME,
    ACCOUNTDETAILS.ACCOUNTTYPE,
    ACCOUNTDETAILS.ORIGINALCONTRACTENDDATE,
    ACCOUNTDETAILS.CONTRACTTERM,
    ACCOUNTDETAILS.CONTRACTENDDATE,
    ACCOUNTDETAILS.BRANCHAREA,
    ACCOUNTDETAILS.PRODUCTTYPE,
    ACCOUNTDETAILS.HOUSEBANKACCOUNT,
    ACCOUNTDETAILS.CARMODEL,
    ACCOUNTDETAILS.CARLICENCE,
    ACCOUNTDETAILS.ARREARSBALANCE,
    ACCOUNTDETAILS.CODEBTOR,
    ACCOUNTDETAILS.GUARANTORnumber
    FROM ACCOUNTDETAILS
    JOIN CUSTOMERDETAILS ON ACCOUNTDETAILS.CUSTOMERNUMBER = CUSTOMERDETAILS.CUSTOMERS1
    WHERE EXISTS
    ( SELECT *
    FROM DCAACCOUNTALLOCATION
    JOIN DEBTEPISODES ON DEBTEPISODES.ACCOUNTID = DCAACCOUNTALLOCATION.ACCOUNTID
    WHERE DCAACCOUNTALLOCATION.dcaid = r_dca.dcaid
    AND DCAACCOUNTALLOCATION.status = 3
    AND DEBTEPISODES.HANDOVERDATE IS NULL
    AND DCAACCOUNTALLOCATION.ACCOUNTID = ACCOUNTDETAILS.ACCOUNTNUMBER
    AND DEBTEPISODES.DCAORLAWYER = 'DCA'
    LOOP
    --same as trigger, rec_users is the variable
    UTL_FILE.PUT_LINE (v_out_file,
    rec_users.CUSTOMERNUMBER|| ',' || rec_users.ACCOUNTNUMBER|| ',' ||rec_users.CDTITLE|| ',' ||rec_users.CDFIRSTNAME || ',' ||
    rec_users.CDLASTNAME|| ',' || rec_users.ACCOUNTTYPE|| ',' ||rec_users.ORIGINALCONTRACTENDDATE|| ',' ||rec_users.CONTRACTTERM || ',' ||
    rec_users.CONTRACTENDDATE|| ',' || rec_users.BRANCHAREA|| ',' ||rec_users.PRODUCTTYPE|| ',' ||
    rec_users.HOUSEBANKACCOUNT|| ',' || rec_users.CARMODEL|| ',' ||rec_users.CARLICENCE|| ',' ||
    rec_users.ARREARSBALANCE|| ',' || rec_users.CODEBTOR|| ',' ||rec_users.GUARANTORnumber);
    END LOOP;
    --Close the file below
    UTL_FILE.fclose (v_out_file);
    EXCEPTION
    WHEN OTHERS THEN
    -- IF an error occurs while writing the file then we want to
    -- close the open file
    IF utl_file.is_open(v_out_file)
    THEN
    UTL_FILE.fclose (v_out_file)                    *-- ERROR OCCURS HERE **
    END IF;
    END;
    -- We have successfully written a file so set handover date to current date
    -- for all relevant debtepisodes
    UPDATE DEBTEPISODES
    SET handoverdate = TRUNC(SYSDATE)
    WHERE DCAORLAWYER = 'DCA'
    AND handoverdate IS NULL
    AND accountid IN
    ( SELECT accountid
    FROM DCAACCOUNTALLOCATION
    WHERE DCAACCOUNTALLOCATION.status = 3
    AND DCAACCOUNTALLOCATION.dcaid = r_dca.dcaid
    END IF;
    END LOOP;
    COMMIT;
    END PJW_PRC;
    The tables and columns stated are what I am currently using and what needs to be used.
    The error is shown in bold above producing this:
    Error(101,11): PLS-00103: Encountered the symbol "END" when expecting one of the following: := . ( % ; The symbol ";" was substituted for "END" to continue.
    Any help would be appreciated, many thanks
    Ram

    Ram wrote:
    Hmm doesnt seem to work
    another small error :(And that is? Try and compile your code in SQL*Plus and COPY/PASTE that and Oracle's response here. Use \ tags please :)                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Find a file with AppleScript

    Hi everyone !
    Is there a way to find a file using AppleScript ?
    The "find" command in the finder seems not working or I have a problem with the syntax.
    In an other hand, I dont find any way to script Spotlight...
    I hope I am wrong
    Any idea will be welcome
    JPaul

    Hi Jeanpauld,
    It works fine.
    As the final use is in a FileMaker pro data base, I
    prefer this solution.
    Glad to hear the script worked for your particular situation.
    In which dictionnary can I find SpotlightSearch ?
    "SpotlightSearch" is just what I named the subroutine of the script. You could name it whatever you like but I figured that would be a good name for it since it uses the spotlight technology to perform the search.
    As Joseph Briggs pointed out the best way to get information about the mdfind command used in the do shell script portion of the SpotlightSearch subroutine is to use the Terminal application. Launch the Terminal and type man mdfind.
    If you have any further questions regarding this command please feel free to ask and I would be glad to try and help you through it. There's quite a bit that can be done using the mdfind command!
    Thanks a lot for your help !
    Anytime Jeanpauld.
    Sorry about not replying to your response sooner but the new discussion forum format is refusing to email me letting me know when my subscriptions get updated. I used to rely on that feature and will have to keep my own eye on my subscriptions for a bit while Apple works out the bugs in the new forums.
    Take care Jeanpauld...

  • Help:Can not find the file in jar!

    Hello everyone:
    I build a project using Netbeans 5.0 and make a jar file with it...
    The code in the project as follows will throw an exception described that it can not find the file named datasource-config.xml
    String dataFilePath = getClass().getResource(dataFile).getPath();
    //System.out.println("filepath:"+dataFilePath);
    InputStream input = new FileInputStream(dataFilePath);
    when I run the project with the main() function as an entry it works perfectly and output:
    filepath:/C:/projects/java_project/search/build/classes/com/cn/wxjt/lucene/config/datasource-config.xml
    But when I compressed the project with jar and run it , it will show:
    filepath:file:/C:/projects/java_project/search/dist/search.jar!/com/cn/wxjt/lucene/config/datasource-config.xml
    there is a (!) between search.jar and /com/cn/wxjt...
    I dont know why I generate a ! symbol in the file path... Is it cause the exception->
    java.io.FileNotFoundException: file:\C:\projects\java_project\search\dist\search.jar!\com\cn\wxjt\lucene\config\datasource-config.xml
    If you have any idea, plz tell me.
    Thank you and best wishes to you !
    :)

    If the file you want to read is in your jar file, use
    getClass ().getResourceAsStream
    (relative_path_file_name)Hope that help,
    Jackhey jack i want to open the file as new File
    i m using this.getClass().getResource("resource/backend.xml");
    the resource is the directory inside the jar file.
    when i prints the url it shows:
    the jar file is in the WORK directory
    URL : jar:file:/home/neeraj/WORK/show.jar!/resource/backend.xml
    now when i creates new File using the url.getFile() method the file does not exist.
    although the same programs runs well when i uses the InputStream
    so plz tell me cant I create a new File from the above method????
    thanks in advance
    with regards
    neeraj

  • Move all my music to another folder but Itunes can't find the files!

    I have all my music on my desktop in small folders for each artist.
    But now i don't have room anymore, because i have to much music.
    So i want to move it all in to a folder called "Music". But when i do that
    Itunes can't find the files, and i have to search for each file, to find the new location instead of the desktop. How do i move my music more easily? So i don't have to synchronize it all in again, with the right album covers and that..
    Please, need some help here!

    You need to open your preferences file in iTunes and click on advance then select the location of where you put the folder.  http://support.apple.com/kb/HT4527

  • I have updated my iphone software from ios4.1 to 5.0.1(9A405) through itunes and i want to find the file which i download but i can`t find it in itunes where can i find it

    I have updated my iphone softwarefrom ios4.1 to 5.0.1(9A405) and i want to jailbreak my iphone to download cydiaafter i do that i download programe named sn0wbreeze2.8b11 but when i startedto jailbrake the programe ask me to drag&drop or browse for ipsw while ialready downloaded but through itunes i try to search on itunes store to get itand drag on this programe but i didn`t found it so, Kindly please tell me howcan i find this file to continue jailbreak my iphone if u have an answer to myproblem please e-mail me at *****[email protected]  or just reply in zis discussion

    See this
    If you can't update or restore your iOS device

  • HT3986 I've had MS Office:mac 2011 on my imac for around 18 months now.  Outlook has just disappeared and when I find the file and open it it tells me that there is a problem and I may need to re-install it.  I've just done this using the installation dis

    I've had MS Office:mac 2011 on my imac for around 18 months now.  Outlook has just disappeared and when I find the file and open it it tells me that there is a problem and I may need to re-install it.  I've just done this using the installation disc which, then said the installation had been successful.
    Outlook is still not working.  Can anyone please advise me on what to do next.

    Remove MS Office 2011 completely (here are instructions) and reinstall it.
    It's not a simple or fast process but it is important to follow all of the steps in order to get all the files that Office scatters around. This will not affect your data files, only MS Office and its preferences.

  • How Do I use TM to find a file on my computers Idisk from today's backup?

    Where do I find the file that is on my Idisk's Time Machine Backup that was on my laptop this morning when TM backed up????? My Idisk had a problem this morning and when I sought help, they had me hit the stop and restart the syncing. The problem is that even though there was a file on my Idisk on my computer from last night, the Idisk syncing reset every file from the mobileme cloud to my laptop and the file on my mobileme cloud was from 2 days ago. Not the updated one from last night. I teach and my attendance is all taken and stored on the Idisk (and synced) from all my classes. Wed & Thursday attendances were on my laptop correctly. (I know because I checked BEFORE they told me to restart the sync button on preferences. My laptop did its normal BU this morning so I am trying to find the excel attendance file on the backup. Can anyone help????????
    I don't know why that happened but it did!!!
    Thanks for any help you can provide.
    Skip

    Dear Thomas,
    I entered TM and found the sparsebundle under the Filesync library. However, it appears NOT to be recoverable and I tried double clicking on it but it doesnt do anything other than show a summary of what it is.
    By the way, I really do appreciate your comments and agree completely. Something strange happened with my syncing of Idisk (which is set to "automatic"). It has been working fine for years. But for some reason, it stopped two days ago and did not let me know. When I tried to put something manually on it (through drag/drop), it never showed up on the Idisk on the cloud which made me notice and check it out by going to Mobileme through the browser. I then went to the tech service for Idisk and they explained that something probably got corrupted so just hit STOP syncing and then hit Automatic again. Which is what I did. Then everything from the cloud went to my Idisk on my computer and for some reason, the latest version of my excel spread sheet for attendance showed two days ago, not last night. so I lost wed/thursday classes. I KNOW it was on my Laptop which is backed up to TM every morning.. Thats why I believe that the latest file IS on my TM backup for this morning. But I can't get to it. Any other help would be appreciated.
    Skip

  • Can't find imovie file on my hard drive

    I have a imovie file on my hard drive that I can't find. I really want to delete it so
    that I can free up some room on my hard rive. It's at least 15 gigs big. I tried using the search icon in the upper right hand corner and I tried using the 'find' option under the 'finder' menu, searching for any files over 5 gigs in size. Can anyone help me find this file so I can get rid of it?
    [email protected]

    An iMovie project is a package, not a file; the actual files inside it are smaller. Use a tool such as WhatSize to locate it.
    (23171)

  • I have problem with Itunes losing where podcasts and some purchased music is located. Don't know how Itunes losing the locations of the files and I can't find the files on my hard drive. What can I do to stop Itunes losing location and restore my files?

    I have problem with Itunes losing where podcasts and some purchased music is located. Don't know how Itunes losing the locations of the files and I can't find the files on my hard drive. What can I do to stop Itunes losing location and restore my files?

    Try assigning Queen as the Album Artist on the compilations in iTunes on your computer.

  • I put in my memory card to the left side of the computer, but I cannot find the file of pictures anywhere. Its not even on my desktop. What should I do and how can I get it to show up on my desktop?

    I put in my memory card to the left side of the computer, but I cannot find the file of pictures anywhere. Its not even on my desktop. What should I do and how can I get it to show up on my desktop?

    If your Mac is new-ish and has one of the Lions as its OS, the drives, cards, USB sticks no longer show up, even though they're there. Go to Finder's Preferences and tick the corresponding items in the General and Sidebar tabs.

  • My hard disk suddenly filled up and I can't find the files

    that are causing my hard disk to fill up. I was watching some videos that was on an external drive on my computer using vlc. I finished one movie (.avi file) and then tried to watch the second one in the series. However, the vlc application would not open it. I tried several times. I gave up and tried opening it with the quicktime player. Even though it opened, I got a message that my startup disk was full. That was strange because I am sure I had about 20GB as I was keeping a close eye on my hard disk capacity. I had recently deleted many video files and so I had a rough idea of how much hard disk I should have.
    Anyway, I deleted some movie files to make space and then I checked my hard disk with Disk Inventory X.
    When I did that, I found some strange files.
    There are some temp files some of which are 1GB. The path is private/var/vm/tmp. One file is labeled a Quick Time player launcher document.
    Another one is called "sleepimage". Format is HFS+. It is 4GB. It was modified recently (yesterday). Its path is private/var/vm/sleepimage.
    I don't want to delete anything important by accident.
    I just think this is strange and want to find these files but when I click "Open", it says I don't have permission and I have to locate them in Finder. However, when I type "sleepimage" in Finder, nothing comes up.
    I really want to get rid of any files that take up a lot of space on my computer and that shouldn't be there. Do you think this is some kind of virus? And that's why my computer is filling up with some strange files. There are also many swapfile documents that are 1GB in size.

    I think the problem is Quick Time Player. I am using OS 10.6.8 by the way.
    I tried it out again.
    I had about 26 GB of space before I played an .avi video.
    After the movie started to play (it was slow to load), I got a warning message that my startup disk was full. I opened Disk Utility and it told me I had no space left (about 20 MB or something like that was left).
    I watched to the end of the movie.
    Then I quit Quicktime Player.
    And I shut down the computer.
    I turned on the computer and checked Disk Utility. I have about 26 GB of space.
    I think for some reason Quicktime Player uses up a lot of the disk space when it runs movies that are problematic. This movie I was watching did not open with vlc.
    I normally use vlc to watch movies.
    Probably it doesn't use up this much space when the movie is OK.
    I think there's a problem with this particular movie. It is about 50 MB so it's not that big a file. I watch .smi subtitles with it. The Quicktime Player automatically loads the subtitle file in this case because the subtitle file has the same name as the movie file.
    I watched about 10 movie files from the same series that I downloaded together and did not have any problem watching them. I watched them on vlc. But this latest movie had problems I think (as I repeat). It did not load on vlc even though I waited for a minute, and normally movies load instantly on vlc. 
    So I think that movie file caused problems. It made QT player use up a lot of hard disk space.
    I had better avoid watching that movie in the future. I don't want it to wreck my hard drive.
    So to sum up, everything is back to normal. I have the hard disk space that I should have. However, I am scared of damaging my hard drive due to shonky movie files that eat up all the space when they are played using QT player, and so I will not watch those files in the future, as I do not know why the files do that.

  • I cant access firefox, everytime i try i get that windows can't find the file, i tried redownloading it but it still gave me the same message?

    i cant access firefox, everytime i try i get that windows can't find the file, i tried downloading it again but it still gave me the same message. the problem has nothign to do with my internet because it wonks on internet explorer and everythign is fine, my computer just can't access firefox for some reason. i tried uninstallign ti adn then installing it again, but that didnt work, i tried installing a different version and it still didnt work.
    okay the exact message is" Windows cannot find 'C:\Program Files\Mozilla Forefox 4.0 Beta 1\firefox.exe'. make sure you typed the name correctly, and then try again. To search for a file, click the Start button, and then click Search.
    Nothing happens after i install is the "Launch Firefox now" checkbox set, the same message comes up.
    i usually start firefox from the shortcut i have on my desktop but when this happened i thought that the shortcut is the problem, but i went to the Mozilla firefox folder and tried it from there, but it didnt work. i also tried downloading different versions of firefox but that didnt work either.

    can you tell me the solution to "windows cant find firefox" error. thanks.

Maybe you are looking for

  • ALUI + Windows server 2003 + WebLogic server + SSO via WIA

    Hello, I'm trying to configurate SSO on ALUI in my environment. I've got two servers. On server 1 is installed ALUI 6.5 on WebLogic server. On server 2 is installed Active Directory. Both servers are attached to one domain from active directory and b

  • Thunderbolt display not recognized

    i got this 27 inch thunderbolt. connected it to the imac (11,2 ) but somehow the display is not recognized. doesn't turn on. any ideas?

  • Migration Options???

    Im trying to migrate all my stuff from my imac to my new macbook. Ive tried connecting the two via a ethernet cable but is doesn't appear to work. I just get nowhere, after about two hours i get a message saying check your network connection etc. Her

  • UME w/MS Active Directory - Storing email address as User ID

    Thanks in advance. I am looking to store an email address as the User ID using UME and LDAP/AD.  I know that samAccountName is the UserID in active directory and it has a limitation of storing special characters like @ sign, etc.  If I want to store

  • MIGHTY MOUSE BUG! can you reproduce secondary button failure?

    The bug is extremely simple: If a user decides to move his home folder to a different partition from the system partition & correcting the path in netinfo manager to point to the external partition, the secondary button function on any mighty mouse (