Multibyte characters caused me great pain.
Any suggestion on this issue?
I have a CLOB field that can contain several multi-byte characters, and I need to select in SQL and convert this field to a string for the next process, currently I use:
SELECT DBMS_LOB.SUBSTR( description, 4000, 1 ) FROM table
But the 4000 command in the above expression has a character length, not a byte. Therefore, I had to change to 3000 to handle any multibyte characters that could be painted over in the data, and a buffer size error would occur.
The problem is that records that do not contain a multibyte character can unnecessarily truncate more data than necessary. (4000 is a row limit, we can / should live with it.)
Is there a way to do something in the equivalent:
SELECT DBMS_LOB.SUBSTR( description, 4000bytes, 1 ) FROM table
This way I can get as much data as possible.
Note. I am not allowed to create temporary tables / views without using PL / SQL, only SQL SELECT ...
alchn
source share