If this is your first visit, be sure to check out the FAQ by clicking the link above.
You may have to register before you can post: click the register link above to proceed.
To start viewing messages, select the forum that you want to visit from the selection below.
The real question is how you get the data into your application. If you want to use the DB2 CLP for the INSERT, you can't specify a file name because that would just be a string. DB2 has to know that the string is a file and the file content has to be read. So you'll need some sort of function:
Code:
INSERT INTO ... VALUES ( ..., readfile('filename'), ...);
__________________
Knut Stolze
IBM DB2 Analytics Accelerator
IBM Germany Research & Development
If you just have a small number of rows to update manuualy, then there are some freeware Windows apps that do this (loads contents windows file into a DB2 lob column). I used a program like this about 3 years ago that I found on the Internet. I don't remember the name of the program, but maybe you can find one like it.
__________________
M. A. Feldman
IBM Certified DBA on DB2 for Linux, UNIX, and Windows
IBM Certified DBA on DB2 for z/OS and OS/390
db2 "insert into ARTISTS values (1,'Esto es una Prueba de Insert','P',readfile('/Pantallazo.png'), readfile('/Pantallazo.png') ";
DB21034E The command was processed as an SQL statement because it was not a
valid Command Line Processor command. During SQL processing it returned:
SQL0440N No authorized routine named "READFILE" of type "FUNCTION" having
compatible arguments was found. SQLSTATE=42884
Somebody can explain me how to execute the command correct without errors.
Knut expects you to create a UDF (using C) called readfile that reads a file. He wrote an article about how to create one a long time ago (maybe on IBM website Develperworks). It does not come with DB2.
__________________
M. A. Feldman
IBM Certified DBA on DB2 for Linux, UNIX, and Windows
IBM Certified DBA on DB2 for z/OS and OS/390