Host variables in dynamic SQL
In dynamic SQL statements, parameter markers are used instead of host variables.
A parameter marker is a question mark (?) that represents a position in a dynamic SQL statement where the application will provide a value.
INSERT INTO PCB01.DOCTOR (hospital_HOSPCODE, patient_patnum, ward_wardno, doctno,docname) VALUES (?,?,?,?,?)
- Parameter marker replacement:
- Before the prepared statement is executed, each parameter marker in the statement is effectively replaced by its corresponding host variable. The replacement is an assignment operation in which the source is the value of the host variable and the target is a variable. The assignment rules are those described for assignment to a column in Assignment and comparison.