}
@Override
public Row next() {
while(it.hasNext()) {
Routine routine = it.next();
if(isAccessible(session, routine.getName())) {
String routineType = (routine.getName().inSystemSchema() ? "SYSTEM " : "") +
(routine.isProcedure() ? "PROCEDURE" : "FUNCTION");
return new ValuesRow(rowType,
null,
routine.getName().getSchemaName(),
routine.getName().getTableName(),
null,
routine.getName().getSchemaName(),
routine.getName().getTableName(),
routineType,
null, null, null, // module catalog/schema/name
null, null, null, // udt catalog/schema/name
routine.getLanguage().equals("SQL") ? "SQL" : "EXTERNAL", // body
routine.getDefinition(), // definition
routine.getExternalName(), //external name
routine.getLanguage(), //language
routine.getCallingConvention().name(), //parameter_style
boolResult(false), //is deterministic
(routine.getSQLAllowed() == null) ? null : routine.getSQLAllowed().name().replace('_', ' '),
routine.isProcedure() ? null : boolResult(!routine.isCalledOnNullInput()),
null, //sql path
boolResult(true), // schema level routine
(long)(routine.getDynamicResultSets()),
null, null, // defined cast, implicit invoke
null, //security type
null, //as locator
boolResult(false), //is udt dependent
null, //created timestamp