Issue 60334 - Allow execution of native SQL in doImport
Summary: Allow execution of native SQL in doImport
Status: CONFIRMED
Alias: None
Product: Calc
Classification: Application
Component: code (show other issues)
Version: OOo 2.0
Hardware: All All
: P3 Trivial (vote)
Target Milestone: ---
Assignee: AOO issues mailing list
QA Contact:
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-01-11 00:53 UTC by pgimeno
Modified: 2013-08-07 15:12 UTC (History)
1 user (show)

See Also:
Issue Type: ENHANCEMENT
Latest Confirmation in: ---
Developer Difficulty: ---


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description pgimeno 2006-01-11 00:53:19 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.
Comment 1 frank 2006-03-03 09:58:13 UTC
One for requirements

Frank