GRASS Programmer's Manual
6.4.2(2012)
Main Page
Related Pages
Namespaces
Data Structures
Files
File List
Globals
All
Data Structures
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Macros
Pages
c_openselect.c
Go to the documentation of this file.
1
15
#include <grass/dbmi.h>
16
#include "
macros.h
"
17
29
int
db_open_select_cursor
(dbDriver *
driver
, dbString * select, dbCursor * cursor,
30
int
mode)
31
{
32
int
ret_code;
33
34
db_init_cursor
(cursor);
35
cursor->driver =
driver
;
36
37
/* start the procedure call */
38
db__set_protocol_fds
(driver->send, driver->recv);
39
DB_START_PROCEDURE_CALL
(DB_PROC_OPEN_SELECT_CURSOR);
40
41
/* send the argument(s) to the procedure */
42
DB_SEND_STRING
(select);
43
DB_SEND_INT
(mode);
44
45
/* get the return code for the procedure call */
46
DB_RECV_RETURN_CODE
(&ret_code);
47
48
if
(ret_code != DB_OK)
49
return
ret_code;
/* ret_code SHOULD == DB_FAILED */
50
51
/* get the results */
52
DB_RECV_TOKEN
(&cursor->token);
53
DB_RECV_INT
(&cursor->type);
54
DB_RECV_INT
(&cursor->mode);
55
DB_RECV_TABLE_DEFINITION
(&cursor->table);
56
return
DB_OK;
57
}
lib
db
dbmi_client
c_openselect.c
Generated on Sun Sep 9 2012 18:55:30 for GRASS Programmer's Manual by
1.8.1.2