title: Oracle adds NULL Byte (ASCII: 0) to varchar2 string
body: <p>I've run into an odd problem with a legacy ASP application that uses Oracle 9i as its database.  We recently had the DBA increase the size of a VARCHAR2 field from VARCHAR2(2000) to VARCHAR2(4000).  The problem is that a NULL byte (ASCII: 0) is inserted into the 2001 character position in the string even if the string inserted is larger than 2000 characters.  For example, if the application inserts a new record into the table with a string of 2500 characters, then 2501 characters are stored in the VARCHAR2 field and the NULL byte is inserted at the 2001 character position.  The NULL byte is not part of the original posted data that was saved to the database and is causing us some grief.  Have any of you ever come across something like this?  The application is using the MSDAORA ODBC driver and I'm thinking that the driver is adding the terminating NULL character to its string buffer which <em>may</em> have a internal limit of 2000 characters.</p>
  
  <p>Any ideas?</p>
  
  <p>Thanks.</p>