How to Delete a File from the O/S from oracle developer Forms ?
---------------------------------------------------------------
1)
The first way to delete a file on the O/S is to use the HOST command. The HOST
built-in allows to execute an indicated operating system command.
Syntax (see forms on-line help)
PROCEDURE HOST(system_command_string VARCHAR2);
PROCEDURE HOST(system_command_string VARCHAR2,screen_action NUMBER);
On a Windows platform your code would look like :
HOST ( 'del C:\temp\temp1.lis', NO_SCREEN );
On a Unix platform you code would look like :
HOST ( 'rm /tmp/temp1.lis', NO_SCREEN );
As this solution is based on the HOST command it applies to all platforms.
2).
Another way to delete a file form the O/S is to use for Client/Server
D2kWutil: WIN_API_UTILITY.DELETE_FILE
or for Webforms
webUtil: webutil_file.delete_file.
Halim is a Sr. Database Engineer/Data Architect (in Atlanta, USA) who is an Oracle certified (OCP) DBA, (OCP) Developer, Certified Cloud Architect Professional as well as OCI Autonomous DB specialist with extensive expertise in Database design, configuration, tuning, capacity planning, RAC, DG, Scripting, Python, PL/SQL etc. He achieved 16th position in worldwide first-ever PL/SQL Challenge cup playoff- http://plsql-challenge.blogspot.com/2010/07/winners-of-first-plsql-challenge.html
Subscribe to:
Post Comments (Atom)
My Blog List
-
-
-
4096 Columns1 week ago
-
-
-
-
-
-
-
Oracle Cloud & Third party tools4 years ago
-
-
-
Moving Sideways8 years ago
-
Upcoming Events...10 years ago
-
1 comment:
HOST('cmd /c del D:\Slips\\*.pdf',NO_SCREEN);
Post a Comment