Dumping to Excel
Moderator: General Moderators
Dumping to Excel
How can I dump a recordset to an Excel file. I am using the OCI to run a sql query and I need to dump the result set to an Excel spreadsheet
Hi,
I just create a comma seperated file with all the records, when opened in Excel a wizard appears to help importing the file.
So logic is
Open a file for writing.
Open result set.
Iterate through result set concatenating field values with commas in between.
Write concatenated string to file.
repeat for each row.
Close file.
Hope this helps
I just create a comma seperated file with all the records, when opened in Excel a wizard appears to help importing the file.
So logic is
Open a file for writing.
Open result set.
Iterate through result set concatenating field values with commas in between.
Write concatenated string to file.
repeat for each row.
Close file.
Hope this helps
You will find them heretoppac wrote:Thanks, that will work. Now can you point me to the class/functions to do that with? I am not sure how to write to flatfiles.