Package org.apache.derby.catalog.types

Examples of org.apache.derby.catalog.types.RoutineAliasInfo


  {
    //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 );
            }
    }
View Full Code Here


        for ( int i = 0; i < systemFunctions.size(); i++ )
        {
      AliasDescriptor function = (AliasDescriptor) systemFunctions.get(i);

      RoutineAliasInfo routineInfo = (RoutineAliasInfo) function.getAliasInfo();
      int parameterCount = routineInfo.getParameterCount();
      if ( parameterCount == 1 )  { throw illegalAggregate(); }
        }
       
        //
        // Additional builtin 1-arg functions which are represented in the grammar
View Full Code Here

            java.util.List funcList = dd.getRoutineList( sd.getUUID().toString(), aliasName, AliasInfo.ALIAS_TYPE_FUNCTION_AS_CHAR );
            for ( int i = 0; i < funcList.size(); i++ )
            {
        AliasDescriptor func = (AliasDescriptor) funcList.get(i);

        RoutineAliasInfo funcInfo = (RoutineAliasInfo) func.getAliasInfo();
                if ( funcInfo.getParameterCount() == 1 )
                {
                    throw StandardException.newException
                        ( SQLState.LANG_BAD_UDA_OR_FUNCTION_NAME, schemaName, aliasName );
                }
      }
View Full Code Here

       
        for (int i = list.size() - 1; i >= 0; i--)
        {
            AliasDescriptor proc = (AliasDescriptor) list.get(i);
           
            RoutineAliasInfo procedureInfo = (RoutineAliasInfo) proc.getAliasInfo();
            int parameterCount = procedureInfo.getParameterCount();
            if (parameterCount != ((RoutineAliasInfo) aliasInfo).getParameterCount())
            { continue; }
           
            // procedure duplicate checking is simple, only
            // one procedure with a given number of parameters.
View Full Code Here

             (TupleDescriptor) null,
             (List) null,
             true,
             TransactionController.ISOLATION_REPEATABLE_READ,
             tc);
        RoutineAliasInfo   oldRai = (RoutineAliasInfo) oldAD.getAliasInfo();
        TypeDescriptor     newReturnType = DataTypeDescriptor.getCatalogType( Types.VARCHAR, Limits.MAX_CLOB_RETURN_LEN );
        RoutineAliasInfo   newRai = new RoutineAliasInfo
            (
             oldRai.getMethodName(),
             oldRai.getParameterCount(),
             oldRai.getParameterNames(),
             oldRai.getParameterTypes(),
View Full Code Here

                        // All parameters must be IN.
                        paramModes[i] = JDBC30Translation.PARAMETER_MODE_IN;
                    }

          // details[3] = java method
          RoutineAliasInfo ai = new RoutineAliasInfo(details[3],
              paramCount, paramNames,
              pt, paramModes, 0,
                            RoutineAliasInfo.PS_JAVA, RoutineAliasInfo.NO_SQL, isDeterministic, hasVarargs,
                            false, /* hasDefinersRights */
              false, rt);
View Full Code Here

                arg_modes[i] = JDBC30Translation.PARAMETER_MODE_IN;
            for (int i = 0; i < num_out_param; i++)
                arg_modes[num_in_param + i] = JDBC30Translation.PARAMETER_MODE_OUT;
        }

        RoutineAliasInfo routine_alias_info =
            new RoutineAliasInfo(
                routine_name,                       // name of routine
                num_args,                           // number of params
                arg_names,                          // names of params
                arg_types,                          // types of params
                arg_modes,                          // all "IN" params
View Full Code Here

        if (calledOnNullInputO == null)
          calledOnNullInput = true;
        else
          calledOnNullInput = calledOnNullInputO.booleanValue();

        aliasInfo = new RoutineAliasInfo(this.methodName, paramCount, names, types, modes, drs,
            ((Short) routineElements[5]).shortValue()// parameter style
            sqlAllowed, calledOnNullInput, (TypeDescriptor) routineElements[8]);

        implicitCreateSchema = true;
        }
View Full Code Here

            paramCount = 0;
            paramModes = null;
          }
         
          // details[3] = java method
          RoutineAliasInfo ai = new RoutineAliasInfo(details[3],
              paramCount, paramNames,
              pt, paramModes, 0,
              RoutineAliasInfo.PS_JAVA, RoutineAliasInfo.NO_SQL,
              false, rt);
View Full Code Here

                arg_modes[i] = JDBC30Translation.PARAMETER_MODE_IN;
            for (int i = 0; i < num_out_param; i++)
                arg_modes[num_in_param + i] = JDBC30Translation.PARAMETER_MODE_OUT;
        }

        RoutineAliasInfo routine_alias_info =
            new RoutineAliasInfo(
                routine_name,                       // name of routine
                num_args,                           // number of params
                arg_names,                          // names of params
                arg_types,                          // types of params
                arg_modes,                          // all "IN" params
View Full Code Here

TOP

Related Classes of org.apache.derby.catalog.types.RoutineAliasInfo

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.