PREPARE — prepare a statement for execution
PREPAREnameFROMstring
PREPARE prepares a statement dynamically specified as a string for execution. This is different from the direct SQL statement PREPARE, which can also be used in embedded programs. The EXECUTE command is used to execute either kind of prepared statement.
prepared_nameAn identifier for the prepared query.
stringA literal C string or a host variable containing a preparable statement, one of the SELECT, INSERT, UPDATE, or DELETE.
char *stmt = "SELECT * FROM test1 WHERE a = ? AND b = ?"; EXEC SQL ALLOCATE DESCRIPTOR outdesc; EXEC SQL PREPARE foo FROM :stmt; EXEC SQL EXECUTE foo USING SQL DESCRIPTOR indesc INTO SQL DESCRIPTOR outdesc;
PREPARE is specified in the SQL standard.