Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 631131
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T19:55:53+00:00 2026-05-13T19:55:53+00:00

How do I get the size of data in a BLOB field in the

  • 0

How do I get the size of data in a BLOB field in the Result Set? (Using C++ and MySQL Connector C++)

In order to read the data from the result set, I have allocate memory for it first. In order to allocate memory, I need to know the size of the blob data in the result set.

Searching the web and StackOverflow, I have found two methods: OCTECT and BLOB stream.

One method to find the BLOB size is to use OCTECT() function, which requires a new query and produces a new result set. I would rather not use this method.

Another method is to use the blob stream and seek to the end, and get the file position. However, I don’t know if the stream can be rewound to the beginning in order to read the data. This method requires an additional read of the entire stream.

The ResultSet and ResultSetMetaData interfaces of MySQL Connector C++ 1.0.5 do not provide a method for obtaining the size of the data in a field (column).

Is there a process for obtaining the size of the data in a BLOB field given only the result set and a field name?

I am using MySQL Connector C++ 1.0.5, C++, Visual Studio 2008, Windows Vista / XP and “Server version: 5.1.41-community MySQL Community Server (GPL)”.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T19:55:53+00:00Added an answer on May 13, 2026 at 7:55 pm

    You could do a select like:

    select LENGTH(content),content where id=123;
    

    where content is the BLOB field.

    Regards.
    see: LENGTH(str)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

How can I get the size in bytes of the data returned from the
I need to get the size of a directory, recursively. I have to do
I need to get the size of files. These files range in size from
How to get file size of pdf,gif,doc etc using xcode. suppose to i get
How to get the size of a record in MySql if the table contains
How do I get the size of a pointer in C using sizeof ?
With following command, I can get the data size of a specific collection: db.collection.dataSize()
Here when I get file size using stat() it gives different output, why does
I have a table with large amounts of BLOB data in a column. I
I have some python code that: Takes a BLOB from a database which is

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.