Oracle 11g / Editor 1.9.0 / ORA-00942: table or view does not exist

Oracle 11g / Editor 1.9.0 / ORA-00942: table or view does not exist

zajczajc Posts: 67Questions: 10Answers: 2
edited April 2019 in Bug reports

I found a bug in OracleQuery.php

The problem is the code protected $_identifier_limiter = array( '"', '"' );
It create SELECT "table"."column" FROM "table"and this resulted in ORA-00942: table or view does not exist

The SELECT must be SELECT "TABLE"."COLUMN" FROM "TABLE".

If we omit double quotes from with protected $_identifier_limiter = null; it creates SELECT table.column FROM table and this should work fine.

There are 2 possibilities how to solve. Table/view/column name should be without double quote unprotected as it was before or with double quote and uppercase to be protected.

Answers

  • allanallan Posts: 61,697Questions: 1Answers: 10,102 Site admin

    I think it might actually be that you are running into a case issue here. With the fields quoted in Oracle the case must match what your database tables are. That looks like it might be all uppercase.

    Allan

  • zajczajc Posts: 67Questions: 10Answers: 2

    I was thinking actually it is not a bug but feature, but it may confuse somebody why it is not working. In Oracle 11g (I will soon test in Oracle 12 and Oracle 18) if you create tables and column names without double quote, everything is in uppercase. This is how most of the programmers work. At least I do.

    CREATE TABLE test (column1 varchar2(45))

    SELECT * FROM test works
    SELECT * FROM "TEST" works
    SELECT * FROM "test" doesn't work

    CREATE TABLE "tesT" (column1 varchar2(45))

    SELECT * FROM test doesn't works
    SELECT * FROM "TEST" doesn't work
    SELECT * FROM "tesT" works

This discussion has been closed.