Partial-width insertion rules – Sybase 12.4.2 User Manual

Page 218

Advertising
background image

Partial-width insertions

198

Use

START ROW ID

to specify at which row you want to start the insert. This

allows you to insert into some of the columns in a row with one partial-width

INSERT

or

LOAD TABLE

statement, and insert into the other columns in the

same row with additional

INSERT

or

LOAD TABLE

statements.

If you try to insert into a column that already contains data, you get an error.

You must be sure to control the row at which each insertion starts. If you do not
use

START ROW ID

, your insertion begins with the next row, and NULLs are

inserted in the remaining columns of the current row, as shown in Figure 5-1.
(The two shading patterns represent data inserted into columns in two separate
insert operations.)

Figure 5-1: Using START ROW ID with partial-width insertions

Note

Do not try to perform a partial-width insertion using the

INSERT VALUES

command format. Because you cannot specify

START ROW ID

using this

format, the problem shown in the figure results.

Partial-width insertion rules

Column indexes that are not included in the initial partial-width insert, and
therefore do not already contain data, must allow NULLs. Adaptive Server IQ
inserts NULLs into these column indexes. If they do not allow NULLs, the
insert fails.

When doing partial-width inserts, follow these steps:

1

For the first partial-width insert for each set of rows, do not specify

START

ROW ID

. Adaptive Server IQ automatically knows what the next available

row is for this insert.

Advertising