VMware.Data.SQLFire.SQLFParameter

VMware.Data.SQLFire.SQLFParameter encapsulates the properties of a parameter being passed as input to prepared commands or callable procedures, or returned as output from callable procedures.

This class implements ADO.NET's System.Data.IDbDataParameter and extends the base System.Data.Common.DbParameter class.

Note: Using SQLFParameter objects is optional for parameterized queries in the driver for SQLFCommand objects. Instead, you can directly bind .NET objects as parameters and the driver automatically determines the various parameter attributes.

In addition when explicitly creating SQLFParameters, no specification of type, size, precision and other relevant attributes is required. For instance there is no need to specify the size of variable-sized data, or the size of a CHAR data type, or the scale/precision of NUMERIC data. The driver or server automatically determines the applicable attributes. Size specification is required only when the application needs to truncate the value to a given size. The same also applies to output parameters (ParameterDirection.Output or ParameterDirection.InputOutput), in which case the driver will fill in the size, scale, and precision attributes as applicable for the resulting value of the parameter.

Constructors

Method Description
SQLFParameter() Default constructor that creates a new parameter with no applicable type or other attributes.
SQLFParameter(string name, SQLFType type) Constructs a new parameter with given name and type.

The driver adds one additional property over DbParameter.

Type

Get or set the SQLFType of this parameter. Specifying the type of parameter is not strictly required and only expresses your intent. When this is not specified then the intended type is determined from the .NET class of the Value. In some cases the driver or server may need to perform an implicit conversion from the given type (either explicit or implicit when determined from the .NET class) to the actual type of the column or expression if the two do not match. If no such conversion is possible, an SQLException is thrown by the server (State: “XCL12�?).

For generic coding, users can continue to use the DbType property of DbParameter instead, and the driver maps to the corresponding SQLFire type implicitly.

For examples of usage, see the sections on named and positional parameters under VMware.Data.SQLFire.SQLFCommand.

The MSDN documentation for IDbDataParameter and DbParameter provides more details on the API methods and usage.