Insert one or more rows of data into an HStore table.
1 2 3 | INSERT [/*+ plan_hint */] [ IGNORE | OVERWRITE ] INTO table_name [ AS alias ] [ ( column_name [, ...] ) ] { DEFAULT VALUES | VALUES {( { expression | DEFAULT } [, ...] ) }[, ...] | query } |
Specifies the name of the target table.
Value range: an existing table name
Specifies an alias for the target table table_name. alias indicates the alias name.
Specifies the name of a column in a table.
Specifies a query statement (SELECT statement) that uses the query result as the inserted data.
1 2 3 4 5 6 7 | -- Create the reason_t1 table. CREATE TABLE reason_t1 ( TABLE_SK INTEGER , TABLE_ID VARCHAR(20) , TABLE_NA VARCHAR(20) )WITH(ORIENTATION=COLUMN, ENABLE_HSTORE=ON); |
1 | INSERT INTO reason_t1(TABLE_SK, TABLE_ID, TABLE_NA) VALUES (1, 'S01', 'StudentA'); |
1 2 3 4 5 6 7 8 | INSERT INTO reason_t1 VALUES (1, 'S01', 'StudentA'),(2, 'T01', 'TeacherA'),(3, 'T02', 'TeacherB'); SELECT * FROM reason_t1 ORDER BY 1; TABLE_SK | TABLE_ID | TABLE_NAME ----------+----------+------------ 1 | S01 | StudentA 2 | T01 | TeacherA 3 | T02 | TeacherB (3 rows) |