GRASS 8 Programmer's Manual 8.6.0dev(2026)-1d1e47ad9d
Loading...
Searching...
No Matches
c_openupdate.c
Go to the documentation of this file.
1/*!
2 * \file db/dbmi_client/c_openupdate.c
3 *
4 * \brief DBMI Library (client) - open update cursor
5 *
6 * (C) 1999-2008 by the GRASS Development Team
7 *
8 * This program is free software under the GNU General Public
9 * License (>=v2). Read the file COPYING that comes with GRASS
10 * for details.
11 *
12 * \author Joel Jones (CERL/UIUC), Radim Blazek
13 */
14
15#include <grass/dbmi.h>
16#include "macros.h"
17
18/*!
19 \brief Open update cursor
20
21 \param driver db driver
22 \param table_name table name
23 \param select SQL update statement (?)
24 \param cursor db cursor to be opened
25 \param mode open mode (?)
26
27 \return DB_OK on success
28 \return DB_FAILED on failure
29 */
31 dbString *select, dbCursor *cursor, int mode)
32{
33 int ret_code;
34
36 cursor->driver = driver;
37
38 /* start the procedure call */
41
42 /* send the argument(s) to the procedure */
43 DB_SEND_STRING(table_name);
44 DB_SEND_STRING(select);
45 DB_SEND_INT(mode);
46
47 /* get the return code for the procedure call */
49
50 if (ret_code != DB_OK)
51 return ret_code; /* ret_code SHOULD == DB_FAILED */
52
53 /* get the results */
54 DB_RECV_TOKEN(&cursor->token);
55 DB_RECV_INT(&cursor->type);
56 DB_RECV_INT(&cursor->mode);
59 return DB_OK;
60}
int db_open_update_cursor(dbDriver *driver, dbString *table_name, dbString *select, dbCursor *cursor, int mode)
Open update cursor.
Main header of GRASS DataBase Management Interface.
#define DB_OK
Definition dbmi.h:71
#define DB_PROC_OPEN_UPDATE_CURSOR
Definition dbmi.h:43
int db_alloc_cursor_column_flags(dbCursor *)
Allocate columns' flags for cursor.
Definition cursor.c:275
void db_init_cursor(dbCursor *)
Initialize dbCursor.
Definition cursor.c:23
void db__set_protocol_fds(FILE *, FILE *)
?
#define DB_SEND_STRING(x)
Definition macros.h:24
#define DB_SEND_INT(x)
Definition macros.h:82
#define DB_RECV_TABLE_DEFINITION(x)
Definition macros.h:142
#define DB_RECV_INT(x)
Definition macros.h:87
#define DB_RECV_TOKEN(x)
Definition macros.h:219
#define DB_START_PROCEDURE_CALL(x)
Definition macros.h:2
#define DB_RECV_RETURN_CODE(x)
Definition macros.h:7