#959 COLUMN_SIZE for VARCHAR2 should be in characters not bytes


We have two Oracle 10i database, one in Windows (NLS_CHARACTERSET=WE8MSWIN1252) and one in Linux (NLS_CHARACTERSET=AL32UTF8). The difference is that WE8MSWIN1252 is 1 byte per character, and AL32UTF8 reserves 4 bytes per character. Both databases have the same schema and structure. The "Columns" view in SquirrelSQL shows VARCHAR2 columns on the Linux database as being four times larger than the same columns on the Windows database. I believe it is showing the column size as the total number of bytes, rather than the total number of characters. There seems to be no way to see the total number of characters, except to remember always to mentally divide by four when viewing the Linux database.


  • Stefan Willinger

    in case I encountered the same issue in the past, I was motivated to do some research. And for me, the source of the problem was a bug within the JDBC driver of Oracle. See the release Notes http://www.oracle.com/technetwork/database/enterprise-edition/readme-jdbc-10204-093598.html.
    "4485954 JDBC describe of CHAR semantics column gives wrong size"
    I have tested this with following statement.
    create table test (
    str varchar2(100 CHAR) ,
    str2 varchar2(100 BYTE)
    The key point is the NLS_LENGHT_SEMANTIC of the column, because you have an UTF8 Database, a character maybe use 4 Bytes. With an JDBC-Driver version shipped with my Oracle XE installation, i saw the following length:
    str = 400
    str2 = 100
    By using the version i get the right values
    str = 100
    str2 = 100

    So, this is not a problem from Squirrel and you have to update your JDBC-driver.


  • Rob Manning

    Rob Manning - 2011-02-24
    • assigned_to: nobody --> manningr
    • status: open --> closed-invalid
  • Rob Manning

    Rob Manning - 2011-02-24


    Thanks for doing the legwork on this. I have often discovered a bug in the jdbc driver when tracking issues like this down. After reading the details on this bug, I suspected that the driver (or a mis-understanding of Oracle's character sets feature) was the culprit; thanks again for verifying this.


    P.S. You have been an above-average participant in this project and you have my vote for promotion to committer status if that is what you desire - send a note to Gerd Wagner if you want to pursue this and reference this comment.


Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

No, thanks