version 2004
DBGateway_AddStringParameter (connID; tagIndex; paramValue)
| Parameter | Type | Description | |
| connID | Longint | Connection ID returned by DBGateway_Connect | |
| tagIndex | String | Tag which will be replaced in the SQL query | |
| paramValue | String | String value to be substituted for the tag |
Description
The DBGateway_AddStringParameter command replaces a tag (tagIndex) with a String (paramValue) that you can use from your SQL query instead of the value itself.
connID is a Longint returned by DBGateway_Connect.
tagIndex is a String in the Select or Execute statement that will be replaced by paramValue at the time of execution.
paramValue is the String value that will replace tagIndex at the time of execution.
Example
DBGateway_AddStringParameter(connID;"%1";"My string") DBGateway_Execute(connID,"INSERT INTO test(field1, field2, field3) VALUES (%1, %2, %3))
Note that this call to DBGateway_AddStringParameter will also add quotes around the string and add SQL escape sequences for handling values with quotes.