06-22-06, 12:36 #1Registered User
- Join Date
- Jun 2006
Unanswered: how to find whether OS file exists or not
iam using oracle9i as Db and Forms6i as frontend.
i have one form to take the Backup of DATABASE In that iam entering one file path like d:\exp.dmp.I written code to takebackup in the when button pressed trigger.when i press the button the Db is exported in to the file which we r entered in the textitem.It is working Fine.
BUT if next time i enter the same filepath and press the button the file will be overwrite.I dont want like this.I want to write some code in WHENVALIDATE ITEM TRIGGER to FIND whether the OS file exists or not.
Is there any process to check.
Thanks in Advance
06-22-06, 12:57 #2Registered User
- Join Date
- Dec 2003
- Oklahoma, USA
First, create an Oracle Directory pointer:
CREATE DIRECTORY backups AS 'd:\'; GRANT READ ON DIRECTORY backups TO some_username;
ex BOOLEAN; flen NUMBER; bsize NUMBER; BEGIN utl_file.fgetattr('BACKUPS', 'exp.dmp', ex, flen, bsize); IF ex THEN dbms_output.put_line('File Exists'); dbms_output.put_line('File Length: ' || TO_CHAR(flen)); dbms_output.put_line('Block Size: ' || TO_CHAR(bsize)); ELSE dbms_output.put_line('File Does Not Exist'); END IF; END;JoeB
save disk space, use smaller fonts