Bound Variables Mode
Most database systems support the use of bound variables in SQL statements. When bound variables are used, the SQL statements contain variable markers. Here is an example:
UPDATE EMP
SET NAME = ?
WHERE ID = ?
The question marks represent variables. The value for a variable is provided separately. The advantage of using bound variables is that the same SQL statement can be reused even though the values involved change each time. Using the same SQL statement each time instead of having many SQL statements can offer a serious boost in performance. This is because the time spent in parsing an SQL statement and selecting an access plan on the database server can be significant.
Published date: 05/24/2022
Last modified date: 02/24/2022