GRASS 8 Programmer's Manual 8.6.0dev(2026)-1878fdfec5
Loading...
Searching...
No Matches
c_execute.c
Go to the documentation of this file.
1/*!
2 * \file db/dbmi_client/c_execute.c
3 *
4 * \brief DBMI Library (client) - execute SQL statements
5 *
6 * SPDX-FileCopyrightText: 1999-2008 GRASS Development Team
7 * SPDX-License-Identifier: GPL-2.0-or-later
8 *
9 * \author Joel Jones (CERL/UIUC), Radim Blazek
10 */
11
12#include <grass/dbmi.h>
13#include "macros.h"
14
15/*!
16 \brief Execute SQL statements
17
18 \param driver db driver
19 \param SQLstatement SQL statement (alter, update, ...)
20
21 \return DB_OK on success
22 \return DB_FAILED on failure
23 */
25{
26 int ret_code;
27
28 /* start the procedure call */
31
32 /* send the argument(s) to the procedure */
34
35 /* get the return code for the procedure call */
37
38 if (ret_code != DB_OK)
39 return ret_code; /* ret_code SHOULD == DB_FAILED */
40
41 /* no results */
42 return DB_OK;
43}
44
45/*!
46 \brief Begin transaction
47
48 \param driver db driver
49
50 \return DB_OK on success
51 \return DB_FAILED on failure
52 */
54{
55 int ret_code;
56
57 /* start the procedure call */
60
61 /* get the return code for the procedure call */
63
64 if (ret_code != DB_OK)
65 return ret_code;
66
67 /* no results */
68 return DB_OK;
69}
70
71/*!
72 \brief Commit transaction
73
74 \param driver db driver
75
76 \return DB_OK on success
77 \return DB_FAILED on failure
78 */
80{
81 int ret_code;
82
83 /* start the procedure call */
86
87 /* get the return code for the procedure call */
89
90 if (ret_code != DB_OK)
91 return ret_code;
92
93 /* no results */
94 return DB_OK;
95}
int db_begin_transaction(dbDriver *driver)
Begin transaction.
Definition c_execute.c:53
int db_execute_immediate(dbDriver *driver, dbString *SQLstatement)
Execute SQL statements.
Definition c_execute.c:24
int db_commit_transaction(dbDriver *driver)
Commit transaction.
Definition c_execute.c:79
Main header of GRASS DataBase Management Interface.
#define DB_PROC_COMMIT_TRANSACTION
Definition dbmi.h:49
#define DB_PROC_BEGIN_TRANSACTION
Definition dbmi.h:48
#define DB_PROC_EXECUTE_IMMEDIATE
Definition dbmi.h:47
#define DB_OK
Definition dbmi.h:69
void db__set_protocol_fds(FILE *, FILE *)
?
#define DB_SEND_STRING(x)
Definition macros.h:24
#define DB_START_PROCEDURE_CALL(x)
Definition macros.h:2
#define DB_RECV_RETURN_CODE(x)
Definition macros.h:7