SetCharParameterByName()
- Last UpdatedOct 13, 2022
- 1 minute read
Use the SetCharParameterByName() method to configure a character string parameter by the name encoded into the text of a SQL statement using the @ character.
Syntax
result SetCharParameterByName (
string ParameterName,
object ParameterValue,
aaDBParameterDirection ParameterDirection,
int Length)
Parameters
ParameterName
The string identifier that is used in the SQL statement.
In the following SQL statement the input parameter is "lastName."
"SELECT * FROM Person.Contact WHERE (LastName = @lastName)"
ParameterValue
A string constant or valid ArchestrA reference string. For example:
-
"Smith"
-
me.LastName
-
null - Output and ReturnValue parameters.
ParameterDirection
For possible values, see aaDBParameterDirection.
Length
Specifies the maximum length of the parameter.
If the length of the parameterValue is greater, the parameterValue is truncated to the specified length.
Example
SetCharParameterByName ("lastName", "Smith",aaDBParameterDirection.Input, 50)