11g CLOB Field Error "System.DBNull" when over 4000 characters
KRelayDec 27 2011 — edited Dec 27 2011No matter the Oracle 11g 32 bit version (11gR1/R2/R3) installed on 32 bit or 64 bit workstations, we are getting an error retrieving data from the client using OLE DB Provider for Oracle when we use a column that is a CLOB and it has data in it with a character count larger than 4000. If we get the data to less than 4000, we can convert it to varchar2 and it fixes the issue. Unfortunately we need it to have more than that amount of data in it so we need to keep it a CLOB.
The error we are getting is:
Unable to cast object of type 'System.DBNull' to type 'System.String'.
If we use Oracle client 9i or 10g (any version basically), we do not get this error. The problem with using these versions is, our application must use 10.2.0.20.0 ORACLE OLE DB PROVIDER at minimum, which isn't really a problem. The main problem is we need to use this with 64 bit machines, and Windows 7 64 bit does not allow for anything lower than 11g to be installed so we are forced to use 11g.
Does anyone know of a fix for this issue or have heard of this issue?
Thanks,
Jeff