Sybase 12.4.2 manual Partial-width insertion rules, Partial-width insertions, 198

Models: 12.4.2

1 536
Download 536 pages 20.34 Kb
Page 218
Image 218

Partial-width insertions

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:

1For 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.

198

Page 218
Image 218
Sybase 12.4.2 manual Partial-width insertion rules, Partial-width insertions, 198