Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> varchar2 length and writing too much

varchar2 length and writing too much

From: JEFFKISH <ait_at_concentric.net>
Date: Tue, 12 Jan 1999 17:37:54 GMT
Message-ID: <369b8728.103812844@news.iserv.net>


Simple question here, I think.

Oracle 7.3

I created a table with columns of varchar2, one which is defined as varchar2(256).

Recently when I accessed the table using jdbc I got an error: "BIGGER TYPE LENGTH THAN MAXIMUM". When I persued this I found that there were actually 258 characters of description in the column for the row read. I perused this using both Oracle SQL 3.3 and Microsoft Explorer.

I was able to both fix this and "unfix" this by writing new data using Microsoft query.

I am assuming that MS Query is using ODBC. So here are the facts as I see them:

  1. Oracle SQL 3.3 lets you read data longer than the column defined.
  2. MS Query lets you read and write too much data (no error is generated).
  3. JDBC drivers generate an error if they read such a column (more data than the column length is defined for).

Can someone tell me
1) why Oracle is letting you do this without throwing some type of error
2) I am assuming Oracle SQL 3.3 would have let me write too much data also.
3) Is the best way to protect against this is at the application level?

any comments and responses are appreciated.

Thanks
Jeff Received on Tue Jan 12 1999 - 11:37:54 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US