Products Support Documentation Download
Inserting Data into a Database

In this section you will learn how to put data into an RDM SQL database. Three methods are available to you for doing this. The most common is through the insert values statement that stores a single row into a table. Another is to use the insert select statement that lets you store all of the rows returned from a select statement into a table. The select retrieves rows from other tables in the same database or in another database. The third method is through the use of the non-standard import statement. This statement can insert new rows into a table from data stored in a comma-delimited or XML text file.

When making modifications to database content it is vitally important to maintain the logical integrity of the data. Logical integrity means that all the related rows from multiple tables, as defined by the foreign and primary key relationships in the DDL, always exist. That means, for example, that for every book stored in the bookshop database the referenced author row exists as do all of its related names, notes, sales and auctions. Logical integrity is achieved through the use of transactions. This section will also show you how to use SQL transactions to ensure that the logical integrity of your database remains intact and it is with that subject that we begin.