* INTERNAL:
* Returns null unless the platform supports call with returning
*/
@Override
public DatabaseCall buildCallWithReturning(SQLCall sqlCall, Vector returnFields) {
SQLCall call = new SQLCall();
call.setParameters(sqlCall.getParameters());
call.setParameterTypes(sqlCall.getParameterTypes());
Writer writer = new CharArrayWriter(200);
try {
writer.write("BEGIN ");
writer.write(sqlCall.getSQLString());
writer.write(" RETURNING ");
for (int i = 0; i < returnFields.size(); i++) {
DatabaseField field = (DatabaseField)returnFields.elementAt(i);
writer.write(field.getNameDelimited(this));
if ((i + 1) < returnFields.size()) {
writer.write(", ");
}
}
writer.write(" INTO ");
for (int i = 0; i < returnFields.size(); i++) {
DatabaseField field = (DatabaseField)returnFields.elementAt(i);
call.appendOut(writer, field);
if ((i + 1) < returnFields.size()) {
writer.write(", ");
}
}
writer.write("; END;");
call.setQueryString(writer.toString());
} catch (IOException exception) {
throw ValidationException.fileError(exception);
}