Dynamic SQL
Dynamic SQL
Dynamic SQL
Allows programs to construct and submit SQL queries at
run time.
Example of the use of dynamic SQL from within a C
program.
char * sqlprog = ”update account set balance =
balance ∗1.05 where account-number = ?”
EXEC SQL prepare dynprog from :sqlprog;
char account[10] = ”A-101”;
EXEC SQL execute dynprog using :account;
The dynamic SQL program contains a ?, which is a place
holder for a value that is provided when the SQL program
is executed.
1. ODBC
Open DataBase Connectivity(ODBC)
standard
standard for application program to
communicate with a database server.
application program interface (API) to
open a connection with a database,
send queries and updates,