Apache OpenOffice (AOO) Bugzilla – Issue 1653
Error: The table "accounts" is unknown in the database - wrong SQL
Last modified: 2013-08-07 15:45:41 UTC
Our configuration: SuSe Linux 7.1, 2.4.9 kernel, Informix 9.21 UC3, Informix Connect 2.40 ODBC The following SQL is used by openoffice to get tablename (see everywhere 1=0!!!): Last parsed SQL statement : select '1', owner, tabname, 'SYSTEM TABLE', '1' from core:informix.systables t where t.tabid < 99 and 1 = 0 and t.owner like '%' and t.tabname like 'accounts' union select '2', owner, tabname, 'TABLE', '2' from core:informix.systables t where t.tabid > 99 and t.tabtype = 'T' and 1 = 0 and t.owner like '%' and t.tabname like 'accounts' union select '3', owner, tabname, 'VIEW', '3' from core:informix.systables t where t.tabid > 99 and t.tabtype = 'V' and 1 = 0 and t.owner like '%' and t.tabname like 'accounts' union select '4', owner, tabname, 'SYNONYM', '4' from core:informix.systables t where t.tabid > 99 and t.tabtype = 'S' and 1 = 0 and t.owner like '%' and t.tabname like 'accounts' order by 4, 1, 2, 3
Tibor, what exactly did you do in OOo to reproduce the behaviour? What structures do you have in your DB? I.e., which tables are existent, which (possibly which kind of) columns do they have? Please give us as detailed information about the concrete data you are accessing and the things you do. Thanks!
Hi Frank, I describe all the steps what I performed: Tools/Data sources/New Data Source General Name: ntibor_core Database Type: ODBC Data Source URL: sdbc:odbc:Inf_dell632_ntibor_core ODBC User name: ntibor Password required: checked Driver settings: empty Character set: System Use catalog for...: unchecked Tables As I click the 'Table' tab, I see only 'All tables' checked in the table list, but no individual tables. And as I see in informix 'onstat' utility, this is because wrong sql command is issued by OOo with the '1=0' in it, this sql returns nothing of course: ************ onstat's output *********** onstat> sql 7572 Informix Dynamic Server 2000 Version 9.21.UC3 -- On-Line -- Up 7 days 04:18:51 -- 1548748 Kbytes Sess SQL Current Iso Lock SQL ISAM F.E. Id Stmt type Database Lvl Mode ERR ERR Vers 7572 - ntibor_core CR Not Wait 0 0 9.03 Last parsed SQL statement : select '1', owner, tabname, 'SYSTEM TABLE', '1' from ntibor_core:informix.systables t where t.tabid < 99 and 1 = 0 and t.owner like '%' and t.tabname like '%' union select '2', owner, tabname, 'TABLE', '2' from ntibor_core:informix.systables t where t.tabid > 99 and t.tabtype = 'T' and 1 = 1 and 1 = 0 and t.owner like '%' and t.tabname like '%' union select '3', owner, tabname, 'VIEW', '3' from ntibor_core:informix.systables t where t.tabid > 99 and t.tabtype = 'V' and 1 = 1 and 1 = 0 and t.owner like '%' and t.tabname like '%' union select '4', owner, tabname, 'SYNONYM', '4' from ntibor_core:informix.systables t where t.tabid > 99 and t.tabtype = 'S' and 1 = 0 and t.owner like '%' and t.tabname like '%' order by 4, 1, 2, 3 onstat> ********* end of onstat's output ********* Queries New Sql "select * from accounts" Run -- IT WORKS!!! I see the records of the table Switch design view on -> OOo's error message and the wrong sql reported before appear. That's all. I guess it should be analyzed why '1=0' is inserted into the sql command, even if you have not the same environment as me and you can not reproduce the problem. Tibor Note: I am using the same ODBC data source with StarOffice 5.2 without any problem.
Ocke is the responsible engineer
usually, the 1 = 0 is use to retrieve information about columns in a table (or, for that matter, in the result set of a statement). It's a common method if retrieving information about the result set which do not depend on the actual data: append an "1 = 0" to the WHERE clause, and the result set is the same except that it's empty. Nevertheless, it's strange that this is done when simply accessing the tables page in the dialog.
Hi Tibor, first sorry for the long delay. The ODBC driver you are using comes from informix or is it unixODBC? The sql statement looks a liitle bit strang for me. We never create this kind of statement, yes it is true that we sometimes create a statement like 0=1 but only to the columns names without getting a result. But this statement must be generated by informix, I'm sure because we write all keywords in capital letters another reason is that the identifier are not qouted. regards, Ocke
I am using INTERSOLV ODBC: INTERSOLV DataDirect Connect ODBC UNIX Version 3.11 January 1999 Do you have a better idea? Tibor
Hi Tibor, did you try the Informix odbc drivers from the site http://www.informix.com/evaluate ? Best regards, Ocke
No, I am using InterSolv 3.11 ODBC. Anyway, there is no such address: http://www.informix.com/evaluate I do not beleice, that the problem is the driver itself. I tried this with OpenOffice 1.0. THe reasult is the same. The ODBC connection is basically OK, I can create a new table from OpenOffice. But the Table list is empty. The last parsed SQL - as I see in Informix - has absolutely no sense, it is no wonder, that no tables are seen: Last parsed SQL statement : select '1', owner, tabname, 'SYSTEM TABLE', '1' from ntibor_core:informix.systables t where t.tabid < 99 and tabtype in ('T','V','S','P') and 1 = 0 and t.owner like '%' and t.tabname like '%' union select '2', owner, tabname, 'TABLE', '2' from ntibor_core:informix.systables t where t.tabid > 99 and t.tabtype = 'T' and 1 = 1 and 1 = 0 and t.owner like '%' and t.tabname like '%' union select '3', owner, tabname, 'VIEW', '3' from ntibor_core:informix.systables t where t.tabid > 99 and t.tabtype = 'V' and 1 = 1 and 1 = 0 and t.owner like '%' and t.tabname like '%' union select '4', owner, tabname, 'SYNONYM', '4' from ntibor_core:informix.systables t where t.tabid > 99 and t.tabtype = 'S' and 1 = 0 and t.owner like '%' and t.tabname like '%' order by 4, 1, 2, 3
I'm a little bit confused about the address. When I hit on it I come to Informix. !!?? The statement you submitted is not generated by OO. It looks like the driver you are using generate this to get information about the tables. The driver possible creates this stamtement when we ask him for SQLTables which is only a ODBC function call. OO only generates sometimes statement s which ends with 1=0 but then only one table is inside the from clause. It seems that Informix uses the same trick to get information about table columns. Best regards, Ocke
The problem on the WEB site was temporary only. I downloaded the newest IBM INFORMIX CONNECT 2.80.UC1-1 for INTEL LINUX 2.4 GLIBC2.2.X. I installed it. I deinstalled the Intersolv ODBC driver and I installed unixODBC-2.1.1-111 from the SuSe 8.0 distribution.The situation remains the same. It works with StarOffice 5.2, but the table list is not shown in OO, therefore I can enter SQL command manualy only. Note: I changed the version in the header BRG Tibor
A last thing you could try, is to download the newset versin of unixODBC. Your version is from Dec.2001. May be they fixed some bugs to. By the way, which version of OOo your are using? Kindly, Ocke
I have downloaded, compliled and installed unixODBC 2.2.0. Nothing has been changed. StarOffice works, OO not. I am using OpenOffie 1.0.1.
The SRX643 should be closest to current state of the art :-)
targeting to 1.1 Beta.
Hi Marc, please have a look at it. If still occurs in a current release. Best regards, Ocke
I have the same problem when using the Easysoft ODBC-Interbase driver on a Windows 2000 PC with OpenOffice 1.0.2: When opening a database (using "View | Data Sources"), and then clicking on the little + sign next to the "Tables" entry the list of all tables in the database does not appear. With the Gemini ODBC-Interbase driver this problem does not occur. By the way: this issue appears to be similar to issue 5231
Too late for beta2, re-targeted to 1.1 RC.
mh->msc: are there any updates for this ?
Hi Tibor, does this issue still occur in OOo 1.1 RC ? Bye Marc
I have found OO 1.1 Beta 2 to download. Where to find OOo 1.1 RC? By the way OO 1.0.3 have the same problem. Who did set the status of this issue as 'RESOLVED FIXED' (without any comment)?
The problem still occurs in OO 1.1 Beta 2. Where to find OO 1.1. RC1?
Nothing has bess changed until now, the problem still occurs also in OO 1.1 RC. ODBC connection OK, SQL commands OK, table creation OK but table list is not seen. Note: I have set Version to OOo 1.1 RC in the header.
set target to 2.0, because development for 1.1 is closed.
change subcomponent to 'none'
Because of limited resource for OOo2.0, it was decided to shift this tasks to the next milestone. If somebody will be found, who can implement this until OOo2.0, then this tasks will be re-targeted.
works for me with the functinality of the "new base container since version 2.0
.