Enumerations

The public enumerations of the Aumerial.Data.Nti namespace, with their values. Numeric values marked "v4 compat" are a contract: they will not change.

NamingConvention

SQL naming convention, carried by the NamingConvention property of NTiConnection and the naming keyword (accepted values: sql, *sql, 0; sys, system, *sys, 1). The EF Core provider requires SQL (clear error otherwise). v4 compat values.

Member Value Semantics
SQL 0 *SQL naming: SCHEMA.TABLE
System 1 *SYS naming: LIB/TABLE and library list resolution

CatalogName

DB2 for i catalog views (under QSYS2) retrievable through GetSchema(CatalogName, restrictions): the member name IS the view name; the numeric value follows declaration order and is not a contract. The ADO.NET collection aliases (Tables, Columns, Schemas, Views, Keys, Fields, Constraints, Procedures, Functions...) map onto these through GetSchema(string) and MapCollection(string). The first restriction filters by object name (schema name for SYSSCHEMAS). On IBM i 7.2, some views do not exist yet and the matching collections are unavailable (7.4 or later recommended).

SYSCATALOGS, SYSCHKCST, SYSCOLAUTH, SYSCOLUMNS, SYSCOLUMNS2, SYSCOLUMNSTAT,
SYSCONTROLS, SYSCONTROLSDEP, SYSCST, SYSCSTCOL, SYSCSTDEP, SYSFIELDS, SYSFUNCS,
SYSINDEXES, SYSINDEXSTAT, SYSJARCONTENTS, SYSJAROBJECTS, SYSKEYCST, SYSKEYS,
SYSMQTSTAT, SYSPACKAGE, SYSPACKAGEAUTH, SYSPACKAGESTAT, SYSPACKAGESTMTSTAT,
SYSPARMS, SYSPARTITIONDISK, SYSPARTITIONINDEXDISK, SYSPARTITIONINDEXES,
SYSPARTITIONINDEXSTAT, SYSPARTITIONMQTS, SYSPARTITIONSTAT, SYSPROCS,
SYSPROGRAMSTAT, SYSPROGRAMSTMTSTAT, SYSREFCST, SYSROUTINEAUTH, SYSROUTINEDEP,
SYSROUTINES, SYSSCHEMAAUTH, SYSSCHEMAS, SYSSEQUENCEAUTH, SYSSEQUENCES,
SYSTABAUTH, SYSTABLEDEP, SYSTABLEINDEXSTAT, SYSTABLES, SYSTABLESTAT, SYSTRIGCOL,
SYSTRIGDEP, SYSTRIGGERS, SYSTRIGUPD, SYSTYPES, SYSUDTAUTH, SYSVARIABLEAUTH,
SYSVARIABLEDEP, SYSVARIABLES, SYSVIEWDEP, SYSVIEWS, SYSXSROBJECTAUTH,
XSRANNOTATIONINFO, XSROBJECTCOMPONENTS, XSROBJECTHIERARCHIES, XSROBJECTS

NTiType

DB2 for i data types, SQLTYPE numbers (v4 compat values). Exposed by NTiParameter.NTiType, derived by the server when the statement is prepared (0 before prepare; v4 threw a NullReferenceException in that case). Decimal is the packed decimal, Numeric the zoned decimal; Float, Real and Double share SQLTYPE 480 (FLOAT).

Member Value Member Value
Date 384 Numeric 488
Time 388 BigInt 492
Timestamp 392 Integer 496
Datalink 396 SmallInt 500
Blob 404 RowID 904
Clob 408 Varbinary 908
DbClob 412 Binary 912
Varchar 448 Xml 988
Char 452 Decfloat 996
Vargraphic 464 Boolean 2436
Graphic 468 Float 480
Decimal 484 Real, Double 480

DecfloatRoundOption

DECFLOAT rounding mode, sent to the server (v4 compat values). DecfloatRoundMode property on the connection; the roundoption keyword takes the NUMERIC value.

Member Value Rounding
HalfEven 0 to nearest, ties to the even digit
HalfUp 1 to nearest, ties up
Down 2 towards zero (truncation)
Ceiling 3 towards plus infinity
Floor 4 towards minus infinity
HalfDown 5 to nearest, ties down
Up 6 away from zero

NTiServiceProgramReturnFormat

Return value formats of CallServiceProgram/CallServiceProgramAsync; the values are those of the QZRUCLSP system API. Value 2 (pointer return) is deliberately absent: a space pointer only has meaning inside the server job; a procedure returning text fills a caller supplied buffer.

Member Value Semantics
None 0 no return value (the method returns null)
Integer 1 4 byte integer: read rc.GetInt()
IntegerAndErrno 3 4 byte integer followed by the 4 byte errno: read rc.GetInt() and rc.GetInt(4)

NTiServiceProgramParameterFormat

How a service program procedure parameter is passed, set through the ServiceProgramParameterFormat property of NTiProgramParameter; QZRUCLSP values.

Member Value Semantics
ByValue 1 BINARY(4) passed by value; the data must be exactly 4 bytes
ByReference 2 the storage is passed by reference: the procedure receives its address (default)

ParameterDirection (System.Data)

Standard ADO.NET enumeration (Microsoft reference); NTi usage on program parameters:

Member NTi usage
Input bytes sent, nothing returned
Output declared length only, buffer returned in OutputData
InputOutput default: sent AND returned
ReturnValue treated as Output by CallProgram

Example

using System;
using System.Data;
using System.Threading.Tasks;
using Aumerial.Data.Nti;

class EnumsDemo
{
    static async Task Main()
    {
        await using var connection = new NTiConnection(
            "server=MYIBMI;user=MYUSER;password=MYPASSWORD;naming=sql;roundoption=0");
        await connection.OpenAsync();                     // Open() remains available for sync code

        // Typed equivalents of the keywords
        Console.WriteLine(connection.NamingConvention);   // NamingConvention.SQL
        Console.WriteLine(connection.DecfloatRoundMode);  // DecfloatRoundOption.HalfEven

        // CatalogName: typed QSYS2 catalog view; first restriction = object name
        DataTable columns = connection.GetSchema(CatalogName.SYSCOLUMNS, new[] { "ORDERS" });
        foreach (DataRow row in columns.Rows)
            Console.WriteLine(row["COLUMN_NAME"]);
    }
}

Reconnecting to the server...

The connection to the server was lost. The page will reload.