问题
I have a varchar2(16000 char) column, for really long texts. I can insert longer than 4000 char texts into this column, but when I try to select it through sqldeveloper I get an ORA-24920 error. If I skip that column from my query, I get some data back, and if I check the length of the column, I get back the correct length of the inserted text.
The problem is that it seems that sqldeveloper cannot handle this long text. Any idea?
回答1:
Unless you're using Oracle 12c, SQL tables have a limit of 4000 characters on VARCHAR2.
This is a little confusing because PL/SQL variables have a VARCHAR2 limit of 32k, which means you could declare a VARCHAR2(16000) variable in a procedure and have it try to insert into a table which will work as long as the data is below the SQL limit.
In Oracle 12c, the SQL table limit for VARCHAR2 can be expanded to 32k if MAX_STRING_SIZE property is set to EXTENDED.
If your database version is already 12c, then you need to upgrade your SQL Developer to the latest version, see here. Apparently older versions can't handle the expanded SQL VARCHAR2 limit and will give you the error you're seeing.
来源:https://stackoverflow.com/questions/24829223/ora-24920-but-text-is-shorter-than-column-size