GRASS Programmer's Manual 6.4.1(2011)
|
00001 00015 #include <stdlib.h> 00016 #include <grass/dbmi.h> 00017 #include "macros.h" 00018 #include "dbstubs.h" 00019 00026 int db_d_execute_immediate(void) 00027 { 00028 int stat; 00029 dbString SQLstatement; 00030 00031 /* get the arg(s) */ 00032 db_init_string(&SQLstatement); 00033 DB_RECV_STRING(&SQLstatement); 00034 00035 /* call the procedure */ 00036 stat = db_driver_execute_immediate(&SQLstatement); 00037 db_free_string(&SQLstatement); 00038 00039 /* send the return code */ 00040 if (stat != DB_OK) { 00041 DB_SEND_FAILURE(); 00042 return DB_OK; 00043 } 00044 DB_SEND_SUCCESS(); 00045 00046 /* no results */ 00047 return DB_OK; 00048 } 00049 00056 int db_d_begin_transaction(void) 00057 { 00058 int stat; 00059 00060 /* call the procedure */ 00061 stat = db_driver_begin_transaction(); 00062 00063 /* send the return code */ 00064 if (stat != DB_OK) { 00065 DB_SEND_FAILURE(); 00066 return DB_OK; 00067 } 00068 DB_SEND_SUCCESS(); 00069 00070 /* no results */ 00071 return DB_OK; 00072 } 00073 00082 int db_d_commit_transaction() 00083 { 00084 int stat; 00085 00086 /* call the procedure */ 00087 stat = db_driver_commit_transaction(); 00088 00089 /* send the return code */ 00090 if (stat != DB_OK) { 00091 DB_SEND_FAILURE(); 00092 return DB_OK; 00093 } 00094 DB_SEND_SUCCESS(); 00095 00096 /* no results */ 00097 return DB_OK; 00098 }