Reading blob types
Posted by: m m
Date: July 21, 2011 06:58AM

Hi all

I need to store a big amount (more than 8kb) of data in one of the columns of a table. As I have seen it is not possible to use varchar for doing so and I need a type "TEXT" instead. But then, how can I read this value by using the Ndb API?

The values are inserted into the table, but when reading them, I don't get anything from the database:

NdbBlob *myBlobHandle= myOperation->getBlobHandle("namecolumn");

char buffer[100];
myBlobHandle->readData(buffer, 100);
if(myTransaction->execute( NdbTransaction::Commit ) == -1){
printf("Error %d );
myNdb->closeTransaction(myTransaction);
return 0;
}

printf("My buffer: %s", buffer);

And also, is there any way of doing it without having to specify the length of the column? Because it has a variable length and it isn't known in advance.

Thanks in advance

Best regards,
Marta

Options: ReplyQuote


Subject
Views
Written By
Posted
Reading blob types
1475
m m
July 21, 2011 06:58AM


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.