I'm doing the selects on a ndbcluster database, the inserts will be on
a mysqld server. I am trying to create the insert statement, as I'm not
a C expert I'm having some difficulties, the mysql_fetch_row doesn't
return null-terminated strings and that makes the handling a little bit
harder for me.
Thanks for your help, It was very helpful.
On Fri, 2012-07-20 at 13:07 -0700, Dan Smythe wrote:
> I don't know of anything in the C API that allows you to SELECT a tuple
> using SQL statement,
> and use that result set to pass it into somewhere else.
> The fact of the matter is that the C API is designed to interact with
> mysqld server, which means
> your interaction with the server will undoubtedly be via SQL statements.
> But you sent this email to the cluster@ mailing list...
> So are you using the mysqld C API or the ndbcluster NDB API ? Or both?
> With NDB API the methods for inserting tuples are much different than the C
> API, because you
> are not directly interfacing with mysqld, you are directly interfacing with
> storage nodes of the
> This shows an example of how to insert a tuple with NDB API into ndbcluster.
> This is the main page for the NDB API documentation ( for working the
> ndbcluster data nodes )
> But if you are trying to INSERT data into mysqld ( engines Innodb, Myisam,
> etc. )
> Then you will want the MySQL C API documentation:
> Which unfortunately does not have some mysql_insert_row function, but
> instead has
> mysql_query and you must construct an INSERT statement.
> If you use NDB API you still will have to 'construct' a series of objects
> representing the tuple
> you would like to insert into a ndbcluster table....
> I hope this is helpful...
> On Fri, Jul 20, 2012 at 11:44 AM, Antonio Modesto
> > Hi,
> > I'm writing a C code (using the mysql api) to select specific rows
> > from
> > a database and insert them in another database in a different host. The
> > problem is that I didn't find any method to insert a row directly, What
> > I've noticed so far is that I have to construct a mysql statement
> > (Insert into bla bla bla..) based on the result of the query, and then
> > pass it to the mysql_query function to insert the row in the another
> > database. Is a easier way to do that? Something like
> > mysql_insert_row(&mysql_handler, row)?
> > Thanks and sorry for asking it in this list, but I searched a lot on the
> > web and didn't find anything that could help.
> > Regards.
> > --
> > MySQL Cluster Mailing List
> > For list archives: http://lists.mysql.com/cluster
> > To unsubscribe: http://lists.mysql.com/cluster