GRASS GIS 8 Programmer's Manual  8.5.0dev(2024)-602118adcc
dbmi_client/column.c File Reference

DBMI Library (client) - column info. More...

#include <stdlib.h>
#include <string.h>
#include <grass/gis.h>
#include <grass/dbmi.h>
#include <grass/glocale.h>
Include dependency graph for dbmi_client/column.c:

Go to the source code of this file.

Functions

int db_column_sqltype (dbDriver *driver, const char *tab, const char *col)
 Get column sqltype. More...
 
int db_column_Ctype (dbDriver *driver, const char *tab, const char *col)
 Get column ctype. More...
 
int db_get_column (dbDriver *Driver, const char *tname, const char *cname, dbColumn **Column)
 Get column structure by table and column name. More...
 

Detailed Description

DBMI Library (client) - column info.

(C) 1999-2008, 2011 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.

Author
Joel Jones (CERL/UIUC), Radim Blazek
Update by Glynn Clement <glynn gclements.plus.com>
Martin Landa <landa.martin gmail.com>

Definition in file dbmi_client/column.c.

Function Documentation

◆ db_column_Ctype()

int db_column_Ctype ( dbDriver driver,
const char *  tab,
const char *  col 
)

Get column ctype.

See db_sqltype_to_Ctype().

Supported types:

  • DB_C_TYPE_STRING
  • DB_C_TYPE_INT
  • DB_C_TYPE_DOUBLE
  • DB_C_TYPE_DATETIME
Parameters
driverDB driver
tabtable name
colcolumn name
Returns
column Ctype
-1 on error

Definition at line 99 of file dbmi_client/column.c.

◆ db_column_sqltype()

int db_column_sqltype ( dbDriver driver,
const char *  tab,
const char *  col 
)

Get column sqltype.

See db_sqltype_name().

Supported types:

  • DB_SQL_TYPE_UNKNOWN
  • DB_SQL_TYPE_CHARACTER
  • DB_SQL_TYPE_SMALLINT
  • DB_SQL_TYPE_INTEGER
  • DB_SQL_TYPE_REAL
  • DB_SQL_TYPE_DOUBLE_PRECISION
  • DB_SQL_TYPE_DECIMAL
  • DB_SQL_TYPE_NUMERIC
  • DB_SQL_TYPE_DATE
  • DB_SQL_TYPE_TIME
  • DB_SQL_TYPE_TIMESTAMP
  • DB_SQL_TYPE_INTERVAL
  • DB_SQL_TYPE_TEXT
  • DB_SQL_TYPE_SERIAL
Parameters
driverDB driver
tabtable name
colcolumn name
Returns
column sqltype
-1 on error

Definition at line 51 of file dbmi_client/column.c.

◆ db_get_column()

int db_get_column ( dbDriver Driver,
const char *  tname,
const char *  cname,
dbColumn **  Column 
)

Get column structure by table and column name.

Column is set to new dbColumn structure or NULL if column was not found

Parameters
DriverDB driver
tnametable name
cnamecolumn name
[out]Columncolumn structure to store within
Returns
DB_OK on success
DB_FAILED on failure

Definition at line 124 of file dbmi_client/column.c.