예제 #1
0
파일: RPad.java 프로젝트: zenframework/z8
 @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();
   }
 }
예제 #2
0
파일: RPad.java 프로젝트: zenframework/z8
 @Override
 public void collectFields(Collection<IValue> fields) {
   string.collectFields(fields);
   length.collectFields(fields);
   pad.collectFields(fields);
 }