Data Model > Accessing the UNICOM Intelligence Data Model > Working with the Case Data Model > SQL syntax > Data manipulation statements > INSERT
 
INSERT
The INSERT statement adds a new row to a table.
Syntax
INSERT
  [ INTO ]
    table [ ( column [, column... ] ) ]
  { VALUES
    ( expression [, expression... ] )
  | select_statement }
Notes
The INSERT statement does not support the DEFAULT keyword, as the Provider has no concept of defaults. However, expressions can use the NULL keyword.
For information about including special characters in the text when inserting a text variable, see Inserting and updating text variables.
Example
See Using the examples in this section.
INSERT INTO vdata
(serial, gender, museums, name)
VALUES (603,
{female},
{national_museum_of_science,national_art_gallery},
'Tanya Smiley')
This example adds a row to VDATA and puts the specified values into the serial, gender, museums, and name columns. It sets all of the other columns in the table to NULL. After running the example, you can check the values using this query:
SELECT serial AS Serial,
gender AS Gender,
museums AS Museums,
name AS Name,
visits AS Visits,
entrance AS Entrance
FROM vdata
WHERE serial > 601
Here is the result set:
Serial Gender Museums Name Visits Entrance
------ -------- ------------------------------------------------- ------------ ------ --------
602 {female} {northern_gallery} 2 {main}
603 {female} {national_museum_of_science,national_art_gallery} Tanya Smiley
This query includes two columns (Visits and Entrance) for which no values were given. They have been set to NULL.
See also
UPDATE
DELETE
TRUNCATE TABLE
SQL syntax
Data manipulation statements