Home | Previous Page | Next Page   Data Migration Utilities > The dbload Utility > Command File to Load Complex Data Types (IDS 9.x or Later) >

Using dbload with Unnamed Row Types

You can use dbload with unnamed row types. In the following example, the devtest table contains two columns with unnamed row types, s_name and s_address. The s_name column contains three fields: f_name, m_init, and l_name. The s_address column contains four fields: street, city, state, and zip.

CREATE TABLE devtest 
( 
s_name ROW(f_name varchar(20), m_init char(1), l_name varchar(20) 
not null), 
s_address ROW(street varchar(20), city varchar(20), state char(20), 
zip varchar(9) 
);

The data from the devtest table is unloaded into the devtest.unl file. Each data row contains two delimited fields, one for each unnamed row type. The ROW constructor precedes each unnamed row type, as follows:

ROW('Jim','K','Johnson')|ROW('10 Grove St.','Eldorado','CA','94108')| 
ROW('Candy','S','Cane')|ROW('7 Willy Wonka 
Ave.','Hershey','PA','17033')|

This dbload example shows how to insert data that contains unnamed row types into the devtest table. Put double quotes around each unnamed row type or the insert will not work.

FILE devtest.unl DELIMITER '|' 2; 
   INSERT INTO devtest (s_name, s_address) 
   VALUES ("row('Craig', 'X', 'Smith')", 
      "row('1200 Cheese Ave.', 'Rainy City', 'OR', '97200')"); 
Home | [ Top of Page | Previous Page | Next Page | Contents | Index ]