Inserting a blob in 'C'
Posted by: Phil Davis
Date: October 25, 2005 11:10AM

Hi,

I am having trouble conceptually understanding the process of inserting a blob from C.

Suppose I have:

CREATE TABLE images (
ItemId varchar(4) NOT NULL,
Image blob,
PRIMARY KEY (ItemId)
) TYPE = innoDB;


unsigned char ImageBuf[64*1024];

QStr.Format("INSERT INTO images VALUES ('%s', '%s')", "1234', ImageBuf);
mysql_query(conn, LPCSTR(QStr));

This of course is not right, but how is it done. Can I simply tell it to read the blob data from a file?

Could someone please post a snippet of code on how inserting a blob is accomplished, either from a file or from memory.

Thanks
Phil

Options: ReplyQuote


Subject
Views
Written By
Posted
Inserting a blob in 'C'
665
October 25, 2005 11:10AM
429
November 08, 2005 10:26AM


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.