XML and Oracle NVARCHAR datatype

We are processing data from XML to Oracle table (10g). One column from XML has varchar(4000) characters. When we insert this into oracle table, we get an error - error <ORA-01461: can bind a LONG value only for insert into a LONG> column.

We have tried with following datatypes for Oracle table on the varchar.
varchar2(4000 char) and nvarchar2(2000). We don’t want to insert XML varchar(4000) string to a long or clob column in Oracle. Any other suggestions would be helpful. Thanks.


jgopalan :us: (BOB member since 2008-02-25)

Because Oracle only supports varchar2/nvarchars with up to 4000 bytes. Everything bigger is a CLOB datatype. I expect some double byte chars so at the end the XML is too large for Oracle. Is that possible?


Werner Daehn :de: (BOB member since 2004-12-17)

Thanks Werner. I understand your comments.

If I have a long data type on descriptions in the Oracle table, I cannot do updates (long does not permit that) and also cannot do a distinct. XML flattening generates duplicates and I need to do a distinct operation on the result.

Any suggestions to tackle this? Thanks.


jgopalan :us: (BOB member since 2008-02-25)

Adding to that I have one other update about DI handling a long column.

For a table having a column with LONG Datatype and if that is your TARGET Table and if your Dataflow is not a Push-Down SQL, then DI does a commit for Each record. I mean the Commit Size is overriden with a value of 1


ganeshxp :us: (BOB member since 2008-07-17)

Gosh, that explains why my job took 8 hours to complete when I tried long datatype for descriptions (loading to an oracle table).


jgopalan :us: (BOB member since 2008-02-25)

I changed the target to SQL server and used nvarchar(4000) for the descriptions. I tried using bulk loads, both gave an error on space. I tried changing the recovery mode from bulk to simple to minimize logging and optimizing space. Is there any other way to turn off logging in SQL server loads with DI?


jgopalan :us: (BOB member since 2008-02-25)