GRASS Programmer's Manual 6.4.1(2011)
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.
int db_column_Ctype (dbDriver *driver, const char *tab, const char *col)
 Get column ctype.
int db_get_column (dbDriver *Driver, const char *tname, const char *cname, dbColumn **Column)
 Get column structure by table and column name.

Detailed Description

DBMI Library (client) - column info.

(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.

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

Definition in file dbmi_client/column.c.


Function Documentation

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

Get column ctype.

See db_sqltype_to_Ctype().

Parameters:
driverDB driver
tabtable name
colcolumn name
Returns:
column Ctype
-1 on error

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

References db_column_sqltype(), and db_sqltype_to_Ctype().

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

Get column sqltype.

See db_sqltype_name().

Parameters:
driverDB driver
tabtable name
colcolumn name
Returns:
column sqltype
-1 on error

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

References db_describe_table(), db_free_string(), db_get_column_name(), db_get_column_sqltype(), db_get_table_column(), db_get_table_number_of_columns(), db_init_string(), and db_set_string().

Referenced by db_column_Ctype().

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 98 of file dbmi_client/column.c.

References db_copy_value(), db_describe_table(), db_get_column_description(), db_get_column_name(), db_get_table_column(), db_get_table_number_of_columns(), db_init_column(), db_init_string(), and db_set_string().

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines