DB2 Table Like parameter

DDL With Default Statement DB2 DML Statements

Advertisements


LIKE used to create a new table as the same as the existing table.

In other words, creating a table that has exactly the same name and description as the columns of the identified table or view.

The table name specified after LIKE should be identified in the existing system.


Syntax:
						
	CREATE TABLE Table name
		(Column1 data-type [NOT][NULL] [WITH DEFUALT default-value],
		 Column2 data-type [NOT][NULL] [WITH DEFUALT default-value],
		 Column3 data-type [NOT][NULL] [WITH DEFUALT default-value],
			.
			.
		 Column-n data-type [NOT][NULL] [WITH DEFUALT default-value]
		 Primary key/foreign key column1,column2….column-n,
		 [LIKE reference table name]
	  ON database-name.tablespace-name)
			
						

If any questions on the above, post your queries on DB2 Discussion forum


DDL With Default Statement DB2 DML Statements

Advertisements