MySQL · Types · Procedures and functions

ArxProcedureExpression

Definition

Namespace
ARX.SDK.Query
Package
ARX.SDK
C#
public sealed class ArxProcedureExpression

A call to a routine the database owns: a stored procedure or a function, with its parameters, in the pattern of ArxQueryExpression. Never SQL text.

Constructor

  • ArxProcedureExpression()

    A call with no routine yet: set ProcedureName.

  • ArxProcedureExpression(string procedureName)

    A call to this procedure; set ProcedureType to call a function.

    Parameter Type Description
    procedureNamestringThe routine, or schema.routine.

Properties

  • string ProcedureName { get; set; }

    The routine's name, optionally schema-qualified (reporting.sp_close_month). Validated by the provider.

  • ArxProcedureType ProcedureType { get; set; }

    Procedure (the default) or function.

  • List<ArxProcedureParameter> Parameters { get; set; }

    The parameters, in the order they are passed.

  • bool ReturnsCursors { get; set; }

    A function that returns refcursor or SETOF refcursor: each cursor is read as a result set. A procedure declares its cursors as parameters instead.

  • List<ArxOrderExpression> Orders { get; set; }

    The order of a function's rows when ARX pages them (way 2). Not for procedures.

  • ArxPagingInfo? PageInfo { get; set; }

    The page to return: of a function's rows, of a cursor, or through the routine's own paging arguments (PagingParameters).

  • ArxPagingParameters? PagingParameters { get; set; }

    The routine pages itself: ARX fills these arguments from PageInfo (way 1).

  • string? PagedResultSet { get; set; }

    Which result set PageInfo pages when there are several cursors: a cursor parameter's name. The first by default.

Methods

  • void AddParameter(string name, object? value)

    A named IN argument.

    Parameter Type Description
    namestringThe routine's parameter name, as the database declares it.
    valueobject?The value, sent as a parameter; null for SQL NULL.
  • void AddParameter(object? value)

    A positional IN argument (positional arguments come before named ones).

    Parameter Type Description
    valueobject?The value, sent as a parameter; null for SQL NULL.
  • void AddParameter(string name, Type type, object? value)

    A named IN argument with its type, for a null the database can't type by itself (an overloaded routine).

    Parameter Type Description
    namestringThe routine's parameter name, as the database declares it.
    typeTypeThe parameter's .NET type, so a null is sent with the right database type.
    valueobject?The value, sent as a parameter; null for SQL NULL.
  • void AddOutParameter<T>(string name)

    An OUT parameter of a procedure, read into Outputs[name] as T.

    Parameter Type Description
    namestringThe routine's OUT parameter name; its value is read back into the result's Outputs.
  • void AddOutParameter(string name, Type type)

    An OUT parameter of a procedure, read into Outputs[name] as type.

    Parameter Type Description
    namestringThe routine's OUT parameter name; its value is read back into the result's Outputs.
    typeTypeThe .NET type the value is read as.
  • void AddInOutParameter<T>(string name, T value)

    An INOUT parameter: value goes in, the procedure's value is read into Outputs[name].

    Parameter Type Description
    namestringThe routine's INOUT parameter name; the value it ends with is read back.
    valueTThe value sent in.
  • void AddCursorParameter(string name)

    A table the procedure returns, through an INOUT refcursor parameter: read into ResultSets[name].

    Parameter Type Description
    namestringThe parameter through which the procedure returns a table (a refcursor on PostgreSQL), read as a result set.
  • void AddVariadicParameter(string name, Array values)

    An array passed to a named VARIADIC parameter.

    Parameter Type Description
    namestringThe routine's VARIADIC parameter name.
    valuesArrayThe values, sent as one array.
  • void AddVariadicParameter(Array values)

    An array passed to a positional VARIADIC parameter.

    Parameter Type Description
    valuesArrayThe values, sent as one array.
  • void AddOrder(string attributeName, ArxOrderType orderType)

    Orders a function's rows (way 2).

    Parameter Type Description
    attributeNamestringThe result column to order by.
    orderTypeArxOrderTypeAscending or Descending.

Usage

C#

A line from a verified sample; the full, runnable code is on its page.

var procedure = new ArxProcedureExpression("sp_contacts_named");

Rows from a function: refused on MySQL, and what to read instead, scenario 3

Used in: