I have large data (more than 4000 characters) and I have a column of type VARCHAR2(4000)
in Oracle 11g.
Is there any way to insert that data in this column without changing its data type?
I have large data (more than 4000 characters) and I have a column of type VARCHAR2(4000)
in Oracle 11g.
Is there any way to insert that data in this column without changing its data type?
If you are referring to a variable defined in a PL/SQL package, function, or procedure, then the maximum length of a VARCHAR2 variable is 32k. If the value must be persisted then you have to decide if you want to keep the data contiguous. If you do, then you must change the column's datatype to CLOB. If it does not need to be contiguous, then simply create a child relation to store the pieces.
No, your data will get truncated, if it is more than the value you specified in the data type. The best way you can resolve this issue is by changing varchar2(4000)
to varchar2(max)
. MAX will allow you to insert data upto 32000 characters.