Enumerations

The public enumerations of the Aumerial.Data.Nti namespace, with their values. Numeric values marked "v4 compatibility" 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 for NamingConvention.SQL, and sys, system, *sys, 1 for NamingConvention.System). The EF Core layer requires SQL (a clear error otherwise). v4 compatibility values.

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

CatalogName

DB2 for i catalog views (under QSYS2) queryable through GetSchema(CatalogName, restrictions). The member name is the view name, while the numeric value simply follows declaration order and is not a contract.

The ADO.NET collection aliases (Tables, Columns, Schemas, Views, Keys, Fields, Constraints, Procedures, Functions...) map onto them 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 compatibility values). Exposed by NTiParameter.NTiType, derived by the server when the statement is prepared (0 before preparation, a case where v4 used to throw a NullReferenceException). 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 compatibility values). The connection's DecfloatRoundMode property. The roundoption keyword takes the numeric value.

Member Value Rounding
HalfEven 0 to nearest, ties toward the even digit
HalfUp 1 to nearest, ties away toward the higher digit
Down 2 toward zero (truncation)
Ceiling 3 toward positive infinity
Floor 4 toward negative infinity
HalfDown 5 to nearest, ties toward the lower digit
Up 6 away from zero

NTiServiceProgramReturnFormat

Return value formats for CallServiceProgram/CallServiceProgramAsync. The values are those of the QZRUCLSP system API. Value 2 (pointer return) is deliberately absent, since a space pointer only makes sense inside the server job. A procedure that returns text fills a caller supplied buffer instead.

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

NTiServiceProgramParameterFormat

The passing mode for a service program procedure parameter, set through the ServiceProgramParameterFormat property of NTiProgramParameter. QZRUCLSP values.

Member Value Semantics
ByValue 1 a BINARY(4) passed by value. The data must be exactly 4 bytes
ByReference 2 the storage is passed by reference, the procedure receiving its address (default)

ParameterDirection (System.Data)

The standard ADO.NET enumeration (Microsoft reference). NTi usage on program parameters:

Member NTi usage
Input bytes sent, nothing returned
Output only the length is declared, the buffer comes back 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() is still available synchronously

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

        // CatalogName: typed QSYS2 catalog view; the first restriction is the 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.