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.

 
Go Back  dBforums > Database Server Software > DB2 > inseting lobs from cli

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 06-22-04, 15:59
winterb winterb is offline
Registered User
 
Join Date: Jun 2004
Posts: 16
Question inseting lobs from cli

We have db2 7.2 for OS/390 with the connect clinet. All the latest fixpacks installed etc.

Someone asked if a lob could be inserted into a table from the command line. (Using the connect client on a linux or windows machine)

I never tried to insert lobs that way. Can it be done?

Any input would be helpful
Thanks
Bob.
Reply With Quote
  #2 (permalink)  
Old 06-23-04, 08:30
J Petruk J Petruk is offline
Registered User
 
Join Date: Mar 2004
Location: Toronto, ON, Canada
Posts: 513
Quote:
Originally Posted by winterb
We have db2 7.2 for OS/390 with the connect clinet. All the latest fixpacks installed etc.

Someone asked if a lob could be inserted into a table from the command line. (Using the connect client on a linux or windows machine)

I never tried to insert lobs that way. Can it be done?

Any input would be helpful
Thanks
Bob.
CLP, not CLI.

Yes, you can. Here's a clob:

db2 "create table blah4 (a clob(100))"
DB20000I The SQL command completed successfully.

db2 "insert into blah4 values ('asdf')"
DB20000I The SQL command completed successfully.
__________________
--
Jonathan Petruk
DB2 Database Consultant
Reply With Quote
  #3 (permalink)  
Old 06-23-04, 09:14
winterb winterb is offline
Registered User
 
Join Date: Jun 2004
Posts: 16
I ment CLP sorry

I ment CLP not CLI sorry,

Thanks for the info. I knew some text could be inserted into a clob what we are looking for is a way ot insert a file (like a pdf file) into a blob.

Sorry I should hav e been more specific in my first thread.
Reply With Quote
  #4 (permalink)  
Old 06-23-04, 10:38
J Petruk J Petruk is offline
Registered User
 
Join Date: Mar 2004
Location: Toronto, ON, Canada
Posts: 513
Quote:
Originally Posted by winterb
I ment CLP not CLI sorry,

Thanks for the info. I knew some text could be inserted into a clob what we are looking for is a way ot insert a file (like a pdf file) into a blob.

Sorry I should hav e been more specific in my first thread.
Sort of, you can use HEX:
db2 "insert into blah6 values (BLOB(X'000000'))"

What it sounds like you want is something sort of like the XMLClobFromFile() function... but unfortunately I don't think such a beast exists, you'd have to write it yourself, and it needs the file to be on the server.

Sounds like you'll probably need to write an app to do what you want.
__________________
--
Jonathan Petruk
DB2 Database Consultant
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On