Rename the file to the BONE

Hi all

I need to rename a file, I use (UTL_FILE. FRENAME) to rename all the files in this code:
the syntax is : 

src=>source
dist=>distenation

  UTL_FILE.FRENAME('src_fold', 'src_file.ext',
     'dist_fold', 'dist_file.ext', TRUE);
You must first create a directory in the operating system
and put in this folder the files that you want to change the name it

I create this folder in drive C (c:\colla)
conn / as sysdba;

grant CREATE ANY DIRECTORY TO scott;

CONN SCOTT/TIGER;

create or replace directory COLLA as 'c:\colla';

now create a txt file in this folder with any name say ccc

example :

BEGIN
  UTL_FILE.FRENAME('COLLA', 'ccc.txt',
     'COLLA', 'CCCC.txt', TRUE);
END;
so far everything is fine, but if you try to add variables to the code you will see many errors and my file will be

DELETE or disappear

Like this:
create or replace procedure rename_file(dname varchar2)
  is
  v_file varchar2(30) :='CCCC.txt';
  v_lower varchar2(30);
  begin
  v_lower:=lower(v_file);
  UTL_FILE.FRENAME(dname, v_file,
       dname, v_lower, TRUE);
  end;
/

Procedure created.

SQL> exec rename_file('COLLA');
BEGIN rename_file('COLLA'); END;

*
ERROR at line 1:
ORA-29292: file rename operation failed
ORA-06512: at "SYS.UTL_FILE", line 340
ORA-06512: at "SYS.UTL_FILE", line 1186
ORA-06512: at "SCOTT.RENAME_FILE", line 7
ORA-06512: at line 1
Please help & advice

Published by: user10947262 on January 8, 2010 22:10

Published by: user10947262 on January 8, 2010 22:25

Published by: user10947262 on January 8, 2010 22:32

Published by: user10947262 on January 8, 2010 22:40

Hello

The most obvious tool to rename a file in PL/SQL, we the UTL_FILE procedure called FRENAME. Oracle docs have information on the use of FRENAME:

"The UTL_FILE. FRENAME procedure renames a file under a new name. You will rename the file userdata.txt to userdata2.txt directory USER_DIR run the SQL in SQL * more:

try something like this
{code}
@frename

connect hr/hr@orcl
SERVEROUTPUT on

BEGIN

UTL_FILE. FRENAME ('Options', 'userdata.txt', 'Options', 'userdata2.txt', TRUE);

END; /
{code}

Sarah

Tags: Oracle Development

Similar Questions

  • Renaming of files with the same file name.

    I got image files files that have been renamed properly with a file name

    1234

    and they must be 1234.jpg.

    When I open the file in Photoshop, the name of the file says 1234 .jpg.

    Can someone help me with an action or Automation (not good at writing, it, any help is appreciated) who could help me to rename these files properly without the task to open each file?

    Thank you!

    You have Finder > Preferences > advanced (on the Mavericks) configured to display file extensions?  The ".jpg" is perhaps already there.

  • Cannot rename the folders or files

    Hello

    I have an older Toshiba laptop that works under Windows XP. For some time, I can't rename my files or folders. I looked at the properties and noted that they are marked as "read only". I change it and apply it, but then he doesn't remember this setting and goes back to read-only.

    When I click on 'File' link 'Rename' is gray and I can't do a right-click on the name so that it can allow the amendment. I do not understand why this should suddenly happen, I've looked through the different menus and settings and you don't see nothing obviously wrong! Help, please!

    See you soon

    GMC

    seems that something in your registry is not clear. In this case I reinstall the operating system and back up your files that cannot be renamed.

    Otherwise, if you want to keep the operating system, and then simply click on the following link and read this thread (check the last post...): http://www.annoyances.org/exec/forum/winxp/t1131736977

    That should help you.

    Welcome them

  • Searching for files and rename the file

    In my C:\, I have a number of files, namely C:\myfolder1, C:\myfolder2, C:\myfolder3... and in each folder, I have several text file *.txt.

    I want to have a code that go all C:\myfolder* and rename the text in file bin, for example. ABC.txt to the abc.bin.

    I know I can do this easily by using the command line. But how can I do this in LV?

    Essential is to know how to go through all the myfolder? *

    To my knowledge there is no direct function to rename, but you can do this by moving the file and stick with the target file. See the attached example.

  • Windows Update doesn't have a download, the rename.bat file created without success

    I tried to do the Windows updates, and it would not download.  I tried everything, including the creation of a rename.bat file.  From what I read, I had to double-click on the rename.bat to attach the download of Windows.  I was not able to do.  Can anyone help?  I don't understand how completely.  I tried double clicking and just, it flashes and goes away and then the update will not download.  Help, please?

    http://www.Microsoft.com/downloads/en/default.aspx

    Put the number in the search at the above link > download it manually.

    If this does not solve it:

    Windows Update Forum:

    It comes with Vista, upgrade install and activate Forum.

    You will get the best help for any problem of Update/Service Pack in the Windows Update Forum; the link below:

    http://social.answers.Microsoft.com/forums/en-us/vistawu/threads

    When you repost here, kindly include the Error Codes, and exactly what is happening when you try to update.

    In this way, you will receive the best help.

    See you soon

    Mick Murphy - Microsoft partner

  • How to rename multiple files with the extension in windows xp

    How to rename multiple files with extension in windows XP.

    1. If you want to simply rename the extension, open a run window (Windows Logo key + R), type cmd and press ENTER. Using the CD (Change Directory) command, navigate to the folder in question. Now, type ren *.mp3, *.mp4, and press enter (note the two spaces in the command). Note, rename mp3 MP4 is just an example of the command.

    2. If you want to rename files, download the 32-bit version or 64-bit Bulk Rename, here http://www.bulkrenameutility.co.uk/Main_Intro.php

  • How to rename multiple files in the XP command prompt

    I have several files. I want to Rename these files at once in the command prompt so that these files have become
    some easy to use in some applications.

    name (1) .jpg
    name (2) .jpg
    name (3) .jpg
    name (4) .jpg
    name (5) .jpg
    name (6) .jpg
    name (7) .jpg
    name (8) .jpg
    name (9) .jpg
    name (10) .jpg
    name (11) .jpg
    name (12) .jpg
    name (13) .jpg
    name (14) .jpg

    so I want to rename these files as
    1. jpg
    2.jpg
    3jpg
    4.jpg
    5 jpg
    6 jpg
    7 jpg
    8 jpg
    9 jpg
    10 jpg
    11 jpg
    12 jpg
    13 jpg
    14 jpg

    Please please please... Someone help me to do this...

    Thanking you...
    Jacky, Bangalore.

    create a file like x1.bat

    off @echo
    Set /a counter = 00
    for %% in (*.jpg) called X 2. BAT %%d KB

    -------------------------------------

    Create another file as x2.bat

    off @echo
    call the x 3. BAT

    file%counter%.jpg Ren %1

    -------------------------------------

    Create another file as x3.bat

    off @echo
    Set /a counter = counter % + 1

    --------------------------

    place these files in the directory of the image or file.

    then run the file x1.bat

    who's going to rename all the files in time sequentially.

    I think it will help you to rename several files at once with a dry.

    Thank you once more...

    If a problem occurs, please answer me.
    If I can I'll tell u...

  • an error occurred trying to rename a file in the destination directory code 5

    When I try the installed software on this time its error getting
    ; an error occurred trying to rename a file in the destination directory code 5

    Hi Sissi,

    1. What is the full error message do you get?

    2. This only happens when you try to install a particular program?

    3. using the administrator account?

    Step 1:

    You can try to take ownership of the file or the folder and check.

    How to capture a file or a folder in Windows

    Step 2:

    I also suggest you temporarily disable the antivirus software third and firewall on the computer and check to see if that fixes the problem.

    If disabling the antivirus software solves the problem, you may need to configure the settings of the antivirus as a result program. Please contact the software vendor for assistance in this regard.

    Note: Make sure that you enable the antivirus software, other security and firewall after the test programs.

  • Rename the files & folders with a single command?

    I would like to rename a file folder and all the files & documents it contains.  The name is xxNAMExx I want to replace the part of middle NAME.  How can I do?

    Download the 32-bit version or 64-bit Bulk Rename, here http://www.bulkrenameutility.co.uk/Main_Intro.php

  • I've renamed the images in a file and now they are all out of control, how to make their return to the original order

    I opened a drive with my camera phone, then renamed the photos with brief descriptions, and now they are all out of order. How to make back in the original order they appeared.

    Dennis

    Renamed files are apparently to be sorted by alphabetical order.
    It is the normal behavior of Windows.

    If you open the folder in question and go to... View / details... and
    Select the column that says: "Date picture taken", she should use
    photos.

    Also you can drag and drop photos to change position.

    Once you have pictures in the order you need... you can re-
    Number them in a batch to maintain order.

    Just go to... Edition / select all... right click on the first file name and choose...
    Rename... Enter the next number...

    .jpg (10001)

    Press Enter and the remaining files will be named in the order.

    You can also add a word if you want to identify the group.

    Summer vacation (10001) .jpg
    (Yes, there is a space between the letter n and the first parenthesis)

  • When you rename a file change the last timestamp consulted?

    I was in a heated debate with one of my instructors today associated with a test on the access timestamp question when you rename a file. Through my research and testing to rename a file via the command prompt, it does not appear that the process of renaming a file will change the date of that last file access. Access and modify times will change to the directory that contains the file, but not the file itself.  So my understanding is that it is not, however, my instructor insists that it is, can someone shed some light on this topic please?

    Reading material more - it's interesting.

    More information under:

    Windows NT keeps track of three stamps of time associated with files and directories. These three temporal are written in creation, last access, and last. When a file or directory is created, accessible or changed, Windows NT updates the appropriate time stamp.

    http://support.Microsoft.com/kb/148126/a

    NTFS uses the change log to track information on the added files, deleted and changed for each volume.

    http://TechNet.Microsoft.com/en-us/library/cc938919.aspx

    Working with file systems

    http://TechNet.Microsoft.com/en-us/library/bb457112.aspx

  • Rename the name of a file in Sansa Clip +.

    Why can't I rename a file or folder name in the Sansa clip +. ???

    It is a big problem in Sansa.

    I should rename my file name before you plug it into the computer to transfer.

    There are some who have problems of "naming" when you use MTP mode. In fact, sometimes this mode will be re - their name to something totally different from what they were originally. I would try formatting your player, which will erase all content, switch to MSC mode (settings > system settings > USB Mode) and re - transfer your files back. You should be able to name them as you wish.

  • Renaming of files exe with the same name

    I have

    just installed a game on steam.  The package ended up being buggy, so it did not work.  But I found a solution on the Forum and he told me to rename these two files exe under the same name.  Its the only way to fix the game.  Others did and cela worked.  When I try to rename the file an error pops up telling me that I can't have two files with the same name.  In summary, this is what is happening.

    two files are: prince of persia.exe and princeofpersia_launcher.exe .

    Need to rename it to princeofpersia_launcher.exe to the prince of persia.exe

    An error pops up saying ERROR RENAME FILE or FOLDER: cannot rename princeofpersia_launcher: a file with the specified name already exists.  Specify a different file name.

    The problem is that these two exe files MUST have the name of prince of Persia: work.  Is it possible that I could do?

    It is not possible to have two files with the same name in the same folder.  Something is wrong with the instructions that you try to follow.  What do say exactly?  Can you give us a link for them?
    Boulder computer Maven
    Most Microsoft Valuable Professional

  • Rename the folder to the user files

    In Vista, I can't rename a folder of the user.  This computer used to be used by someone else, and I can't rename the folder so everything I do Gets the tag with his name on it.  I changed the name of the computer and log in name.  Can I change any other user except this one folder.  Any ideas how to rename this folder?

    It sounds like a problem with permissions for me (he does not resemble a corrupted profile) - you try to use its files under your user name and the system wants as his user name.  The solution is to give your full user name to all records in his profile and then to take possession of all the files in the profile - then you will have the rights you need.

    To view your permissions, right-click on the file/folder, click Properties, and check the Security tab.  Check the permissions you have by clicking on your user name (or group of users).  Here are the types of permissions, you may have: http://windows.microsoft.com/en-US/windows-vista/What-are-permissions.  You must be an administrator or owner to change the permissions (and sometimes, being an administrator or even an owner is not sufficient - there are ways to block access (even if a smart administrator knows these ways and can move them - but usually should not because they did not have access, usually for a very good reason).)  Here's how to change the permissions of folder under Vista: http://www.online-tech-tips.com/windows-vista/set-file-folder-permissions-vista/.  To add take and the issuance of right of permissions and ownership in the right click menu (which will make it faster to get once it is configured), see the following article: http://www.mydigitallife.info/2009/05/21/take-and-grant-full-control-permissions-and-ownership-in-windows-7-or-vista-right-click-menu/.

    To resolve this problem with folders, appropriating the files or the drive (as an administrator) and give you all the rights.  Right-click on the folder/drive, click Properties, click the Security tab and click on advanced and then click the owner tab.  Click on edit, and then click the name of the person you want to give to the property (you may need to add if it is not there--or maybe yourself). If you want that it applies to subfolders and files in this folder/drive, then check the box to replace the owner of subcontainers and objects, and click OK.  Back and now there is a new owner for files and folders/player who can change the required permissions.  You can change now switched to read-only (even if the main folder indicates that they are always read-only - you can access yourself as the owner).  You can keep them in read-only to other users, customers and administrators even (although they can support themselves and access, if they wish, and it is really not that you can do to stop it except protect the file with a password by using a 3rd party product).  This should also give you access to open and work with all of the files in these filders, as if they were in your file.  Here is more information on the ownership of a file or a folder: http://www.vistax64.com/tutorials/67717-take-ownership-file.html.  To add take ownership in the menu of the right click (which will make it faster to get once it is configured), see the following article: http://www.howtogeek.com/howto/windows-vista/add-take-ownership-to-explorer-right-click-menu-in-vista/.

    You can also create a folder in your profile named username of the other person and move the files in this folder.  He needs to pick up the permissions and attributes of the new folder (YOUR user profile folder) and you won't need to go to his profile whenever you want to get one of his records.  You may still need to change the permissions and/or ownership if you do this - it would be just to make things easier and quicker to access.

    Good luck and I hope this helps!

    Lorien - MCSA/MCSE/network + / A +.

  • Rename the files/folders WARNING

    I want to put in place a prompt when a user tries to rename files or folders. Instead of rename automatically, I want to have a prompt that displays something like: are you sure you want to rename this file/folder? I've seen other systems use these guests and I wonder if its possible to put up on my computer as well.

    Hi HK2424,

    Usually, we get the prompt when we try to change the extension of a file and not to rename the file. You should have seen the prompt for changing the file extension and no change in file name.

    There is no option to activate the command prompt to rename files.

    Hope this information is useful.

    Jeremy K
    Microsoft Answers Support Engineer
    Visit our Microsoft answers feedback Forum and let us know what you think.

    If this post can help solve your problem, please click the 'Mark as answer' or 'Useful' at the top of this message. Marking a post as answer, or relatively useful, you help others find the answer more quickly.

Maybe you are looking for

  • Instructions to set the master password - where is Options?

    I want to set a master password (Thunderbird on MacBook OS X Yosemite 10.10.5).) Instructions to begin with 'at the top of the Thunderbird window, click the Tools menu, and select Options.but I do not get an Options I can select (see screenshot). Cle

  • Why when I including an email tab I get click.email in the address line of Firefox?

    Most of the time when I click on a tab in an email in Thunderbird, Firefox comes up with "http://click.email" instesd of "http://www." as it should. Some ot the time I get out of the "click.email" and enter "www." and it's going to happen, but most o

  • Satellite M70: What DVD supermulti drive model?

    HelloAnyone who has satellite M70 series please tell me, what is the model number of his dvd supermulti player?(for example: carpet * a dvd - ram uj-830 s!) thnx

  • Divisions of the auto and Auto precision in graphs

    Hi all Just a question about the functioning of divisions and accuracy on a line graph when the value VAL_AUTO.  I know what is happening on the scale when it is done automatically, but what is the basis of precision auto and auto divisions?  There a

  • limit internet access

    I can't connect to the internet. My router works well as my other devices work well. I have laptop CAREB. Windows 7 every time I try to connect it gives limited access. Someone told me to uninstall and reinstall drive device manager... Unfortunately,