{
//Are we dealing with user defined function or procedure?
if (aliasType == AliasInfo.ALIAS_TYPE_FUNCTION_AS_CHAR ||
aliasType == AliasInfo.ALIAS_TYPE_PROCEDURE_AS_CHAR) {
RoutineAliasInfo rai = (RoutineAliasInfo)aliasInfo;
// Set the collation for all string types in parameters
// and return types including row multi-sets to be that of
// the schema the routine is being defined in.
rai.setCollationTypeForAllStringTypes(
getSchemaDescriptor().getCollationType());
bindParameterTypes( (RoutineAliasInfo)aliasInfo );
if ( rai.hasVarargs() )
{
switch ( rai.getParameterStyle() )
{
case RoutineAliasInfo.PS_DERBY_JDBC_RESULT_SET:
case RoutineAliasInfo.PS_DERBY:
break;
default:
throw StandardException.newException( SQLState.LANG_VARARGS_PARAMETER_STYLE );
}
if ( rai.getMaxDynamicResultSets() > 0 )
{
throw StandardException.newException( SQLState.LANG_VARARGS_RETURN_RESULT_SETS );
}
}
if (
(rai.getParameterStyle() == RoutineAliasInfo.PS_DERBY) &&
!rai.hasVarargs()
)
{
throw StandardException.newException( SQLState.LANG_DERBY_PARAMETER_STYLE );
}
}