Frends.IBMDB2.ExecuteQuery / 1.1.0
Summary
Runs SQL against a Db2 database, returning either rows or a count of rows affected depending on the statement, with parameters passed separately from the text.
Typical use — reading from and writing to Db2, including the mainframe editions, where parameterising is also what keeps injection out
Input parameters
| Name | Type | Default | Example | Description |
|---|---|---|---|---|
| ConnectionString | String |
Server = myAddress:myPortNumber;Database = myDataBase;UID = myUsername;PWD = myPassword; |
Server=myServerAddress;Database=myDataBase;User Id=myUsername;Password=myPassword; |
Connection string to the IBMDB2 database. |
| Query | String |
– | SELECT * FROM MyTable |
Query to be executed in string format. |
| Parameters | QueryParameter[] |
– | [ { Name = "id", Value = 1, DataType = SqlDataTypes.Auto }, { Name = "first_name", Value = "John", DataType = SqlDataTypes.NVarChar }, { Name = "last_name", Value = "Doe", DataType = SqlDataTypes.NVarChar } ] |
Parameters for the database query. |
| ExecuteType | ExecuteType |
– | ExecuteType.ExecuteReader |
Specifies how a command string is interpreted. Possible values:
|