Revision 46727 trunk/org.gvsig.desktop/org.gvsig.desktop.compat.cdc/org.gvsig.fmap.dal/org.gvsig.fmap.dal.spi/src/main/java/org/gvsig/fmap/dal/feature/spi/SQLBuilderBase.java
SQLBuilderBase.java | ||
---|---|---|
3122 | 3122 |
return quote + id + quote; |
3123 | 3123 |
|
3124 | 3124 |
} |
3125 |
|
|
3126 |
@Override |
|
3127 |
public String as_clob(String s) { |
|
3128 |
int chunkSize = 1024; |
|
3129 |
StringBuilder builder = new StringBuilder(); |
|
3130 |
builder.append("(CAST('"); |
|
3131 |
for (int i = 0; i < s.length(); i += chunkSize) { |
|
3132 |
String chunk = s.substring(i, Math.min(s.length(), i + chunkSize)); |
|
3133 |
if( i>0 ) { |
|
3134 |
builder.append("' AS NCLOB) || CAST('"); |
|
3135 |
} |
|
3136 |
builder.append(StringUtils.replace(chunk, "'", "''")); |
|
3137 |
} |
|
3138 |
builder.append("' AS NCLOB))"); |
|
3139 |
return builder.toString(); |
|
3140 |
} |
|
3125 | 3141 |
|
3126 | 3142 |
@Override |
3127 | 3143 |
public String as_string(String s) { |
Also available in: Unified diff