You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Quite simple method is marked as too complex to analyze #95
public class SQLClob
{
protected static final int MAX_STRING_LITERAL_LENGTH = 3904;
public final String value;
public SQLClob(String value)
{
this.value = value;
}
// @SuppressWarnings("ConstantConditions")
public void appendTo(StringBuilder sql)
{
if (value == null)
{
sql.append("to_clob(null)");
return;
}
else if (value.isEmpty())
{
sql.append("empty_clob()");
return;
}
for (int i = 0, j, n = value.length(); i < n; i = j)
{
if (i > 0) sql.append(" ||");
j = Math.min(i + MAX_STRING_LITERAL_LENGTH, n);
sql.append("to_clob('")
.append(value.substring(i, j).replace("'", "''"))
.append("')");
}
}
}
Activity
VISTALL commentedon Oct 22, 2021
simplified