d_bindupdate.c

Go to the documentation of this file.
00001 #include <grass/dbmi.h>
00002 #include "macros.h"
00003 #include "dbstubs.h"
00004 
00011 int
00012 db_d_bind_update()
00013 {
00014     dbToken token;
00015     dbCursor *cursor;
00016     int stat;
00017     int ncols;
00018 
00019 /* get the arg(s) */
00020     DB_RECV_TOKEN(&token);
00021     cursor = (dbCursor *) db_find_token(token);
00022     if (cursor == NULL || !db_test_cursor_type_update(cursor))
00023     {
00024         db_error ("** not an update cursor **");
00025         DB_SEND_FAILURE();
00026         return DB_FAILED;
00027     }
00028     DB_RECV_SHORT_ARRAY (&cursor->column_flags, &ncols);
00029     if(!db_test_cursor_any_column_flag (cursor))
00030     {
00031         db_error ("** no columns set in cursor for binding **");
00032         DB_SEND_FAILURE();
00033         return DB_FAILED;
00034     }
00035 
00036 /* call the procedure */
00037     stat = db_driver_bind_update (cursor);
00038 
00039 /* send the return code */
00040     if (stat != DB_OK)
00041     {
00042         DB_SEND_FAILURE();
00043         return DB_OK;
00044     }
00045     DB_SEND_SUCCESS();
00046 
00047 /* no results */
00048     return DB_OK;
00049 }

Generated on Sun Apr 6 17:31:38 2008 for GRASS by  doxygen 1.5.5