/** * Convert a value to this column's type. * * @param v the value * @return the value */ public Value convert(Value v) { try { return v.convertTo(type); } catch (DbException e) { if (e.getErrorCode() == ErrorCode.DATA_CONVERSION_ERROR_1) { String target = (table == null ? "" : table.getName() + ": ") + getCreateSQL(); throw DbException.get( ErrorCode.DATA_CONVERSION_ERROR_1, v.getSQL() + " (" + target + ")"); } throw e; } }
buff.append(" CHANGE COLUMN "); buff.append(oldColumn.getSQL()).append(' '); buff.append(oldColumn.getCreateSQL()); return SQLTranslated.build().sql(buff.toString()); buff.append(" CHANGE COLUMN "); buff.append(oldColumn.getSQL()).append(' '); buff.append(oldColumn.getCreateSQL()); return SQLTranslated.build().sql(buff.toString()); buff.append(" CHANGE COLUMN "); buff.append(oldColumn.getSQL()).append(' '); buff.append(newColumn.getCreateSQL()); return SQLTranslated.build().sql(buff.toString()); buff.appendExceptFirst(", "); buff.append(" ADD COLUMN "); buff.append(column.getCreateSQL());
@Override public String getSQL() { StatementBuilder buff = new StatementBuilder(getName()); buff.append('('); int i = 0; for (Expression e : args) { buff.appendExceptFirst(", "); buff.append(columnList[i++].getCreateSQL()).append('=').append(e.getSQL()); } return buff.append(')').toString(); }
case CAST: { buff.append(args[0].getPreparedSQL(session, parameters)).append(" AS ") .append(new Column(null, dataType, precision, scale, displaySize).getCreateSQL()); break; .append(new Column(null, dataType, precision, scale, displaySize).getCreateSQL()); break;
buff.append(args[0].getSQL()).append(" AS "). append(new Column(null, dataType, precision, scale, displaySize).getCreateSQL()); break; buff.append(args[0].getSQL()).append(','). append(new Column(null, dataType, precision, scale, displaySize).getCreateSQL()); break;
for (Column column : prepared.getColumns()) { buff.appendExceptFirst(", "); buff.append(column.getCreateSQL());