Welcome to the { mindfrost82.com } forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact contact us.

Go Back   { mindfrost82.com } > Gadget Corner > Tech Newsgroups > Programming > Databases > General SQL Server Support

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 08-05-2008, 11:33 PM
Mary Lei
 
Posts: n/a
load_file and blobs

I cannot update the blobs correctly with mysql.

I exported 3 rows from db2 to mysql database.
There are blobs in the database.
db2 display the 3 rows as
db2 'select cast(type_blob as varchar(200)) from ilwdtypes'

1




-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
x'969696969696969696969696969696969696969696969696 96969696969696969696969696969696969696969696969696 96969696969696969696969696969696969696969696969696 969696969696'


x'979797979797979797979797979797979797979797979797 97979797979797979797979797979797979797979797979797 97979797979797979797979797979797979797979797979797 9797979797979797979797'


x'989898989898989898989898989898989898989898989898 98989898989898989898989898989898989898989898989898 98989898989898989898989898989898989898989898989898 98989898989898989898989898989898'


When I want to add the blob objects back to mysql after the data was
imported,
mysql> update ilwdtypes set type_blob=load_file('./lwdtypes.del.001.lob');

I ended up having the entire blob in each row of the column
mysql> select hex(type_blob) from ilwdtypes where type_char_s =
"1216412567";
|
96969696969696969696969696969696969696969696969696 96969696969696969696969696969696969696969696969696 96969696969696969696969696969696969696969696969696 9696969696747970655F636C6F629797979797979797979797 97979797979797979797979797979797979797979797979797 97979797979797979797979797979797979797979797979797 97979797979797979797979797979797979797979797979774 7970655F636C6F629898989898989898989898989898989898 98989898989898989898989898989898989898989898989898 98989898989898989898989898989898989898989898989898 98989898989898989898989898989898989898989898987479 70655F636C6F62
|

How can I get mysql to update each blob properly to match the ones in db2 ?

db2 version 9.1.5 on 32 bit Linux
mysql on 32 bit linux Server version: 5.0.45 Source distribution

Thanks.

Mary
Reply With Quote
  #2 (permalink)  
Old 08-06-2008, 12:54 AM
Mary Lei
 
Posts: n/a
Re: load_file and blobs

I found one solution :
I have to split up the lob file from db2 using the offset and size of
each lob into individual files and update each of the rows with the
split load file.
Tedious but works.

Mary Lei wrote:
> I cannot update the blobs correctly with mysql.
>
> I exported 3 rows from db2 to mysql database.
> There are blobs in the database.
> db2 display the 3 rows as
> db2 'select cast(type_blob as varchar(200)) from ilwdtypes'
>
> 1
>
>
>
> -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
>
> x'969696969696969696969696969696969696969696969696 96969696969696969696969696969696969696969696969696 96969696969696969696969696969696969696969696969696 969696969696'
>
>
> x'979797979797979797979797979797979797979797979797 97979797979797979797979797979797979797979797979797 97979797979797979797979797979797979797979797979797 9797979797979797979797'
>
>
> x'989898989898989898989898989898989898989898989898 98989898989898989898989898989898989898989898989898 98989898989898989898989898989898989898989898989898 98989898989898989898989898989898'
>
>
> When I want to add the blob objects back to mysql after the data was
> imported,
> mysql> update ilwdtypes set type_blob=load_file('./lwdtypes.del.001.lob');
>
> I ended up having the entire blob in each row of the column
> mysql> select hex(type_blob) from ilwdtypes where type_char_s =
> "1216412567";
> |
> 96969696969696969696969696969696969696969696969696 96969696969696969696969696969696969696969696969696 96969696969696969696969696969696969696969696969696 9696969696747970655F636C6F629797979797979797979797 97979797979797979797979797979797979797979797979797 97979797979797979797979797979797979797979797979797 97979797979797979797979797979797979797979797979774 7970655F636C6F629898989898989898989898989898989898 98989898989898989898989898989898989898989898989898 98989898989898989898989898989898989898989898989898 98989898989898989898989898989898989898989898987479 70655F636C6F62
> |
>
> How can I get mysql to update each blob properly to match the ones in db2 ?
>
> db2 version 9.1.5 on 32 bit Linux
> mysql on 32 bit linux Server version: 5.0.45 Source distribution
>
> Thanks.
>
> Mary

Reply With Quote
  #3 (permalink)  
Old 08-06-2008, 10:10 PM
Erland Sommarskog
 
Posts: n/a
Re: load_file and blobs

Mary Lei (mlei@ligo.caltech.edu) writes:
> I found one solution :
> I have to split up the lob file from db2 using the offset and size of
> each lob into individual files and update each of the rows with the
> split load file.
> Tedious but works.


If you post to comp.databases.mysql, you might learn a better solution.
Since this newsgroup is a about different product, your prospects are
somewhat bleak here.o


--
Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pro...ads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinf...ons/books.mspx
Reply With Quote
Reply

  { mindfrost82.com } > Gadget Corner > Tech Newsgroups > Programming > Databases > General SQL Server Support


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

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



All times are GMT. The time now is 11:38 AM.


Powered by vBulletin, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.1.0 ©2007, Crawlability, Inc.
© 1999-2008 mindfrost82.com v11.0


Sponsors:
Advertising | Problem Mortgage | Loans | Montana Music | Online Loans



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114