check the existnace file before using the HOST command

Dear all:

We use the version of forms 6i 6.0.8.22.1

I wrote after encoding to move a local system file to another location: following coding works to move the file.


DECLARE

in_file_name VARCHAR2 (100);
in_file_path VARCHAR2 (100);
out_file_path VARCHAR2 (100);
the_command VARCHAR2 (2000);
BEGIN
in_file_name: = pk_parameter.setting('IMGSFILE');
in_file_path: = pk_parameter.setting('IMGSPATH');
out_file_path: = pk_parameter.setting('IMGTPATH');

the_command: = 'move' | in_file_path | in_file_name |
' '|| out_file_path | out_file_name;

Synchronize;
Host (the_command, NO_SCREEN);
IF this is Form_Success THEN
Message ('error - file is not moved');
ON THE OTHER
Message ("file moved successfully");
END IF;
END;


above code returns TRUE in stand conditions if the file is exist in the given folder or not? I checked it twice.

1: place the file in the folder source and then run the coding, it returned message like "file moved successfully.

2nd: the source folder is empty, when I have executed the coding, it returned message like "file moved successfully.

Now I want to check before running the command move, if the source files exist in the source folder, if yes, then move on the other on-screen message and raise form_trigger_failure;

any idea of guru?

Kind regards

Hassan Raza

You must use the command line to do:

host('cmd /c move '||in_file_path||in_file_name||' '||out_file_path||out_file_name, no_screen);

to check if the file has been properly moved, you can use text_io:

declare
  xfile text_io.file_type;
begin
  xFile := text_io.fopen(out_file_path||out_file_name, 'R');
  text_io.fclose(xFile);
  --file exists
exception
  when others then
    if text_io.is_open(xFile) then
      text_io.fclose(xFile);
    end if;
    -- file does not exist, so moving was not successful
end;

concerning

Tags: Oracle Development

Similar Questions

  • How to recover files before using the recovery disk?

    Hello

    I have a Toshiba Equium and when I turn it on it loads the screen where you log does not appear, it has a black screen with a mouse, and I need to use the recovery disk to get back to normal, but I don't want to format the hard drive that I have a lot of files so it is anyway to recover the files?

    Hello

    In my opinion the easiest way is you remove the laptop HARD drive and put it in a box external HARD disk. Then, you can connect this external HARD disk to a different computer now and have access to the files on your HARD drive and you can perform a backup.

    An alternative you can boot from a Linux Live CD and back up your files on a different USB devices.

  • Check the local or global index

    Hi all
    I wanted to know how we confirm/check if an index is local or global on a system of oracle 10 g 2

    Thank you
    Rossy.Rocs

    Lacotte,

    Small correction was need here that the partitioned dba_indexes column will only be "indicates whether the index is partitioned (YES) or not (NO); While op asks how do I know if it is a local or global index. So for that he must check the below command:

    SELECT INDEX_NAME, THE LOCALITY OF USER_PART_INDEXES;

    Column of the locality of user_part_indexes ' indicates if the partitioned index is local (LOCAL) or global (GLOBAL).
    http://download.Oracle.com/docs/CD/B19306_01/server.102/b14237/statviews_2015.htm#REFRN20156

    Concerning
    Girish Sharma

  • Need to convert vmdk using pRDM vmkfstools command

    Need to convert to pRDM vmdk format command. tried to convert using cold migration that it stuck at 23 percent. Are there vmkfstools or powercli to convert?

    You can try the host command line is:

    vmkfstools -i /vmfs/volumes/source-ds/source-vm/source.vmdk/vmfs/volumes/target-ds/target-vm/target. VMDK

    You can optionally add thin d in case you want to that thin target to be configured.

    What you need to do - before running the command - is to ensure that the size of the disk in the hard file corresponds to the actual size of the LUN in case the LUN has been resized / increased at some point.

    André

  • Trying to backup computer, get the error message "the C: drive has errors" "Windows has detected corruption of file system on C:. You should check the drive for errors before you can restore it. »

    I'm trying to back up my computer and so I went to back up files and attempted to save DVD RW Drie (f), then recovery (E :).  Then in the form following, I clicked on next, and I get the message "the C: drive has errors" error "Windows has detected corruption of file system on C:. You should check the drive for errors before you can restore it. "I hit the" check the drive for errors and it told me that windows can't check the disk in use then I hit the schedule disk check. "  and then nothing happened.  What should I do?  How can I save my files?

    I planned it, rebooted, and nothing happened.  I have tried three times now

    Hey Ruffscicle

    read the information on how to run the check disk at the link below vista64.com

    If the first method does not work, try the other methods

    http://www.Vistax64.com/tutorials/67612-check-disk-Chkdsk.html

    have a Happy New Year

    Walter, the time zone traveller

  • Windows gives me an error message that the selected drive has been "marked as potentially damaged - check disk before use as back up.

    I am trying to set up a window to the top-

    -follow the instructions of top to select a backup disk - I did
    -Windows gives me an error message that the selected drive has been "marked as potentially damaged - check disk before use as back up.
    -in the past, this disc has been used ONLY as a backup disk
    -When you try to check (after Windows links) a message tells me the drive cannot be checked while it works - I have no problem with understanding that.
    -I wonder so I wish "disassemble this first volume" - "... all handles opened to this volume will become invalid..."
    -Do not understand what was required - and having no idea of the consequences (the disc 'way up', and what happens to the invalidated handles?) I replied "Cancel".
    -l' screen after you ask then if I want to check for errors at the next startup of my computer - I clicked on the button "schedule disk check.
    -When I started my computer nothing happened - what happened to "schedule disk check? How can I check the disc when firstly, it seems to be 'in service', but is only a backup to disk, and I thought that it only came into use when the reverse began to run?
    (I also tried to leave a message on one of the FAQ pages on back ups, but it appears that the number of characters is set to limit so low that you can't describe why the FAQ response is considered to be "not useful"
     
     
    Original title: Back Up system - disk and check

    Since this is a secondary drive chkdsk/r can be run without having to reboot.   Close all the programs that can access training and and when you run chkdsk say yes to "remove this volume first...". ».  This will cause no harm.  Although not strictly necessary, I recommend you to reboot once completed the disk check.   This will solve any problem related to the file handles.
    If chkdsk/r reports bad sectors, you should replace the disk.

  • SDK API to use to check the status of the host after RebootHost_Task API perl for VMware

    I use the RebootHost_Task API, ping the server ESX to check if it is in place (using the Net::Ping module), then using ExitMaintenanceMode_Task to get out of the mode of maintenance for the ESX Server.

    I sometimes lack of InvalidHostConnectionState when I trigger ExitMaintenanceMode_Task. This is because even if the ESX host is to ping requests, the SOAP request has failed. What Vmware perl API SDK can be used to check the status of the host before triggering the aPI ExitMaintenanceMode_Task

    Probably the best way is to check the HostSystem runtime.connectionState.

    $host = Vim::find_entity_view (view_type-online 'HostSystem', properties-online ['name', 'runtime.connectionState'], filter => {-online $host_name 'name'});

    $connected = 0;

    until the ($connected) {}

    $host-> update_view_data();

    $connected = $host-> {'runtime.connectionState'};

    # Add a timeout here break

    }

    #.. .do something with newly restarted host

    I also used the runtime.bootTime in the past, where I waited for the value is longer than the previous string XSD time recorded before the restart request (with a long timeout to avoid problems).  It's better than the connectionState option since it manages the window between the restart request and the actual restart.  It * doesn't * updated until the host is connected again (and available to call you to leave the maintenanceMode).

    These values using works even when the host is not connected (cached by the vCenter API service), so you can wait for them to change (and in the case of connectionState, once again).  You'll just take into account the window of the application restart and real reboot before you start querying using connectionState.

    You can probably drop your logic of ping, so if encode you correctly around the State API variables for the host.

  • Check the file size before downloading

    Hi there guys...

    I'm having a problem at the moment... How can I check the file size before being transmitted to the server?

    I was given a task to check if the file size limit is 500 KB and then block the download and warn the user.

    According to my colleague from work... This is not possible with Javascript or Ajax... is there another method I can use?

    kindly help... Thank you

    It is a good answer, but it is interesting to note that Flash Player is itself a control ActiveX (when run in IE). In short, you need something beyond code that runs directly in the browser to do this. It can be done with just HTML and JavaScript in a web page.

    Dave Watts, CTO, Fig Leaf Software

    http://www.figleaf.com/

    http://training.figleaf.com/

    Fig Leaf Software is a small business Veteran - Owned (VOSB) on

    GSA Schedule and provides high caliber of the authorized seller

    instruction at our training centers, online, or on-site.

    Read this before posting:

    http://forums.Adobe.com/thread/607238

  • With the help of cgi. CONTENT_LENGTH to check the file size before cffile

    I'll set up a form that allows users to upload files to our site ftp on the web server. I want to restrict the total size of the file to say 50 megs so I use an if statement and cgi. CONTENT_LENGTH to check the size of the file. It seems that the check can be done once the file is downloaded to a temporary file which defeats the purpose to check the size if it's already there. In my tests it make take 15 minutes to discover that my 52 meg file exceeded my limit of 50 MB. Is it possible to do the checking of file size before you actually download the entire file?

    Right, with cffile, you need to download everything first.

    There is a Flash/CFforms elegant solution that will allow you to access BEFORE upload file size. See ASFusion.com:
    http://www.AsFusion.com/projects/FileExplorer/http :// www.asfusion.com/examples/item/file-u pload-with-coldfusion-flash-forms

  • Change hosts, I need save email on computer files, before the MX records get switched?

    Hello
    Recently, I changed web hosts and still have my email accounts set up with my former host, with pointing to the old servers MX records.

    I configure Thunderbird accounts and open my existing email accounts via IMAP, it shows all the files and current e-mail I want to keep.

    My questions are-

    Can I save my files to e-mail on my first computer or local files on TB?
    Once the MX records point again - the host of the site, then add files?

    Thank you very much for the help!

    Provide you can still access the old server and emails are still there.
    Synchronize your e-mail records to obtain a copy of the files server on your computer.
    So stop synchronization.
    switch to offline mode.
    Move emails into local folders.
    e-mails in local folders will be stored on your computer.
    When all the emails are safe in local folders, you can remove the e-mail account.

    Be aware that if e-mails have been deleted from the server and synchronize with 'empty' server, then your Thunderbird folders will be updated to match the server and you will lose your emails.

    Also, in offline mode, you can create a backup of these emails.
    Use this addon:

    How to install the addon:

    To use, do a right click on the folder to see ImportExporttool options
    See the image below.

    Note: you can also use this tool to import e-mails stored in local folders as another method to get them in local directories.

  • KB2686509 fails to install, said lack of prerequisite useful and check the log file.

    I am running Windows XP on a Toshiba Satellite computer laptop, Intel PIII, 847 Mhz processor.  I installed SP3.

    Here are the contents of the log file:

    3,695: 17:49:52.498 27/01/2013 (local)
    3,695: c:\fb66e1fe6323f2b745bfc5d1\update\update.exe (version 6.3.13.0)
    3.755: DoInstallation: GetProcAddress (InitializeCustomizationDLL) returned: 0x7f
    3,775: hotfix started with following command line:
    3,775: in function GetReleaseSet, line 1211, RegOpenKeyEx failed with error 0x2
    3,775: in function GetReleaseSet, line 1240, RegOpenKeyEx failed with error 0x2
    3,805: CreateUserInterface: GetProcAddress for DefineInstallCustomUI failed: 0x7f
    3.946: return the value of IsMachineSafe = 0
    3.946: IsMachineSafe return 441092
    3.946: condition in Prereq.IsMachineSafe.Section failed with the fist
    3.946: Check condition for 1 line of prerequisite returned FALSE
    3.956: ReadStringFromInf: UpdSpGetLineText failed: 0xe0000102
    3.966: KB2686509 Setup has encountered an error: Setup cannot continue because one or more prerequisites required for the installation of KB2686509 failed. For more details, check the c:\windows\KB2686509.log log file
    3.996: ReadStringFromInf: UpdSpGetLineText failed: 0xe0000102
    3.996: Setup cannot continue because one or more prerequisites required for the installation of KB2686509 failed. For more details, check the c:\windows\KB2686509.log log file
    13.830: message displayed to the user: Setup cannot continue because one or more prerequisites required for the installation of KB2686509 failed. For more details, check the c:\windows\KB2686509.log log file
    13.830: user input: OK
    13.830: Update.exe extended error code = 0xf0f4
    13.830: Update.exe return code was masked to 0 x 643 for MSI custom action compliance.

    Here is the content of the faultykeyboard log file:

    kbdsp.kbd
    kbdsp.kbd
    kbdno.kbd
    kbdla.kbd
    kbdla.kbd
    kbdla.kbd
    kbdla.kbd
    kbdla.kbd
    Kbdus.kbd
    kbdla.kbd
    Kbdus.kbd
    kbdla.kbd
    kbdla.kbd
    kbdla.kbd
    kbdla.kbd
    kbdla.kbd
    kbdla.kbd
    kbdla.kbd
    kbdla.kbd
    kbdla.kbd
    kbdla.kbd
    kbdla.kbd
    kbdla.kbd
    kbdycl.kbd

    Thanks for your help!

    I've seen this before. Check this.

    http://social.technet.Microsoft.com/wiki/contents/articles/10876.kb2686509-failure-due-to-upgrade-from-Windows-Me-or-98-to-Windows-XP.aspx

  • My computer won't allow me to access my files on my portable hard disk without error appear "you must format the E: drive before using it. How can I fix this please!

    My computer won't allow me to access my files on my portable hard disk without error appear "you must format the E: drive before using it. How can I fix this please!

    Try to scan your driver with anti-virus, also try to throw the disc looking for this driver and as you try to run the following tools:

    http://support.Microsoft.com/mats/system_maintenance_for_windows/

    http://support.Microsoft.com/mats/windows_file_and_folder_diag/

  • My creative cloud cannot happen on the adobe servers and when I tried to repair the host file using the creative cloud cleaning tool, it displays Error occurred while setting entries HF: 5

    My creative cloud cannot happen on the adobe servers and when I tried to repair the host file using the creative cloud cleaning tool, it displays Error occurred while setting entries HF: 5

    Please let us know your operating system.

    Concerning

    Megha Rawat

  • I'm not able to use the export to ftp in Muse. When I enter my host, the name and the password, I get a long interlude of the Rainbow wheel, and finally, the message that my host ftp can not be found. I checked the name and it is port 21. Can I export a H

    I'm not able to use the export to ftp in Muse. When I enter my host, the name and the password, I get a long interlude of the Rainbow wheel, and finally, the message that my host ftp can not be found. I checked the name and it is port 21. I can export to HTML and use another ftp client to download (on the same server), but it's tedious and minor changes is painful. Have you come across this and found a solution?

    Yes I have - thanks for thinking.

    Starting to think that it is a computer / connection problem. I had to move the machines to connect to the Adobe forum.   Plu MacBook thin. New macbook dead ends. These seem too coincidental independent.

    Susan

  • try to check if a file already exists on the disk using fileExists

    All, Hy
    I'm trying to check if a file already exists on the disk in my action script.
    I found this link on fileExists:

    link

    So I tried somethink like this in my code, but to no avail...

    If (fl.fileExists ("queue: / / / C: / foo.txt"))
    {gotoAndPlay (2) ;}}
    on the other
    {gotoAndPlay (3) ;}}

    Is this not the right syntax?

    Thank you for your help.

    John,
    No I did not build the application of the swf with Mprojector. So I try with it.

    Looks like I'm not able to do that just use Flash Pro 8. I need to use a program like Mprojector to create an application and use its own functions.

    Thanks for your help.

Maybe you are looking for

  • Satellite Pro m30 - clock is fast

    Hello I have a problem, I noticed some time ago (don't know exaclty when, because I was using time servers), that if the laptop is left for a few hours without an internet connection, the internal clock goes faster. It is about 2 hours faster every d

  • No update high priority - post of XP SP3

    Fees no installation of XP SP2 OEM CDs no problem. Install XP SP3 Redistributable (used many times before) no problem. After restarting Windows Update, install the Active X control and it came up saying there is no high priority updates. Tried same q

  • 3000N100-> shows red Bluetooth icon 'B' - don't know how to fix it

  • wireless lan driver problem

    My laptop HP 15-g009AX have a pblm with its wifi. I installed the wireless driver from the HP Web site button, but it has not yet detected my WiFi.I installed win 8.1 and the tower was bought by flipkart.it is powered by and a8 apu, 4 GB ram, radeon

  • How to lock a file?

    I would block a file with a passward, then only I can open it... is this possible? I use Vista Edition home basic 32 Thank you