We have AL32UTF8 which is a multibyte character set, but now I wonder how could work your strategy of splitting in strings of 4000 characters for multibyte character sets...
Announcement
Collapse
No announcement yet.
X
-
Originally posted by Isomorphic View PostWe break it up into smaller strings automatically. But that's not going to help if the overall value still exceeds the column size, which is the problem here.
IE, if I assign my string in a java snippet to a foo variable, and then I execute:
System.out.println(foo.length());
and
System.out.println(foo.getBytes().length);
I get:
3989
and
4002
Comment
-
Sorry for the mess, I'll try to rephrase.
The (SmartClient generated) query doesn't work because it's trying to insert in the clob column a string which, in the Oracle charset, has more than 4000 characters. This query is in the attachment generated_query.sql.txt
generated_query.sql.txt
That String in java has .length() of 3989, while if I use .getBytes().length I get 4002.
I think that SmartClient is not splitting the string in the generated query because is using the former length measurement (instead it must use database charset?)
The field in the dataSource is declared as text without a length attribute. If I add a length="10000" attribute it works, but in the log in the generated query I don't see the full string, only the '?' (parameter binding is called, right?). Not sure if this is by design.
Without the length attribute Oracle raises an error even if the column is a Clob.
If I split the string in two, and use the TO_CLOB function for the two chunks, the query works (see attachment modified_query.sql.txt).
modified_query.sql.txt
Comment
-
Could you please share with us what exact Oracle version you are using? It seems that for you string splitting is entirely skipped and this most likely is caused by the Oracle version.Last edited by Isomorphic; 16 Jun 2019, 04:10.
Comment
Comment