jay wrote:
hi,
Question on Load/import command.
consider a sample table
create table table_name (
col1 timestamp not null default current timestamp,
col2 int,
col3 int,
col4 int,
primary key(col1) );
There is a file file.del containing data for col2,col3,col4. Data for
col1 is missing.
Is there a way I can use load/import command to get data into above
table from file? How would I insert timestamp values into col1?
Running DB2 Ver 7.2.0 on RedHat 8.0.
Any feedback is highly appreciated,
thanks
jay
What you have described is inconsistent and will not work, unless you
want to and can do a s-l-o-w load, one that is slow enough that the
time stamp will change between loading one row and the next! If you
remove the requirement that col1 be a primary key, the load command
would be simply:
load from <filename> of del modified by coldel, insert into
table_name(col2,col3,col4);
To add time-stamps later, you would do an UPDATE.
Here is what I get with the primary key requirement removed (as you can
see, all four rows were loaded before the timestamp changed):
db2 => select * from table_name;
COL1 COL2 COL3 COL4
-------------------------- ----------- ----------- -----------
2005-02-19-10.48.22.275928 11 12 13
2005-02-19-10.48.22.275928 21 22 23
2005-02-19-10.48.22.275928 31 32 33
2005-02-19-10.48.22.275928 41 42 43
4 record(s) selected.
:- N. Shamsundar
:- University of Houston