DB2 Create Table X when X is a variable?
问题 In Oracle, we do this: def TNAME=&1 create table &TNAME (foo varchar(10)); How to do the equivalent for DB2? The constraints are: 1. The create table statement is generated when TNAME is unknown 2. The create table statement is in a file which cannot be modified 3. Cannot create a temporary file with TNAME substituted by awk 4. Essentially we want to pass in the table name at run time as an argument Possible? 回答1: The EXECUTE IMMEDIATE statement can be used in just about any block of SQL that