0% found this document useful (0 votes)
28 views

Inserting: N N N N N

The document discusses different techniques for populating tables in a relational database with data after they have been created, including the INSERT, LOAD TABLE, and ISQL INPUT statements. The INSERT statement comes in two main flavors - explicitly providing values for each column one row at a time, or copying multiple rows from a SELECT query. The INSERT statement then has five specific formats depending on if values are provided for all or some columns and whether the AUTO NAME feature is used. LOAD TABLE and ISQL INPUT allow inserting data from external files in different ways. Each technique offers unique features discussed in the chapter, such as turning an INSERT into an UPDATE when primary keys collide.

Uploaded by

Nishki Gejmer
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
28 views

Inserting: N N N N N

The document discusses different techniques for populating tables in a relational database with data after they have been created, including the INSERT, LOAD TABLE, and ISQL INPUT statements. The INSERT statement comes in two main flavors - explicitly providing values for each column one row at a time, or copying multiple rows from a SELECT query. The INSERT statement then has five specific formats depending on if values are provided for all or some columns and whether the AUTO NAME feature is used. LOAD TABLE and ISQL INPUT allow inserting data from external files in different ways. Each technique offers unique features discussed in the chapter, such as turning an INSERT into an UPDATE when primary keys collide.

Uploaded by

Nishki Gejmer
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

Chapter 2

Inserting
2.1 Introduction
The second step in the life cycle of a relational database, after creating the
tables, is to populate those tables with data. SQL Anywhere offers three distinct
techniques: the INSERT, LOAD TABLE, and ISQL INPUT statements.
The INSERT statement comes in two flavors, depending on whether you
want to explicitly provide VALUES for each column, one row per INSERT, or
to copy an entire set of rows into a table from some other source with a single
INSERT, where the other source is anything a SELECT can produce.
Those two flavors of INSERT are broken down further in this chapter, into
five separate formats depending on whether values are provided for some or all
of the target tables columns and whether the AUTO NAME feature is used.
LOAD TABLE and ISQL INPUT provide two different ways to insert data
into a table from an external file.
Each of these techniques offer interesting features discussed in this chapter.
For example, the ON EXISTING UPDATE clause lets you turn an INSERT into
an UPDATE when primary keys collide, LOAD TABLE takes dramatic short-
cuts to offer better performance, and the ISQL INPUT statement can be used to
load fixed-layout records and other file formats from legacy sources.

2.2 INSERT
The INSERT statement comes in five different formats, discussed in the next
five sections:
n INSERT a single row using a VALUES list for all the columns.
n INSERT a single row using a column name list and matching VALUES list.
n INSERT multiple rows using a SELECT to retrieve values for all the
columns.
n INSERT multiple rows using a column name list and a matching SELECT.
n INSERT multiple rows using the WITH AUTO NAME clause instead of a
column name list.

49

You might also like