f2s_esql_set_param¶
Applies to: Oracle, MS SQL, MySql/MariaDB, PostgreSQL Drivers
Syntax
f2s_esql_set_param {Parameter Number} to {value} [using {variant}]
Parameter |
Description |
---|---|
Parameter Number |
The parameter number (from 1 to iNum). |
value |
The value of the SQL Parameter. |
variant |
Optional variant type variable that will receive a statement interface. |
Description
This command sets a SQL Parameter for a SQL statement. Setting Parameters in SQL Queries helps prevent SQL Injection attacks also also helps optimize the performance of the SQL Execution.
The optional “using” syntax allows you to pass around the interface created by this command. The variable passed MUST be a variant. This allows for multiple statements to be active concurrently in some cases. If you use the “using” syntax, it must be used on all subsequent commands. Mixing the using syntax is not supported. So for instance, if you plan on having multiple statements active concurrently, all active statements must make use of the using syntax.
Example
- f2s_esql_set_param Command
Variant[] vRow f2s_esql_create_stmt "select * from orderheader where SalesPerson_ID = ?" f2s_esql_prepare_stmt f2s_esql_set_param 1 to "NONE" f2s_esql_execute_stmt f2s_esql_move_next While (Found) f2s_esql_get_row vRow Showln (SFormat("First Column: %1 Second Column: %2",vRow[0], vRow[1])) f2s_esql_move_next Loop f2s_esql_close_stmt
Related Commands
f2s_esql_execute_stmt
f2s_esql_move_next
f2s_esql_close_stmt
f2s_esql_next_resultset
Replaces: n/a