DBMI Library (client) - copy table. More...
#include <stdlib.h>
#include <string.h>
#include <grass/dbmi.h>
#include <grass/glocale.h>
#include "macros.h"
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, const char *where, const char *select, const char *selcol, int *ivals, int nvals) |
Copy table, used by various 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. | |
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). | |
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). | |
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). |
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.
Definition in file copy_tab.c.
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, | |||
const char * | where, | |||
const char * | select, | |||
const char * | selcol, | |||
int * | ivals, | |||
int | nvals | |||
) |
Copy table, used by various db_copy_table*.
Use either 'where' or 'select' or 'selcol'+'ivals'+'nvals' but never more than one.
Warning: driver opened as second must be closed as first, otherwise it hangs, not sure why.
from_dvrname | name of driver from table is copied | |
from_dbname | name of database from table is copied | |
from_tbl_name | name of table to be copied | |
to_dvrname | name of driver to - where table is copied to | |
to_dbname | name of database to - where table is copied to | |
to_dbname | name of copied table | |
where | WHERE SQL condition (without where key word) or NULL | |
select | full select statement | |
selcol | name of column used to select records by values in ivals or NULL | |
ivals | pointer to array of integer values or NULL | |
nvals | number of values in ivals |
Definition at line 58 of file copy_tab.c.
References db_alloc_table(), db_append_string(), db_begin_transaction(), db_close_cursor(), db_close_database_shutdown_driver(), db_commit_transaction(), db_convert_value_to_string(), db_create_table(), db_double_quote_string(), db_execute_immediate(), db_fetch(), db_get_column_description(), db_get_column_length(), db_get_column_name(), db_get_column_precision(), db_get_column_scale(), db_get_column_sqltype(), db_get_column_value(), db_get_cursor_table(), db_get_string(), db_get_table_column(), db_get_table_number_of_columns(), db_init_handle(), db_init_string(), db_list_tables(), db_open_database(), db_open_select_cursor(), db_set_column_description(), db_set_column_length(), db_set_column_name(), db_set_column_precision(), db_set_column_scale(), db_set_column_sqltype(), db_set_handle(), db_set_string(), db_set_table_name(), db_sqltype_name(), db_sqltype_to_Ctype(), db_start_driver(), and db_test_value_isnull().
Referenced by db_copy_table(), db_copy_table_by_ints(), db_copy_table_select(), and db_copy_table_where().
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.
from_dvrname | name of driver from table is copied | |
from_dbname | name of database from table is copied | |
from_tbl_name | name of table to be copied | |
to_dvrname | name of driver to - where table is copied to | |
to_dbname | name of database to - where table is copied to | |
to_dbname | name of copied table |
Definition at line 403 of file copy_tab.c.
References db__copy_table().
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).
from_dvrname | name of driver from table is copied | |
from_dbname | name of database from table is copied | |
from_tbl_name | name of table to be copied | |
to_dvrname | name of driver to - where table is copied to | |
to_dbname | name of database to - where table is copied to | |
to_dbname | name of copied table | |
selcol | name of column used to select records by values in ivals or NULL | |
ivals | pointer to array of integer values or NULL | |
nvals | number of values in ivals |
Definition at line 476 of file copy_tab.c.
References db__copy_table().
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).
from_dvrname | name of driver from table is copied | |
from_dbname | name of database from table is copied | |
from_tbl_name | name of table to be copied | |
to_dvrname | name of driver to - where table is copied to | |
to_dbname | name of database to - where table is copied to | |
to_dbname | name of copied table | |
select | full select statement |
Definition at line 450 of file copy_tab.c.
References db__copy_table().
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).
from_dvrname | name of driver from table is copied | |
from_dbname | name of database from table is copied | |
from_tbl_name | name of table to be copied | |
to_dvrname | name of driver to - where table is copied to | |
to_dbname | name of database to - where table is copied to | |
to_dbname | name of copied table | |
where | WHERE SQL condition (without where key word) |
Definition at line 426 of file copy_tab.c.
References db__copy_table().