|
GRASS GIS 7 Programmer's Manual
7.9.dev(2021)-e5379bbd7
|
DBMI Library (client) - select records from table. More...
#include <stdlib.h>#include <string.h>#include <grass/gis.h>#include <grass/dbmi.h>#include <grass/glocale.h>
Go to the source code of this file.
Functions | |
| int | db_select_int (dbDriver *driver, const char *tab, const char *col, const char *where, int **pval) |
| Select array of ordered integers from table/column. More... | |
| int | db_select_value (dbDriver *driver, const char *tab, const char *key, int id, const char *col, dbValue *val) |
| Select one (first) value from table/column for key/id. More... | |
| int | db_select_CatValArray (dbDriver *driver, const char *tab, const char *key, const char *col, const char *where, dbCatValArray *cvarr) |
| Select pairs key/value to array, values are sorted by key (must be integer) More... | |
| void | db_CatValArray_sort (dbCatValArray *arr) |
| Sort key/value array by key. More... | |
| int | db_CatValArray_sort_by_value (dbCatValArray *arr) |
| Sort key/value array by value. More... | |
| int | db_CatValArray_get_value (dbCatValArray *arr, int key, dbCatVal **cv) |
| Find value by key. More... | |
| int | db_CatValArray_get_value_int (dbCatValArray *arr, int key, int *val) |
| Find value (integer) by key. More... | |
| int | db_CatValArray_get_value_double (dbCatValArray *arr, int key, double *val) |
| Find value (double) by key. More... | |
DBMI Library (client) - select records from table.
(C) 1999-2008 by the GRASS Development Team
This program is free software under the GNU General Public License (>=v2). Read the file COPYING that comes with GRASS for details.
Definition in file db/dbmi_client/select.c.
| int db_CatValArray_get_value | ( | dbCatValArray * | arr, |
| int | key, | ||
| dbCatVal ** | cv | ||
| ) |
Find value by key.
| arr | dbCatValArray (key/value array) | |
| key | key value | |
| [out] | cv | dbCatVal structure (key/value) to store within |
Definition at line 466 of file db/dbmi_client/select.c.
| int db_CatValArray_get_value_double | ( | dbCatValArray * | arr, |
| int | key, | ||
| double * | val | ||
| ) |
Find value (double) by key.
| arr | dbCatValArray (key/value array) | |
| key | key value | |
| [out] | val | found value (double) |
Definition at line 518 of file db/dbmi_client/select.c.
| int db_CatValArray_get_value_int | ( | dbCatValArray * | arr, |
| int | key, | ||
| int * | val | ||
| ) |
Find value (integer) by key.
| arr | dbCatValArray (key/value array) | |
| key | key value | |
| [out] | val | found value (integer) |
Definition at line 492 of file db/dbmi_client/select.c.
| void db_CatValArray_sort | ( | dbCatValArray * | arr | ) |
Sort key/value array by key.
| [in,out] | arr | dbCatValArray (key/value array) |
Definition at line 417 of file db/dbmi_client/select.c.
References dbCatValArray::n_values, and dbCatValArray::value.
| int db_CatValArray_sort_by_value | ( | dbCatValArray * | arr | ) |
Sort key/value array by value.
| [in,out] | arr | dbCatValArray (key/value array) |
Definition at line 430 of file db/dbmi_client/select.c.
References dbCatValArray::ctype, DB_C_TYPE_INT, dbCatValArray::n_values, and dbCatValArray::value.
| int db_select_CatValArray | ( | dbDriver * | driver, |
| const char * | tab, | ||
| const char * | key, | ||
| const char * | col, | ||
| const char * | where, | ||
| dbCatValArray * | cvarr | ||
| ) |
Select pairs key/value to array, values are sorted by key (must be integer)
| driver | DB driver | |
| tab | table name | |
| key | key column name | |
| col | value column name | |
| [out] | cvarr | dbCatValArray to store within |
Definition at line 268 of file db/dbmi_client/select.c.
| int db_select_int | ( | dbDriver * | driver, |
| const char * | tab, | ||
| const char * | col, | ||
| const char * | where, | ||
| int ** | pval | ||
| ) |
Select array of ordered integers from table/column.
| driver | DB driver | |
| tab | table name | |
| col | column name | |
| where | where statement | |
| [out] | pval | array of ordered integer values |
Definition at line 103 of file db/dbmi_client/select.c.
Referenced by Vect_cats_set_constraint().
| int db_select_value | ( | dbDriver * | driver, |
| const char * | tab, | ||
| const char * | key, | ||
| int | id, | ||
| const char * | col, | ||
| dbValue * | val | ||
| ) |
Select one (first) value from table/column for key/id.
| driver | DB driver | |
| tab | table name | |
| key | key column name | |
| id | identifier in key column | |
| col | name of column to select the value from | |
| [out] | val | dbValue to store within |
Definition at line 204 of file db/dbmi_client/select.c.