Home » Developer & Programmer » Forms » How to know when the Excel file has been generated?
How to know when the Excel file has been generated? [message #175562] Fri, 02 June 2006 16:35 Go to next message
orate
Messages: 16
Registered: September 2005
Junior Member
I have a form with the following code, which executes an .sql file containing an sql query and puts the result in an Excel file:

in_file := TEXT_IO.FOPEN('c:\query.sql', 'w');
TEXT_IO.PUT_LINE(in_file, 'SPOOL c:\result.csv');
TEXT_IO.PUT_LINE(in_file, the_query);
TEXT_IO.PUT_LINE(in_file, '/');
TEXT_IO.PUT_LINE(in_file, 'SPOOL OFF');
TEXT_IO.PUT_LINE(in_file, 'EXIT');
TEXT_IO.FCLOSE(in_file);

HOST(path_of_sqlplus_executable||' '||GET_APPLICATION_PROPERTY(USERNAME)||'/'||GET_APPLICATION_PROPERTY(PASSWORD)||'@'||GET_APPLICATION_PROPERTY(CONNECT_STRING)||'@c:\q uery.sql', NO_SCREEN);


This can take some time, so I want to show an alert when SQL*PLUS exits, telling the user that the Excel file has been created.
How can I know when this happens?
Re: How to know when the Excel file has been generated? [message #175589 is a reply to message #175562] Sat, 03 June 2006 02:33 Go to previous messageGo to next message
jowahl
Messages: 82
Registered: May 2006
Member
put a message (alert) after the HOST command.
i think it will pop up after the HOST command had finished.
Re: How to know when the Excel file has been generated? [message #175638 is a reply to message #175589] Sat, 03 June 2006 15:00 Go to previous messageGo to next message
orate
Messages: 16
Registered: September 2005
Junior Member
I did that, but the message shows immediately, while SQL*PLUS continue to execute in parallel with the form for some amount of time.
Re: How to know when the Excel file has been generated? [message #176366 is a reply to message #175638] Thu, 08 June 2006 02:21 Go to previous message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
How about producing a second 'spool' file ast the very end of you SQL job and use text_io to test (via a timer) to see whether it exists.

David
Previous Topic: not display blank fk record
Next Topic: File attachment
Goto Forum:
  


Current Time: Fri Sep 20 08:17:58 CDT 2024