User Tools

Site Tools

A PCRE internal error occured. This might be caused by a faulty plugin


**HPL/SQL is included to Apache Hive since version 2.0** * [[home|Home]]\\ * [[why|Why HPL/SQL]]\\ * [[features|Key Features]]\\ * [[start|Get Started]]\\ * [[doc|HPL/SQL Reference]]\\ * [[download|Download]]\\ * [[new|What's New]]\\ * [[about|About]]


====== CREATE TABLE Statement - PL/HQL ====== CREATE TABLE statement create a table in the database. **Syntax**: <code language=sql> CREATE TABLE [IF NOT EXISTS] table_name ( column_name data_type [NULL | NOT NULL] [, constraint ...] [, ...] ) </code> ===== CREATE TABLE Conversion ===== If the CREATE TABLE statement is defined using the syntax not supported by Hive, it is automatically converted to conform to Hive syntax. Currently PL/HQL converts data types, removes NOT NULL/NULL, constraints and default values. For more information, see [[conversion|On-the-Fly Conversion]] **Example**: Convert SQL and create a table in Hive: <code language=sql> CREATE TABLE dept ( deptno NUMBER(2,0), dname NUMBER(14), loc VARCHAR2(13), CONSTRAINT pk_dept PRIMARY KEY (deptno) ); </code> **Compatibility:** Oracle, Microsoft SQL Server, IBM DB2, Teradata, PostgreSQL, MySQL and Netezza **Version**: PL/HQL 0.03 ~~NOTOC~~