GRASS Programmer's Manual  6.4.2(2012)
c_insert.c
Go to the documentation of this file.
00001 
00015 #include <grass/dbmi.h>
00016 #include "macros.h"
00017 
00026 int db_insert(dbCursor * cursor)
00027 {
00028     int ret_code;
00029 
00030     /* start the procedure call */
00031     db__set_protocol_fds(cursor->driver->send, cursor->driver->recv);
00032     DB_START_PROCEDURE_CALL(DB_PROC_INSERT);
00033 
00034     /* send the argument(s) to the procedure */
00035     DB_SEND_TOKEN(&cursor->token);
00036     DB_SEND_TABLE_DATA(cursor->table);
00037 
00038     /* get the return code for the procedure call */
00039     DB_RECV_RETURN_CODE(&ret_code);
00040 
00041     if (ret_code != DB_OK)
00042         return ret_code;        /* ret_code SHOULD == DB_FAILED */
00043 
00044     /* no results */
00045     return DB_OK;
00046 }
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines