List:General Discussion« Previous MessageNext Message »
From:Carlos Savoretti Date:July 29 2008 9:02pm
Subject:Prepared statement cursors problem.
View as plain text  
Hi all:

I need to set a cursor for doing a SELECT (using the C API)
According the documentation I did in order to setup the cursor.

const unsigned long cursor_type = CURSOR_TYPE_READ_ONLY;
if (mysql_stmt_attr_set (mysql_stmt, STMT_ATTR_CURSOR_TYPE,
	(void *) &cursor_type)) {
	g_print ("failed\n");
	return NULL;

All it's ok so far. Thereafter, I call mysql_stmt_store_result() after
binding data buffers with mysql_stmt_bind_result() (according docs),

if (mysql_stmt_store_result (cdata->mysql_stmt)) {
	g_warning ("mysql_stmt_store_result failed: %s\n",
		mysql_stmt_error (cdata->mysql_stmt));
fails giving:   The statement (1) has no open cursor.

??? Why could be this ? , provided the cursor was set up 
before successfully 

What I missed up ?

Thanks in advance.

Carlos Savoretti.

Prepared statement cursors problem.Carlos Savoretti29 Jul