The procedure for how to use dbload with named row types is somewhat different than for other complex data types because named row types are actually user-defined data types. In fact, you can follow these steps for any user-defined data type.
This example uses a table person that contains one column with a named row type. The person_t named row type contains six fields: name, address, city, state, zip, and bdate.
The following syntax shows how to create the named row type and the table used in this example:
CREATE ROW TYPE person_t
(
name VARCHAR(30) NOT NULL,
address VARCHAR(20),
city VARCHAR(20),
state CHAR(2),
zip VARCHAR(9),
bdate DATE
);
CREATE TABLE person of TYPE person_t;
Brown, James|13 First St.|San Francisco|CA|94070|01/04/1940| Karen Smith|5820 Easy Ave #100|Fremont|CA|94502|01/13/1983|
dbschema -d stores_demo -u person_t > schema.sql dbschema -d stores_demo -t person > schema.sql
For detailed steps, see DB-Access Input from dbschema Output.
FILE person.unl DELIMITER '|' 6; INSERT INTO person;
This dbload example shows how to insert new data rows into the person table. The number of rows in the INSERT statement and the dbload command file must match:
FILE person.unl DELIMITER '|' 6;
INSERT INTO person
VALUES ('Jones, Richard', '95 East Ave.',
'Philadelphia', 'PA',
'19115',
'03/15/97');dbload -d newdb -c uds_command -l errlog