MySQL Forums
Forum List  »  NDB clusters

NDB API Datatypes
Posted by: Mike Cress
Date: October 09, 2013 01:10PM

I am using the new-style API (e.g.NdbRecords, not the old/simple api) and I am having difficulty determining what my structures should be for various NDB datatypes. Through lots of Googling and trial-and-error, I have discovered that I can query a VARCHAR field by creating a struct with a char array member whose size is strlen()+1 (for length prefix). For example:

create table test (acct varchar(50) not null primary key );

struct Rowdata
{
char acct[51];
}

Column...
RecordSpec...
NdbRecord...
..etc..

My current frustration is with DATETIME. I have read this post (http://forums.mysql.com/read.php?25,290323) but when attempting to add a member to the struct of type uint64_t, my call to createRecord returns NULL. This was what happened when I did not have the VARCHAR members set up correctly. I have also attempted to use char[8] unsuccessfully.

First question: how can I represent datetime data in a struct that won't fail when I call createRecord(..)?

Second question: for each new type I need to use, what can I do to discover this information for myself?


Thank you,

Mike

Options: ReplyQuote


Subject
Views
Written By
Posted
NDB API Datatypes
1928
October 09, 2013 01:10PM
964
October 09, 2013 01:36PM
987
October 09, 2013 01:43PM


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.