Using SQL within C code and the API will involve parameterized SQL—the way to include data placeholders in an SQL statement. These are the two types of parameterized binding: named and positional. See Figure 10 for more details on how these types of parameterized binding are used. The first statement is positional where its position is located or marked by a question mark, and these positions are based on the number of columns.
The real variable names setup in the programmable language, such as C or Java, as shown in the second insert statement in Figure 10, outlines the named parameters that use a colon as a prefix to indicate it on an SQL statement. By default, NULL
is used as a default value if there is no value for it to be bound to.
Once a statement is bound, you can call on it again more than once without wasting the performance or time to recompile it again.
The whole idea of using parameterized SQL is to reuse the same code with different parameters without recompiling...