Hi,
Use Import Command.. That is so simple..
Regards,
Thiru.
WantedToBeDBA.
Certified DB2 DBA.
Michael Bader - 21 Nov 2005 08:35 GMT
> Hi,
> Use Import Command..
I did. However, it seems to be impossible to change a single field.
I can of course import an entire set of vaues into a table, but
that's not necessarily what I want to do. Moreover, the import didn't
work to well with .del-files. And I'm reluctant to modify the
.ixf-files ...
I was hoping for a shorter solution. Isn't there any?
Michael
> Hi,
>
[quoted text clipped - 7 lines]
> like 'update ... set field=[content of file] where ...'
> Is there an easy solution for this?
You can use a UDF that opens the file (passed as parameter to the UDF) and
returns the file's content as VARCHAR. Then a simple INSERT or UPDATE will
do the trick:
INSERT INTO tab
VALUES ( ..., readMailFromFile(<file-name>), ... )
Using IMPORT would be more complicated as you'd have to build a proper CSV
file or so, and that might be a pain as you have to take care of escaping
again.

Signature
Knut Stolze
DB2 Information Integration Development
IBM Germany
Stefan Momma - 23 Nov 2005 22:42 GMT
>> Hi,
>>
[quoted text clipped - 18 lines]
> file or so, and that might be a pain as you have to take care of escaping
> again.
This works fine for me for a very trivial table:
db2 create table mail(id int not null primary key, text varchar(3000))
db2 load from loadit of del lobs from `pwd` modified by coldel, insert
into mail
where 'loadit' is a CSV file in the current directory containing id and
filename, separated by comma:
1,mail01
2,mail02
3,mail03
.
.
.
Cheers,
-- stefan