https://bugs.documentfoundation.org/show_bug.cgi?id=115049

            Bug ID: 115049
           Summary: DatabaseImportDescriptors still parse SQL, even when
                    IsNative is set to True
           Product: LibreOffice
           Version: 5.4.4.2 release
          Hardware: All
                OS: All
            Status: UNCONFIRMED
          Severity: normal
          Priority: medium
         Component: BASIC
          Assignee: libreoffice-bugs@lists.freedesktop.org
          Reporter: jan.be...@email.cz

First reported on 2007-01-11 13:53:36 UTC 
https://bz.apache.org/ooo/show_bug.cgi?id=73375

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 mysql database; LO
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 
    date_format(
        adddate('2011-1-1', @num:=@num+1), 
        '%Y-%m-%d'
    ) date
from 
    information_schema.tables,
    (select @num:=-1) num
limit 
    365"
desc(3).Name = "IsNative"
desc(3).Value = True
dbRange.getReferredCells.doImport(desc())
End Sub

This macro fails with "Syntax error in SQL expression". 
Type: com.sun.star.container.NoSuchElementException
Message: .

However, the query works in mysql natively and from LO-Base, provided
Native mode is selected.

-- 
You are receiving this mail because:
You are the assignee for the bug.
_______________________________________________
Libreoffice-bugs mailing list
Libreoffice-bugs@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs

Reply via email to