LOTR
LOTR

Reputation: 113

How to inserb CLOB data?

Why when inserting clob from 1 to 2 table clob column is empty. I wanted to insert only unique elements After error destination buffer too small to hold clob

DBMS_LOB.SUBSTR(clob_column,1, 12000)

Upvotes: 0

Views: 90

Answers (1)

user5683823
user5683823

Reputation:

I assume you were trying to get the substring starting at position 1 and of length at most 12000, right?

For reasons only known to Oracle (and perhaps not even to them), the syntax of the DBMS_LOB programs is not consistent with the syntax of their standard string functions.

In DBMS_LOB.SUBSTR, the second argument is the desired length, and the third is the starting position. https://docs.oracle.com/database/121/ARPLS/d_lob.htm#ARPLS66748

So, try DBMS_LOB.SUBSTR(clob_column, 12000, 1).

With that said - I don't see how trying to copy a CLOB column from one table to another you would get an error like "buffer too small". I don't think you told us your true story. Of course, we can't help you fully if that's the case.

Upvotes: 3

Related Questions