Class NpgsqlStatement
Represents a single SQL statement within Npgsql.
Instances aren't constructed directly; users should construct an NpgsqlCommand object and populate its CommandText property as in standard ADO.NET. Npgsql will analyze that property and constructed instances of NpgsqlStatement internally.
Users can retrieve instances from Statements and access information about statement execution (e.g. affected rows).
Inheritance
Inherited Members
Namespace: Npgsql
Assembly: Npgsql.dll
Syntax
public sealed class NpgsqlStatement
Properties
InputParameters
The input parameters sent with this statement.
Declaration
public List<NpgsqlParameter> InputParameters { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.List<NpgsqlParameter> |
OID
For an INSERT, the object ID of the inserted row if Rows is 1 and the target table has OIDs; otherwise 0.
Declaration
public uint OID { get; }
Property Value
Type | Description |
---|---|
System.UInt32 |
Rows
The number of rows affected or retrieved.
Declaration
public uint Rows { get; }
Property Value
Type | Description |
---|---|
System.UInt32 |
Remarks
See the command tag in the CommandComplete message, http://www.postgresql.org/docs/current/static/protocol-message-formats.html
SQL
The SQL text of the statement.
Declaration
public string SQL { get; set; }
Property Value
Type | Description |
---|---|
System.String |
StatementType
Specifies the type of query, e.g. SELECT.
Declaration
public StatementType StatementType { get; }
Property Value
Type | Description |
---|---|
StatementType |
Methods
ToString()
Returns the SQL text of the statement.
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
System.String |