Issue 73375

Summary: DatabaseImportDescrptors still parse SQL, even when IsNative is set to True
Product: Calc Reporter: bryancole <bryan.cole>
Component: codeAssignee: AOO issues mailing list <issues>
Status: CONFIRMED --- QA Contact:
Severity: Trivial    
Priority: P3 CC: issues
Version: OOo 2.0.4   
Target Milestone: ---   
Hardware: All   
OS: All   
Issue Type: DEFECT Latest Confirmation in: ---
Developer Difficulty: ---

Description bryancole 2007-01-11 13:53:36 UTC
If I set a DatabaseImportDescriptor for a database range in calc to
an SQL statement, when I do the import, it appears that calc *always* attempts
to parse the SQL, even when the IsNative flag is set to True. This is a problem
because I want to send a stored function query to a postgresql database; OOo
cannot parse such a query, so it must be send in Native mode (which works in
other situations like in Base queries).

Here's a basic script to show what I'm doing:

Sub Main
dbRange = ThisComponent.DatabaseRanges.getByName("mydbRange")
desc() = dbRange.ImportDescriptor
desc(0).Name = "DatabaseName"
desc(0).Value = "MyDB"
desc(1).Name = "SourceType"
desc(1).Value = com.sun.star.sheet.DataImportMode.SQL
desc(2).Name = "SourceObject"
desc(2).Value = "select * from generate_series(0,10);"
desc(3).Name = "IsNative"
desc(3).Value = True
dbRange.getReferredCells.doImport(desc())
End Sub

This macro fails with "Syntax error in SQL expression". 

However, the query works in postgresql natively and from OO-Base, provided
Native mode is selected.
Comment 1 frank 2007-03-09 13:35:27 UTC
Hi Niklas,

please have a look at this one. QA Base told me it's yours.

frank
Comment 2 Martin Hollmichel 2007-11-09 16:52:47 UTC
change target from 2.x to 3.x according to
http://wiki.services.openoffice.org/wiki/Target_3x
Comment 3 Marcus 2017-05-20 11:11:41 UTC
Reset assigne to the default "issues@openoffice.apache.org".