Menu ▾ ▴

#1448 Objecs, Source: Table column list merged for similar named tables

SQuirreL
open
nobody
None
low
2020-12-01
2020-10-23
sfst
No

Snapshot 20201013_1945 with Oracle database:

If we e.g. have 2 tables named TEST_TABLE and TEST2TABLE the columns of both tables are shown in the Source tab if we view the table TEST_TABLE (see attachment).

The database cache had a command containing:
--begin quote--
WHERE t.owner LIKE :1 ESCAPE '/'
AND t.table_name LIKE :2 ESCAPE '/'
AND t.column_name LIKE :3 ESCAPE '/'
--end quote--

The "LIKE" should be changed into "=" at least for t.OWNER and t.TABLE_NAME.

The condition "AND t.column_name LIKE :3 ESCAPE '/' " probably can be removed, if I am not mistaken :3 used "%" (according to the bind capture).

IMHO trying to make the escaping work should not be done here, because it is more developer effort and if somebody is willing to quote the table name every time, pretty convoluted names are possible - though they probably deserve the troubles they will encounter :-)

1 Attachments

Discussion

  • Gerd Wagner

    Gerd Wagner - 2020-10-24

    Sorry, I can't reproduce your problem on my
    "Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit"
    and driver
    "Oracle JDBC driver 12.1.0.1.0".

    SQuirreL doesn't explicitly execute the SQL you mentioned but uses the JDBC drivers database meta data access methods. I guess the SQL you see is generated by your JDBC driver.

    Could you give some details about your JDBC driver?

     
    • sfst

      sfst - 2020-12-01

      SQuirreL doesn't explicitly execute the SQL you mentioned but uses the JDBC drivers database meta data access methods. I guess the SQL you see is generated by your JDBC driver.

      Interesting, I wasn't aware about that.

      I am using Oracle JDBC Driver version - "10.2.0.4.0" (a thin driver from 2008).

      Inside the driver I indeed could find the SQL fragment I had posted above.

      The same with another thin driver from 2014 I already have:
      Ant-Version: Apache Ant 1.7.1
      Created-By: 20.75-b01 (Sun Microsystems Inc.)
      Implementation-Vendor: Oracle Corporation
      Implementation-Title: JDBC
      Implementation-Version: 12.1.0.2.0
      Repository-Id: JAVAVM_12.1.0.2.0.OJVMBP_LINUX.X64_140822.01
      Specification-Vendor: Sun Microsystems Inc.
      Specification-Title: JDBC
      Specification-Version: 4.0

      I guess I will have to download something newer.

      Are you using an OCI driver?

       

Log in to post a comment.