Apache OpenOffice (AOO) Bugzilla – Issue 60334
Allow execution of native SQL in doImport
Last modified: 2013-08-07 15:12:27 UTC
When calling doImport with SourceType = com.sun.star.sheet.DataImportMode.SQL, the SQL statments executed by doImport are syntax-checked, thus preventing complex queries that are recognized by the server but not by OOo from being executed. I'm using it as in this snippet: http://codesnippets.services.openoffice.org/Calc/Calc.ImportDatabaseContent.snip but using a different language (Delphi in my case) from an external application and a different query, as a way to export and analyze the data with a spreadsheet. The following (simplified) query, for example, works in SQL-92 compliant servers but not in Calc's doImport: SELECT Customer, SUM(CASE WHEN Month = 1 THEN Quantity ELSE 0 END) AS Jan, SUM(CASE WHEN Month = 2 THEN Quantity ELSE 0 END) AS Feb, <10 months snipped> FROM Sales WHERE Year = 2005 GROUP BY Customer The suggestion is to add a constant like ...DataImportMode.SQLnative (for example) that allows passing the SQL statement verbatim to the server without checking or processing it.
One for requirements Frank