Modifying Data with Action Queries

The queries that we have explored thus far are all SELECT queries. This means that they select data from one or more tables. The queries that we will discuss now are action queries. They are queries that modify data. The five types of action queries that we will discuss are INSERT, UPDATE, SELECT INTO, DELETE, and TRUNCATE.

The INSERT Statement

You use the INSERT statement to insert data into an existing table. The INSERT statement has the following format:

INSERT [INTO] table_or_view [(col1, col2...)] VALUES (value1, value2)
						

Here's an example:

INSERT INTO Customers
(CustomerID, CompanyName, ContactName,
							ContactTitle, City, Country)
VALUES
('INFO', 'InfoTechnology Partners, Inc.',
							'Alison Balter', 'President', ...

Get Alison Balter's Mastering Access 2002 Enterprise Development now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.