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 > Copy BLOB field value to another fieldē

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 11-10-03, 18:22
peuj peuj is offline
Registered User
 
Join Date: Aug 2003
Posts: 7
Exclamation Copy BLOB field value to another fieldē

Hello,

I have to identical accounts, in the same server, with the same tables.

I want to copy one BLOB value from a specific table account into the same table on the other account.

Frist i tried something like that:
RsDestination.Field1.Value=RsSource.Field1.Value
RsDestination.UpdateBtach

but i have an error message "22005 Error in assignment. "

So i tried something like that:
BlobSize=RsSource.Field1.Value.Size
BlobValue=RsSource.Field1.Value.GetChunk(BlobSize)
RsDestination.Field1.Value.AppendChunk BlobValue
RsDestination.UpdateBatch
but i have the same error message

The only way i found is to copy the value in block of 8000.
if the RsSource.Field1.Value.Size=32000 i will have
BlobValue=RsSource.Field10.Value.GetChunk(8000)
RsDestination.Field1.Value.AppendChunk BlobValue
RsDestination.UpdateBatch
BlobValue=RsSource.Field11.Value.GetChunk(8000)
RsDestination.Field1.Value.AppendChunk BlobValue
RsDestination.UpdateBatch
.....

It works but for other reasons i need to have the value in one block.

Why it only works with block of 8000?
How can I copy the whole value in one block?

hope all is clear

Thanx a lot
Reply With Quote
  #2 (permalink)  
Old 11-11-03, 13:39
peuj peuj is offline
Registered User
 
Join Date: Aug 2003
Posts: 7
does somebody know ?

well for it's for my work and i'm really waiting for a solution

thanx in advance
Reply With Quote
  #3 (permalink)  
Old 11-11-03, 13:56
sathyaram_s sathyaram_s is offline
Super Moderator
 
Join Date: Aug 2001
Location: UK
Posts: 4,534
A thought

update table1 set blobcol1=blobcol2

Sorry, if I have misunderstood your question

Sathyaram
__________________
Visit the new-look IDUG Website , register to gain access to the excellent content.
Reply With Quote
  #4 (permalink)  
Old 11-11-03, 14:54
peuj peuj is offline
Registered User
 
Join Date: Aug 2003
Posts: 7
thanx for the answer...

maybe I don't explain well

I made a tool that copy the contains of an account (source) in another acount (destination) via odbc.

on the destination account: I drop all the tables , create the same tables, same columns as the source account, and I copy the contains of each source tables into destination tables.

all is working except for the blob (see my first message please)

for all the value i do something like that
RsDestination.Field1.Value=RsSource.Field1.Value
RsDestination.UpdateBtach

for the blob if i do that i have the error message.

It's more clear ? If not i will write a sample of what I do, tomorrow because I'm not at my office right now.

thanx
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