00001 #include <stdlib.h> 00002 #include <grass/dbmi.h> 00003 #include "macros.h" 00004 #include "dbstubs.h" 00005 00012 int 00013 db_d_execute_immediate() 00014 { 00015 int stat; 00016 dbString SQLstatement; 00017 00018 /* get the arg(s) */ 00019 db_init_string (&SQLstatement); 00020 DB_RECV_STRING(&SQLstatement); 00021 00022 /* call the procedure */ 00023 stat = db_driver_execute_immediate (&SQLstatement); 00024 db_free_string (&SQLstatement); 00025 00026 /* send the return code */ 00027 if (stat != DB_OK) 00028 { 00029 DB_SEND_FAILURE(); 00030 return DB_OK; 00031 } 00032 DB_SEND_SUCCESS(); 00033 00034 /* no results */ 00035 return DB_OK; 00036 } 00037 00044 int 00045 db_d_begin_transaction() 00046 { 00047 int stat; 00048 00049 /* call the procedure */ 00050 stat = db_driver_begin_transaction (); 00051 00052 /* send the return code */ 00053 if (stat != DB_OK) 00054 { 00055 DB_SEND_FAILURE(); 00056 return DB_OK; 00057 } 00058 DB_SEND_SUCCESS(); 00059 00060 /* no results */ 00061 return DB_OK; 00062 } 00063 00070 int 00071 db_d_commit_transaction() 00072 { 00073 int stat; 00074 00075 /* call the procedure */ 00076 stat = db_driver_commit_transaction (); 00077 00078 /* send the return code */ 00079 if (stat != DB_OK) 00080 { 00081 DB_SEND_FAILURE(); 00082 return DB_OK; 00083 } 00084 DB_SEND_SUCCESS(); 00085 00086 /* no results */ 00087 return DB_OK; 00088 } 00089