DB2 Version 10.1 for Linux, UNIX, and Windows

String literals with PREPARE statements

Embedded SQL applications use the PREPARE statement to dynamically prepare an SQL statement for execution. The PREPARE statement creates an executable SQL statement from a character string form of the statement, called a statement string.

C and C++ embedded SQL applications can prepare a statement from a host variable or a literal string (statement string) that is enclosed in a single quotation mark.

For example: EXEC SQL PREPARE stmt_name FROM 'select empid from employee' ;