1

I added NCLOB column to table:

ALTER TABLE table_name ADD(column_name NCLOB);

And I tried insert large text to this column which length is equal 22000. But I get "Too long value" error. What is the maximum length of NCLOB? (I use Oracle 11g)

Elvin Mammadov
  • 25,329
  • 11
  • 40
  • 82
vaqifrv
  • 754
  • 1
  • 6
  • 20
  • 3
    The maximum length is 4 GB of data, which comes down to 2 GB of characters. Obviously that's not your problem. How are you inserting the data? Through a query or a UI? – Jeroen Mostert Sep 28 '16 at 10:08
  • from UI, I insert only string, and it's length is 22000. What is a best way for it? – vaqifrv Sep 28 '16 at 10:12
  • 1
    Try just using a plain query. The UI may have its own restrictions on what it can support. See http://stackoverflow.com/questions/3890567/how-to-write-oracle-insert-script-with-one-field-as-clob (and related questions). – Jeroen Mostert Sep 28 '16 at 10:17
  • But from what UI? SQL*Plus? SQL Developer? DBeaver? A custom program? – Álvaro González Sep 28 '16 at 10:23
  • @ÁlvaroGonzález, I added column from Navicat and insert to data from web application – vaqifrv Sep 28 '16 at 10:42
  • Could we know the language the web application is written with and see the relevant insertion code? – Álvaro González Sep 28 '16 at 10:44
  • @ÁlvaroGonzález, I used `ASP.NET MVC5 ` and insert code is pure `SQL` insert query. – vaqifrv Sep 28 '16 at 10:48
  • So you use whatever database class the framework provides as default? Do you inject the value into the query or use prepared statements? (Whatever, I know nothing about ASP.NET, sorry.) – Álvaro González Sep 28 '16 at 10:53
  • 2
    The maximum length of a character _literal_ (constant) is 4000 byte (**not** characters). So if you supply a character literal that is longer then that, you will also get that error. You have to use bind variables if you want to insert longer values (actually you should **always** use bind variables if only for security reasons) –  Sep 28 '16 at 11:02

0 Answers0