https://bugs.freedesktop.org/show_bug.cgi?id=61831

          Priority: medium
            Bug ID: 61831
                CC: zolnaitamas2...@gmail.com
          Assignee: libreoffice-bugs@lists.freedesktop.org
           Summary: QUERY support for "SELECT TOP n", "ROWID", ... ways of
                    limiting the number of results
          Severity: enhancement
    Classification: Unclassified
                OS: All
          Reporter: lio...@mamane.lu
          Hardware: All
            Status: NEW
           Version: 4.1.0.0.alpha0+ Master
         Component: Database
           Product: LibreOffice

LibreOffice now has support for the (non-ISO-SQL-standard) feature "please
return at most n results" in a query.

For now, it only supports the SQL syntax (the most common one):
  SELECT foo FROM bar LIMIT n
But Microsoft Jet uses this syntax:
  SELECT TOP n FROM bar
And OracleDB something like this:
  SELECT foo FROM bar WHERE rowid<n

As an improvement, it would be nice to support the different syntaxes. My
suggestion would be to add an "advanced" setting (in edit/database/advanced
settings). Like we now have a choice "Comparison of Boolean values" that can be
set to "Default", "SQL", "Mixed" or "MS Access", we could there have a setting
"return max n rows syntax", whose choices would be:

 - LIMIT n
 - TOP n
 - rowid < n


Then, the code that creates an SQL string from SQL design mode can take this
setting in account to produce the right kind of syntax.

SDBC connectors that know to which dbms they connect to (such as e.g. the
MySQL, PostgreSQL, MS Access and embedded HSQLDB one, but not ODBC or JDBC) can
then lock the value of this setting to the right value (like the postgresql
sdbc connector now locks the value of "Use ODBC conformant date/time literal"
to false, since that's what PostgreSQL requires. (And then the setting does not
even appear in the dialog, but is just set under the hood.)

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

Reply via email to