Download it now!
Bug 51404 - Libreoffice Base with Oracle - SYSDATE, ROWNUM don't work in query!
Summary: Libreoffice Base with Oracle - SYSDATE, ROWNUM don't work in query!
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Base (show other bugs)
Version:
(earliest affected)
3.5.4 release
Hardware: Other All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard: BSA
Keywords:
: 58796 (view as bug list)
Depends on:
Blocks: Database-Queries
  Show dependency treegraph
 
Reported: 2012-06-25 04:54 UTC by MichaelB
Modified: 2020-07-23 02:42 UTC (History)
9 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description MichaelB 2012-06-25 04:54:15 UTC
Problem description: 
--------------------
Cannot execute some query (with sysdate, rownum) when used with Oracle database. 

There is already a bug from 2010 that refer to this problem may be (READ IT):
https://issues.apache.org/ooo/show_bug.cgi?id=108593


Steps to reproduce:
--------------------

- Add the library ojdbc6.jar

- Run query in Base 
 
- When i want retrieve the system date: SELECT TO_CHAR(sysdate, 'YYYY') FROM DUAL;

    Statut SQL: 42000 Code d'erreur: 904 / ORA-00904: "sysdate" : identificateur non valide

Or if i use "ROWNUM" to limit result in query.

    Statut SQL: 42000 Code d'erreur: 904 / ORA-00904: ROWNUM : identificateur non valide

All that query works if direcly executed in sqlplus tool from Oracle.


Current behavior:
--------------------
I got a error code, see above..

Expected behavior:
--------------------
To return the result..

Platform (if different from the browser): 
              
Browser: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:13.0) Gecko/20100101 Firefox/13.0.1
Comment 1 Jochen 2012-08-29 18:47:48 UTC
@Rainer

this bugreport is confirmes on https://issues.apache.org/ooo/show_bug.cgi?id=108593
What shall we do: status changing to "NEW"?
Comment 2 Alex Thurgood 2012-12-28 13:59:37 UTC
*** Bug 58796 has been marked as a duplicate of this bug. ***
Comment 3 Alex Thurgood 2012-12-28 17:21:51 UTC
Confirming, this appears to be inherited from the OOo code, so it has probably always been present in our versions, even from LO 3.3.x.


Alex.
Comment 4 MichaelB 2013-01-12 10:19:44 UTC
Is someone can work on it or tell me where the parser file is (BUG: 108593) in the source code of Libre Office ? I really need this enhancement.
Comment 5 Rainer Bielefeld Retired 2013-01-12 11:12:12 UTC
@Lionel:
Can you help here?
Comment 6 Lionel Elie Mamane 2013-01-14 09:53:14 UTC
(In reply to comment #4)
> Is someone can work (...) tell me where the parser file is
> in the source code of Libre Office ?

The lexer/parser is in connectivity/source/parse, files sqlflex.l and sqlbison.y

I'll gladly review and apply your patch. Thanks in advance!

After making the parser able to dynamically add new keywords, we would have to initialise the list of accepted keywords.

When connecting through an ODBC driver we should initialise with:

 SQLGetInfo(,SQL_KEYWORDS,,,)

AND the value of SQL_ODBC_KEYWORDS (see http://msdn.microsoft.com/en-us/library/windows/desktop/ms711681(v=vs.85).aspx )
 
I presume JDBC has a similar API call to get the datasource-specific keywords.


If we can design a more generic solution that would not require LibO to know the database's keywords, that would be double plus extra good. I don't have an idea out of the top of my head right now.
Comment 7 MichaelB 2013-05-17 07:39:16 UTC
I really would like help you and community but im not C++ developer. I analysed the code but is too complex for me. So if someone can work on this enhancement.. ;-)
Comment 8 Alex Thurgood 2015-01-03 17:39:07 UTC Comment hidden (no-value)
Comment 9 QA Administrators 2016-01-17 20:04:06 UTC Comment hidden (obsolete)
Comment 10 MichaelB 2016-01-18 13:38:47 UTC
Still not working on all version (current 5.0.4)
Comment 11 QA Administrators 2017-10-23 14:06:57 UTC Comment hidden (obsolete)
Comment 12 QA Administrators 2020-07-22 03:53:14 UTC Comment hidden (obsolete)
Comment 13 MichaelB 2020-07-22 11:23:19 UTC
Still not working with LibreOffice 6.4.x, i will test it with 7.0 in the next few weeks.