| GSQL Developers Reference Manual | ||||
|---|---|---|---|---|
GSQLCursorPrivate;
enum GSQLCursorState;
enum GSQLCursorBindType;
enum GSQLCursorStmtType;
#define GSQL_CURSOR_TYPE
GSQLCursor;
GSQLCursor* gsql_cursor_new (GSQLSession *session,
gchar *sql);
GSQLCursorState gsql_cursor_get_state (GSQLCursor *cursor);
GSQLCursorState gsql_cursor_open_with_bind (GSQLCursor *cursor,
gboolean background,
GSQLCursorBindType btype,
...);
GSQLCursorState gsql_cursor_open (GSQLCursor *cursor,
gboolean background);
void gsql_cursor_stop (GSQLCursor *cursor);
gint gsql_cursor_fetch (GSQLCursor *cursor,
gint rows);
void gsql_cursor_close (GSQLCursor *cursor);
void gsql_cursor_notify_set (GSQLCursor *cursor,
gboolean notify);
typedef enum {
GSQL_CURSOR_STATE_ERROR,
GSQL_CURSOR_STATE_NONE,
GSQL_CURSOR_STATE_RUN,
GSQL_CURSOR_STATE_OPEN,
GSQL_CURSOR_STATE_STOP,
GSQL_CURSOR_STATE_FETCH,
GSQL_CURSOR_STATE_FETCHED
} GSQLCursorState;
typedef enum {
GSQL_CURSOR_BIND_BY_NAME,
GSQL_CURSOR_BIND_BY_POS
} GSQLCursorBindType;
typedef enum {
GSQL_CURSOR_STMT_SELECT,
GSQL_CURSOR_STMT_EXEC,
GSQL_CURSOR_STMT_INSERT,
GSQL_CURSOR_STMT_UPDATE,
GSQL_CURSOR_STMT_DELETE,
GSQL_CURSOR_STMT_DML, /* Common stmt type for Ins, Upd, Del */
GSQL_CURSOR_STMT_CREATE,
GSQL_CURSOR_STMT_DROP,
GSQL_CURSOR_STMT_ALTER,
GSQL_CURSOR_STMT_DDL /* commont stmt type for create, drop, alter */
} GSQLCursorStmtType;
GSQLCursor* gsql_cursor_new (GSQLSession *session, gchar *sql);
Creates a new GSQLCursor object
|
A GSQLSession |
|
SQL command |
Returns : |
the new GSQLCursor |
GSQLCursorState gsql_cursor_get_state (GSQLCursor *cursor);
|
|
Returns : |
GSQLCursorState gsql_cursor_open_with_bind (GSQLCursor *cursor, gboolean background, GSQLCursorBindType btype, ...);
Run the cursor statement with binds. Pay attention to the args in example usage:
gsql_cursor_open_with_bind (cursor, FALSE, GSQL_CURSOR_BIND_BY_POS, G_TYPE_STRING, owner, G_TYPE_INT, 23, -1)
gsql_cursor_open_with_bind (cursor, FALSE, GSQL_CURSOR_BIND_BY_NAME, G_TYPE_STRING, "owner" G_TYPE_STRING, owner, G_TYPE_STRING, "type", G_TYPE_INT, 23, -1)
|
A GSQLCursor |
|
bring to background |
|
A GSQLCursorBindType (by position or by name) |
|
pairs of type (GType) and value, terminated with -1 |
Returns : |
the GSQLCursorState |
GSQLCursorState gsql_cursor_open (GSQLCursor *cursor, gboolean background);
Run the cursor statement.
|
A GSQLCursor |
|
bring to background |
Returns : |
the GSQLCursorState |
void gsql_cursor_stop (GSQLCursor *cursor);
Stop the statement execution.
|
A GSQLCursor |
gint gsql_cursor_fetch (GSQLCursor *cursor, gint rows);
Fetch the result.
|
A GSQLCursor |
|
***just reserved |
Returns : |
the number fetched rows. |
void gsql_cursor_close (GSQLCursor *cursor);
Close the cursor.
|
A GSQLCursor |
void gsql_cursor_notify_set (GSQLCursor *cursor, gboolean notify);
Set the notify property.
|
A GSQLCursor |
|
set TRUE if you would like get notify |
"close" signalvoid user_function (GSQLCursor *gsqlcursor, gpointer user_data) : Run First
|
the object which received the signal. |
|
user data set when the signal handler was connected. |
"state-changed" signalvoid user_function (GSQLCursor *gsqlcursor, gpointer user_data) : Run First
|
the object which received the signal. |
|
user data set when the signal handler was connected. |