// FunctionColumns (arguments) from selected catalog (or all, if empty), matching schemas and functions
FunctionColumns (arguments) from selected catalog (or all, if empty), matching schemas and functions
// FunctionColumns ( arguments ) from selected catalog ( or all if empty ) matching schemas and functions
func (s InformationSchema) FunctionColumns(f metadata.Filter) (*metadata.FunctionColumnSet, error) {
	if !s.hasFunctions {
		return nil, metadata.ErrNotSupported
	}
	columns := []string{
		"specific_catalog",
		"specific_schema",
		"specific_name",
		"COALESCE(parameter_name, '')",
		"ordinal_position",
		"COALESCE(parameter_mode, '')",
		"data_type",
		s.clauses[FunctionColumnsColumnSize],
		s.clauses[FunctionColumnsNumericScale],
		s.clauses[FunctionColumnsNumericPrecRadix],
		s.clauses[FunctionColumnsCharOctetLength],
	}
	qstr := "SELECT\n  " + strings.Join(columns, ",\n  ") + " FROM information_schema.parameters\n"
	conds, vals := s.conditions(1, f, formats{
		catalog:    "specific_catalog LIKE %s",
		schema:     "specific_schema LIKE %s",
		notSchemas: "specific_schema NOT IN (%s)",
		parent:     "specific_name LIKE %s",
	})
	rows, closeRows, err := s.query(qstr, conds, "specific_catalog, specific_schema, specific_name, ordinal_position, COALESCE(parameter_name, '')", vals...)
	if err != nil {
		if err == sql.ErrNoRows {
			return metadata.NewFunctionColumnSet([]metadata.FunctionColumn{}), nil
		}
		return nil, err
	}
	defer closeRows()
	results := []metadata.FunctionColumn{}
	for rows.Next() {
		rec := metadata.FunctionColumn{}
		err = rows.Scan(
			&rec.Catalog,
			&rec.Schema,
			&rec.FunctionName,
			&rec.Name,
			&rec.OrdinalPosition,
			&rec.Type,
			&rec.DataType,
			&rec.ColumnSize,
			&rec.DecimalDigits,
			&rec.NumPrecRadix,
			&rec.CharOctetLength,
		)
		if err != nil {
			return nil, err
		}
		results = append(results, rec)
	}
	if rows.Err() != nil {
		return nil, rows.Err()
	}
	return metadata.NewFunctionColumnSet(results), nil
}
func ( s InformationSchema ) FunctionColumns ( f metadata . Filter ) ( * metadata . FunctionColumnSet , error ) { if ! s . hasFunctions { return nil , metadata . ErrNotSupported } columns := [ ] string { " " , " " , " " , " " , " " , " " , " " , s . clauses [ FunctionColumnsColumnSize ] , s . clauses [ FunctionColumnsNumericScale ] , s . clauses [ FunctionColumnsNumericPrecRadix ] , s . clauses [ FunctionColumnsCharOctetLength ] , } qstr := " \n " + strings . Join ( columns , " \n " ) + " \n " conds , vals := s . conditions ( 1 , f , formats { catalog : " " , schema : " " , notSchemas : " " , parent : " " , } ) rows , closeRows , err := s . query ( qstr , conds , " " , vals ... ) if err != nil { if err == sql . ErrNoRows { return metadata . NewFunctionColumnSet ( [ ] metadata . FunctionColumn { } ) , nil } return nil , err } defer closeRows ( ) results := [ ] metadata . FunctionColumn { } for rows . Next ( ) { rec := metadata . FunctionColumn { } err = rows . Scan ( & rec . Catalog , & rec . Schema , & rec . FunctionName , & rec . Name , & rec . OrdinalPosition , & rec . Type , & rec . DataType , & rec . ColumnSize , & rec . DecimalDigits , & rec . NumPrecRadix , & rec . CharOctetLength , ) if err != nil { return nil , err } results = append ( results , rec ) } if rows . Err ( ) != nil { return nil , rows . Err ( ) } return metadata . NewFunctionColumnSet ( results ) , nil }
FunctionColumns (arguments) from selected catalog (or all, if empty), matching schemas and functions
FunctionColumns ( arguments ) from selected catalog ( or all if empty ) matching schemas and functions