Page 1 of 1

Loading into Multiple Spreadsheets in Excel

Posted: Mon Aug 24, 2009 4:01 pm
by paranoid
Hi,

I have got a requirement where i need to output three separate SQL query result sets into three spreadsheets of an excel file.

Is there any way of doing this? Please advise.

Thanks in advance!!

Sue

Posted: Mon Aug 24, 2009 4:23 pm
by RAJEEV KATTA
Write three queries in 3 database stages and output them to sequential file with file name as <youropfilename>.xls and in properties tab specify the delimter as tab from the listed drop down in the window.DO the same for other 2 files too.

Posted: Mon Aug 24, 2009 6:33 pm
by chulett
I'm guessing here that multiple "spreadsheets" actually means multiple "worksheets" all in a single spreadsheet. While you can read something like that, I don't believe you can write natively to one... other than as separate .csv or .prn files as noted.

Could be wrong.

Posted: Mon Aug 24, 2009 8:33 pm
by paranoid
Chulett,

You are correct. I meant to say "worksheets' not "Spreadsheets".

Three result sets in the same spreadsheet.

Is there any way to do this? It is fine even if it is a CSV file.

Thanks

Sue

Posted: Mon Aug 24, 2009 9:42 pm
by chulett
Not that I know of, using csv files will get you separate spreadsheets, not worksheets. Perhaps using an ODBC driver for Excel???

Posted: Mon Aug 24, 2009 11:08 pm
by ray.wurlod
Using an ODBC driver for Excel, the DSN refers to the workbook and each worksheet in the workbook - subject to certain requirements - presents as a system table from that data source.

Posted: Tue Aug 25, 2009 9:26 pm
by paranoid
Ray,

Thank-you for the reply. Could you please provide me more information on what you said in your previous reply?

Thanks

Suresh

Posted: Tue Aug 25, 2009 10:23 pm
by ray.wurlod
Not really. What I wrote is clear.

If you're asking about the "certain requirements" these are documented in the ODBC API manual (from Microsoft) - in essence the worksheet must be in strict columnar form and have ODBC-legal column headings.