473,396 Members | 1,942 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Problem with CONCAT function (bug?)

I'm needed to insert large BLOBs into a database. With the 1MB packet
limit, sending larger amounts of data would be difficult, so I had a neat
idea. I would do an initial insert of an empty record and get the
auto_insert ID from the response, and then loop through, appending data to
the record.

My table is simple. One unsigned int auto_increment field (DataID), and
one long blob field (BinaryData).

When I loop through the data to send, I run:

UPDATE BinaryTable SET BinaryData=CONCAT(BinaryData, 'My binary data
here') WHERE DataID = 35
The binary data I insert I escape null characters, backslashes, single and
double quotes. The data seems to insert fine.

The problem is that as I increase the amount of data in the field, CONCAT
seems to drop all but the last 416k of the data. Thus if I loop through
adding 400k blocks at a time (Which I do) I am left with at most 800k of
data in the blob field.

Using 4k blocks I end up with 419k of data in the field when all is said
and done.

Please let me know if/when this will be fixed, and if there is a
work around that might be used, r a better way to insert BLOB data is
known.

- Garrett Kajmowicz
gk******@tbaytel.net
Jul 20 '05 #1
2 1507
> Using 4k blocks I end up with 419k of data in the field when all is said
and done.


Inserting data which is only NULL characters in 4k blocks allows me to get
a maximum stored data length of 906.3 kb.

Inserting data which is all 'q's, (just the letter q) gets me a total
inserted size of 653.2 kb. This is if the file size is 4890340 bytse
long. If the file is 5000000 bytes long, the total data inserted is 789.1
KB.

It seems as although the total inserted size varies, but is always under 1
MB.

This is getting more and more confusing. Help is greatly appreciated.

- Garrett Kajmowicz
Jul 20 '05 #2
> Using 4k blocks I end up with 419k of data in the field when all is said
and done.


Inserting data which is only NULL characters in 4k blocks allows me to get
a maximum stored data length of 906.3 kb.

Inserting data which is all 'q's, (just the letter q) gets me a total
inserted size of 653.2 kb. This is if the file size is 4890340 bytse
long. If the file is 5000000 bytes long, the total data inserted is 789.1
KB.

It seems as although the total inserted size varies, but is always under 1
MB.

This is getting more and more confusing. Help is greatly appreciated.

- Garrett Kajmowicz
Jul 20 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Joe | last post by:
I've got 3 columns in a mysql database that I am trying to join. I'm using CONCAT(), but it's giving me NULL results. This has worked for me before ... What am I doing wrong? Here's a straight...
0
by: Garrett Kajmowicz | last post by:
I'm needed to insert large BLOBs into a database. With the 1MB packet limit, sending larger amounts of data would be difficult, so I had a neat idea. I would do an initial insert of an empty...
6
by: Chad | last post by:
I am receiving the following two errors in the code below. Both are on Line 56. error C2039: 'CreateDirectoryA' : is not a member of 'System::IO::Directory' error C2660: 'CreateDirectoryA' :...
3
by: John R. | last post by:
I have an application written in C# and i am using MS XML DOM! I have a document with the following structure (only the <DicEntry> - Elements are important): <NewDataSet...
7
by: hierro | last post by:
I have a list of functions (all with suffix T). For each one, I need to implement the following: FunctionT() { if (some_condition) { // do some conversion first FunctionW(); // then do some...
3
by: Bryan Valencia | last post by:
Ok, I tried to use the concat function. It's in the Help, but it claims it can't find the namespace that contains 'concat'. You'd think there'd be a note in the help system if I have to use some...
16
by: Jacky | last post by:
Hi, Concat wors as tmpStr = tmpStr.Concat(tmpStr, tmpStr2) Why it do not refer to owner object so tmpStr.Concat(tmpStr, tmpStr2) and now tmpStr has same value as upper?
4
by: Martin Evans | last post by:
Hi, I'm getting: DBD::DB2::db do failed: SQL0440N No authorized routine named "CONCAT" of type "FUNCTION" having compatible arguments was found. SQLSTATE=42884 for some SQL like this:
13
by: Henry Townsend | last post by:
I hope this is on-topic in c.l.c - it's about the C preprocessor more than the language per se, more generally about the K&R behavior, and most specifically about the Sun cpp which is why I've...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.