MySQL Shell API 8.0.40
Unified development interface for MySQL Products
|
It is good practice to not use values directly on expression strings. The way this is using a parameter or place holder on the expression to replace the real value, later the value is associated to the defined parameter or place holder.
There are two ways to achieve this:
Available on SQL strings, allows removing values from expression through the use of place holders. To finally associate the corresponding value just call the .bind(<value>) function.
Available on the CRUD operations, allows removing values from expressions through the use of named parameters. To finally associate the corresponding parameter values, call the .bind(<parameter>, <value>) function.
Each CRUD operation creates a binding context, in order to succeed all the defined parameters must have a value. A parameter could be used several times on the operation, even so, only one value can be assigned to it. If bind is called several times for the same parameter the last value will override the previous ones.