[prev in list] [next in list] [prev in thread] [next in thread] 

List:       mysql
Subject:    Prepared statement cursors problem.
From:       Carlos Savoretti <csavoretti () clubsanjorge ! com ! ar>
Date:       2008-07-29 21:02:22
Message-ID: 1217365342.8969.40.camel () einstein ! csj ! ba ! com
[Download RAW message or body]

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),
but:

---
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.



-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/mysql?unsub=mysql-marcsub@progressive-comp.com

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic