MySQL Forums
Forum List  »  Connector/C (libmysql)

Retrieving LONGTEXT columns with C prepared statement API
Posted by: Alex Simpson
Date: August 16, 2013 07:44AM

When binding prepared statement results, a buffer needs to be supplied to hold the result.

If I want to retrieve a column of LONGTEXT that is usually a few kilobytes but may occasionally be a lot larger, do I have to pass the full maximum buffer size, or is there a better way? To handle all possible results, I'd have to be passing a buffer of 4GiB for each LONGTEXT column!

I realise that supplying a smaller buffer will give me a truncation error and the actual length. I think that I could then rebind the result buffers and execute the whole query again. Is there a more optimal way?

Options: ReplyQuote


Subject
Views
Written By
Posted
Retrieving LONGTEXT columns with C prepared statement API
2433
August 16, 2013 07:44AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.