GRASS GIS 8 Programmer's Manual  8.2.2dev(2023)-3d2c704037
copy_tab.c File Reference

DBMI Library (client) - copy table. More...

#include <stdlib.h>
#include <string.h>
#include <grass/dbmi.h>
#include <grass/glocale.h>
#include "macros.h"
Include dependency graph for copy_tab.c:

Go to the source code of this file.

Functions

int db_copy_table (const char *from_drvname, const char *from_dbname, const char *from_tblname, const char *to_drvname, const char *to_dbname, const char *to_tblname)
 Copy a table. More...
 
int db_copy_table_where (const char *from_drvname, const char *from_dbname, const char *from_tblname, const char *to_drvname, const char *to_dbname, const char *to_tblname, const char *where)
 Copy a table (by where statement) More...
 
int db_copy_table_select (const char *from_drvname, const char *from_dbname, const char *from_tblname, const char *to_drvname, const char *to_dbname, const char *to_tblname, const char *select)
 Copy a table (by select statement) More...
 
int db_copy_table_by_ints (const char *from_drvname, const char *from_dbname, const char *from_tblname, const char *to_drvname, const char *to_dbname, const char *to_tblname, const char *selcol, int *ivals, int nvals)
 Copy a table (by keys) More...
 

Detailed Description

DBMI Library (client) - copy 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.

Author
Joel Jones (CERL/UIUC), Radim Blazek

Definition in file copy_tab.c.

Function Documentation

◆ db_copy_table()

int db_copy_table ( const char *  from_drvname,
const char *  from_dbname,
const char *  from_tblname,
const char *  to_drvname,
const char *  to_dbname,
const char *  to_tblname 
)

Copy a table.

Parameters
from_drvnamename of driver from table is copied
from_dbnamename of database from table is copied
from_tblnamename of table to be copied
to_drvnamename of driver to - where table is copied to
to_dbnamename of database to - where table is copied to
to_tblnamename of copied table
Returns
DB_OK on success
DB_FAILED on failure

Definition at line 446 of file copy_tab.c.

◆ db_copy_table_by_ints()

int db_copy_table_by_ints ( const char *  from_drvname,
const char *  from_dbname,
const char *  from_tblname,
const char *  to_drvname,
const char *  to_dbname,
const char *  to_tblname,
const char *  selcol,
int *  ivals,
int  nvals 
)

Copy a table (by keys)

Parameters
from_drvnamename of driver from table is copied
from_dbnamename of database from table is copied
from_tblnamename of table to be copied
to_drvnamename of driver to - where table is copied to
to_dbnamename of database to - where table is copied to
to_tblnamename of copied table
selcolname of column used to select records by values in ivals or NULL
ivalspointer to array of integer values or NULL
nvalsnumber of values in ivals
Returns
DB_OK on success
DB_FAILED on failure

Definition at line 519 of file copy_tab.c.

◆ db_copy_table_select()

int db_copy_table_select ( const char *  from_drvname,
const char *  from_dbname,
const char *  from_tblname,
const char *  to_drvname,
const char *  to_dbname,
const char *  to_tblname,
const char *  select 
)

Copy a table (by select statement)

Parameters
from_drvnamename of driver from table is copied
from_dbnamename of database from table is copied
from_dbnamename of table to be copied
to_drvnamename of driver to - where table is copied to
to_dbnamename of database to - where table is copied to
to_tblnamename of copied table
selectfull select statement
Returns
DB_OK on success
DB_FAILED on failure

Definition at line 493 of file copy_tab.c.

◆ db_copy_table_where()

int db_copy_table_where ( const char *  from_drvname,
const char *  from_dbname,
const char *  from_tblname,
const char *  to_drvname,
const char *  to_dbname,
const char *  to_tblname,
const char *  where 
)

Copy a table (by where statement)

Parameters
from_drvnamename of driver from table is copied
from_dbnamename of database from table is copied
from_tblnamename of table to be copied
to_drvnamename of driver to - where table is copied to
to_dbnamename of database to - where table is copied to
to_tblnamename of copied table
whereWHERE SQL condition (without where key word)
Returns
DB_OK on success
DB_FAILED on failure

Definition at line 469 of file copy_tab.c.