@Override public String format(DatabaseVendor vendor, FormatOptions options, boolean logicalContext) { pad = (pad == null ? new SqlConst(new string(" ")) : pad); switch (vendor) { case Oracle: return "RPAD(" + string.format(vendor, options) + "," + length.format(vendor, options) + "," + pad.format(vendor, options) + ")"; case SqlServer: return "LEFT(" + string.format(vendor, options) + "+REPLICATE(" + pad.format(vendor, options) + "," + length.format(vendor, options) + ")" + "," + length.format(vendor, options) + ")"; default: throw new UnknownDatabaseException(); } }
@Override public void collectFields(Collection<IValue> fields) { string.collectFields(fields); length.collectFields(fields); pad.collectFields(fields); }