GRASS Programmer's Manual
6.4.2(2012)
|
00001 00015 #include <grass/dbmi.h> 00016 #include "macros.h" 00017 #include "dbstubs.h" 00018 00025 int db_d_bind_update() 00026 { 00027 dbToken token; 00028 dbCursor *cursor; 00029 int stat; 00030 int ncols; 00031 00032 /* get the arg(s) */ 00033 DB_RECV_TOKEN(&token); 00034 cursor = (dbCursor *) db_find_token(token); 00035 if (cursor == NULL || !db_test_cursor_type_update(cursor)) { 00036 db_error("** not an update cursor **"); 00037 DB_SEND_FAILURE(); 00038 return DB_FAILED; 00039 } 00040 DB_RECV_SHORT_ARRAY(&cursor->column_flags, &ncols); 00041 if (!db_test_cursor_any_column_flag(cursor)) { 00042 db_error("** no columns set in cursor for binding **"); 00043 DB_SEND_FAILURE(); 00044 return DB_FAILED; 00045 } 00046 00047 /* call the procedure */ 00048 stat = db_driver_bind_update(cursor); 00049 00050 /* send the return code */ 00051 if (stat != DB_OK) { 00052 DB_SEND_FAILURE(); 00053 return DB_OK; 00054 } 00055 DB_SEND_SUCCESS(); 00056 00057 /* no results */ 00058 return DB_OK; 00059 }