Scalable Database Server, HiRDB Version 8 Description

[Contents][Glossary][Index][Back][Next]

5.2.5 Data insertion

Data insertion is the process of inserting rows into a table. The data insertion methods and an example of specifying SQL statements are shown as follows.

Data insertion methods
The INSERT statement is used to insert rows. The following two methods are available for inserting rows into a table:
  • Inserting rows by column
  • Inserting rows by row (specify ROW in the INSERT statement)

Data insertion SQL specification example
An example of inserting rows by column is explained as follows.
Example
In this example, the INSERT statement inserts in each column of the stock table (STOCK) the values set in embedded variables (:ZPCODE, :ZPNAME, :ZCOLOR, :ZPRICE, and :ZSQUANTITY) that are used for transferring values between a table and UAPs:
 
INSERT INTO STOCK (PCODE,PNAME,COLOR,PRICE,SQUANTITY)
  VALUES(:ZPCODE,:ZPNAME,:ZCOLOR,:ZPRICE,:ZSQUANTITY)