|
GRASS 8 Programmer's Manual 8.6.0dev(2026)-6050dcdd58
|

Go to the source code of this file.
Add cursor do driver state.
| cursor | db cursor to be added |
Definition at line 78 of file driver_state.c.
References db_realloc(), and NULL.
Referenced by db_d_open_insert_cursor(), db_d_open_select_cursor(), and db_d_open_update_cursor().
Close all cursors.
Definition at line 120 of file driver_state.c.
References db_driver_close_cursor, db_free(), and NULL.
Referenced by db_d_close_database().
Drop cursor from driver state.
| cursor | db cursor to be dropped |
Definition at line 108 of file driver_state.c.
References NULL.
Referenced by db_d_close_cursor().
| dbDriverState * db__get_driver_state | ( | void | ) |
Initialize driver state.
Definition at line 24 of file driver_state.c.
References db_zero().
Referenced by db_d_close_database(), and db_driver().
Mark database as closed.
Definition at line 66 of file driver_state.c.
References db_free().
Referenced by db_d_close_database().
Mark database as opened.
| dbname | database name |
| dbschema | database schema name |
Definition at line 56 of file driver_state.c.
References db_store().
Referenced by db_d_open_database().
?
| d |
Definition at line 45 of file xdrchar.c.
References db__recv(), DB_OK, DB_PROTOCOL_ERR, and db_protocol_error().
Receive column default value.
| column | pointer to dbColumn |
Definition at line 120 of file xdrcolumn.c.
References db__recv_value(), db_get_column_default_value(), db_get_column_sqltype(), and db_sqltype_to_Ctype().
Receive column definition.
| column | pointer to dbColumn |
Definition at line 53 of file xdrcolumn.c.
References DB_OK, DB_RECV_CHAR, DB_RECV_COLUMN_DEFAULT_VALUE, DB_RECV_INT, and DB_RECV_STRING.
Receive column value.
| column | pointer to dbColumn |
Definition at line 94 of file xdrcolumn.c.
References db__recv_value(), db_get_column_sqltype(), db_get_column_value(), and db_sqltype_to_Ctype().
| int db__recv_datetime | ( | dbDateTime * | t | ) |
Receive datetime.
| t | pointer to dbDateTime |
Definition at line 47 of file xdrdatetime.c.
References DB_OK, DB_RECV_CHAR, DB_RECV_DOUBLE, DB_RECV_INT, and t.
Receive double.
| d |
Definition at line 42 of file xdrdouble.c.
References db__recv(), DB_OK, DB_PROTOCOL_ERR, and db_protocol_error().
Receive double array.
Returns an allocated array of doubles Caller is responsible for free()
| x | |
| n |
Definition at line 90 of file xdrdouble.c.
References count, db__recv(), db_calloc(), DB_OK, DB_PROTOCOL_ERR, db_protocol_error(), NULL, and x.
Receive float.
| d |
Definition at line 44 of file xdrfloat.c.
References db__recv(), DB_OK, DB_PROTOCOL_ERR, and db_protocol_error().
Receive float array.
Returns an allocated array of floats Caller is responsible for free()
| x | |
| n |
Definition at line 92 of file xdrfloat.c.
References count, db__recv(), db_calloc(), DB_OK, DB_PROTOCOL_ERR, db_protocol_error(), NULL, and x.
Receive handle.
| handle |
Definition at line 40 of file xdrhandle.c.
References DB_OK, DB_RECV_STRING, _db_handle::dbName, and _db_handle::dbSchema.
Receive index.
| index |
Definition at line 68 of file xdrindex.c.
References _db_index::columnNames, db_alloc_index_columns(), db_get_error_code(), db_init_index(), DB_OK, DB_RECV_CHAR, DB_RECV_INT, DB_RECV_STRING, _db_index::indexName, _db_index::tableName, and _db_index::unique.
Receive index array.
| list | |
| count |
Definition at line 95 of file xdrindex.c.
References count, db_alloc_index_array(), db_get_error_code(), DB_OK, DB_RECV_INDEX, DB_RECV_INT, and NULL.
Receive integer.
| n |
Definition at line 44 of file xdrint.c.
References db__recv(), DB_OK, DB_PROTOCOL_ERR, and db_protocol_error().
Referenced by db__recv_string_array(), and db__recv_token().
Receive integer array.
Returns an allocated array of ints Caller is responsible for free()
| x | |
| n |
Definition at line 92 of file xdrint.c.
References count, db__recv(), db_calloc(), DB_OK, DB_PROTOCOL_ERR, db_protocol_error(), NULL, and x.
? (driver only)
| n |
Definition at line 52 of file xdrprocedure.c.
References db__recv(), DB_EOF, and DB_OK.
Referenced by db_driver().
Receive return code.
| [out] | ret_code | return code |
Definition at line 51 of file ret_codes.c.
References db_error(), DB_FAILED, db_free_string(), db_get_string(), db_init_string(), DB_OK, DB_PROTOCOL_ERR, db_protocol_error(), DB_RECV_INT, and DB_RECV_STRING.
Referenced by db_start_driver().
Receive short.
| n |
Definition at line 46 of file xdrshort.c.
References db__recv(), DB_OK, DB_PROTOCOL_ERR, and db_protocol_error().
Receive short array.
Returns an allocated array of ints Caller is responsible for free()
| x | |
| n |
Definition at line 94 of file xdrshort.c.
References count, db__recv(), db_calloc(), DB_OK, DB_PROTOCOL_ERR, db_protocol_error(), NULL, and x.
Reads a string from transport.
Note: caller MUST initialize x by calling db_init_string()
| x |
Definition at line 117 of file xdrstring.c.
References db__recv(), db_enlarge_string(), db_get_string(), DB_OK, DB_PROTOCOL_ERR, db_protocol_error(), and x.
Referenced by db__recv_string_array().
Receive string array.
| a | |
| n |
Definition at line 46 of file xdrstring.c.
References b, count, db__recv_int(), db__recv_string(), db_alloc_string_array(), db_free_string_array(), DB_MEMORY_ERR, DB_OK, DB_PROTOCOL_ERR, db_protocol_error(), and NULL.
Receive table data.
| table |
Definition at line 101 of file xdrtable.c.
References _, db_error(), DB_FAILED, db_get_table_column(), DB_OK, DB_RECV_COLUMN_VALUE, DB_RECV_INT, and _db_table::numColumns.
Receive table definition.
| [out] | table |
Definition at line 51 of file xdrtable.c.
References db_alloc_table(), db_get_error_code(), DB_OK, DB_RECV_COLUMN_DEFINITION, DB_RECV_INT, DB_RECV_STRING, NULL, and t.
Receive token.
| token |
Definition at line 36 of file xdrtoken.c.
References db__recv_int().
Receive value.
| value | |
| Ctype |
Definition at line 62 of file xdrvalue.c.
References _, _db_value::d, DB_C_TYPE_DATETIME, DB_C_TYPE_DOUBLE, DB_C_TYPE_INT, DB_C_TYPE_STRING, db_error(), DB_FAILED, DB_OK, DB_RECV_CHAR, DB_RECV_DATETIME, DB_RECV_DOUBLE, DB_RECV_INT, DB_RECV_STRING, _db_value::i, _db_value::isNull, _db_value::s, and _db_value::t.
Referenced by db__recv_column_default_value(), and db__recv_column_value().
?
| d |
Definition at line 24 of file xdrchar.c.
References db__send(), DB_OK, DB_PROTOCOL_ERR, and db_protocol_error().
Send column default value.
| column | pointer to dbColumn |
Definition at line 107 of file xdrcolumn.c.
References db__send_value(), db_get_column_default_value(), db_get_column_sqltype(), and db_sqltype_to_Ctype().
Send column definition.
| column | pointer to dbColumn |
Definition at line 25 of file xdrcolumn.c.
References DB_OK, DB_SEND_CHAR, DB_SEND_COLUMN_DEFAULT_VALUE, DB_SEND_INT, and DB_SEND_STRING.
Send column value.
| column | pointer to dbColumn |
Definition at line 81 of file xdrcolumn.c.
References db__send_value(), db_get_column_sqltype(), db_get_column_value(), and db_sqltype_to_Ctype().
Send C string.
| s |
Definition at line 150 of file xdrstring.c.
References db__send_string(), db_init_string(), db_set_string_no_copy(), and x.
| int db__send_datetime | ( | dbDateTime * | t | ) |
Send datetime.
| t | pointer to dbDateTime |
Definition at line 25 of file xdrdatetime.c.
References DB_OK, DB_SEND_CHAR, DB_SEND_DOUBLE, DB_SEND_INT, and t.
Send double.
| d |
Definition at line 24 of file xdrdouble.c.
References db__send(), DB_OK, DB_PROTOCOL_ERR, and db_protocol_error().
Send double array.
| x | |
| n |
Definition at line 63 of file xdrdouble.c.
References db__send(), DB_OK, DB_PROTOCOL_ERR, db_protocol_error(), and x.
Send failure code.
Definition at line 37 of file ret_codes.c.
References DB_FAILED, db_get_error_msg(), DB_OK, DB_SEND_C_STRING, and DB_SEND_INT.
Referenced by db_driver().
Send float.
| d |
Definition at line 24 of file xdrfloat.c.
References db__send(), DB_OK, DB_PROTOCOL_ERR, and db_protocol_error().
Send float array.
| x | |
| n |
Definition at line 65 of file xdrfloat.c.
References db__send(), DB_OK, DB_PROTOCOL_ERR, db_protocol_error(), and x.
Send handle.
| handle |
Definition at line 25 of file xdrhandle.c.
References DB_OK, DB_SEND_STRING, _db_handle::dbName, and _db_handle::dbSchema.
Send index.
| index |
Definition at line 25 of file xdrindex.c.
References _db_index::columnNames, DB_OK, DB_SEND_CHAR, DB_SEND_INT, DB_SEND_STRING, _db_index::indexName, _db_index::numColumns, _db_index::tableName, and _db_index::unique.
Send index array.
| list | |
| count |
Definition at line 50 of file xdrindex.c.
References count, DB_OK, DB_SEND_INDEX, and DB_SEND_INT.
Send integer.
| n |
Definition at line 24 of file xdrint.c.
References db__send(), DB_OK, DB_PROTOCOL_ERR, and db_protocol_error().
Referenced by db__send_procedure_not_implemented(), db__send_procedure_ok(), db__send_string_array(), and db__send_token().
Send integer array.
| x | |
| n |
Definition at line 65 of file xdrint.c.
References db__send(), DB_OK, DB_PROTOCOL_ERR, db_protocol_error(), and x.
?
| n |
Definition at line 81 of file xdrprocedure.c.
References db__send_int().
Referenced by db_driver().
?
| n |
Definition at line 69 of file xdrprocedure.c.
References db__send_int().
Referenced by db_driver().
Send short.
| n |
Definition at line 25 of file xdrshort.c.
References db__send(), DB_OK, DB_PROTOCOL_ERR, and db_protocol_error().
Send short array.
| x | |
| n |
Definition at line 67 of file xdrshort.c.
References db__send(), DB_OK, DB_PROTOCOL_ERR, db_protocol_error(), and x.
Send string.
| x |
Definition at line 86 of file xdrstring.c.
References db__send(), db_get_string(), DB_OK, DB_PROTOCOL_ERR, db_protocol_error(), and x.
Referenced by db__send_Cstring(), and db__send_string_array().
Send string array.
| a | |
| count |
Definition at line 26 of file xdrstring.c.
References count, db__send_int(), db__send_string(), and DB_OK.
Send success code.
Definition at line 26 of file ret_codes.c.
References DB_OK, and DB_SEND_INT.
Referenced by db_driver().
Send table data.
| table |
Definition at line 81 of file xdrtable.c.
References db_get_table_column(), DB_OK, DB_SEND_COLUMN_VALUE, DB_SEND_INT, and _db_table::numColumns.
Send table definition.
| table | pointer to dbTable |
Definition at line 26 of file xdrtable.c.
References _db_table::columns, DB_OK, DB_SEND_COLUMN_DEFINITION, DB_SEND_INT, DB_SEND_STRING, _db_table::description, _db_table::numColumns, _db_table::priv_delete, _db_table::priv_insert, and _db_table::tableName.
Send token.
| token |
Definition at line 24 of file xdrtoken.c.
References db__send_int().
Send value.
| value | |
| Ctype |
Definition at line 28 of file xdrvalue.c.
References _db_value::d, DB_C_TYPE_DATETIME, DB_C_TYPE_DOUBLE, DB_C_TYPE_INT, DB_C_TYPE_STRING, db_error(), DB_FAILED, DB_OK, DB_SEND_CHAR, DB_SEND_DATETIME, DB_SEND_DOUBLE, DB_SEND_INT, DB_SEND_STRING, _db_value::i, _db_value::isNull, _db_value::s, and _db_value::t.
Referenced by db__send_column_default_value(), and db__send_column_value().
?
| send | |
| recv |
Definition at line 75 of file db/dbmi_base/xdr.c.
Referenced by db_add_column(), db_begin_transaction(), db_bind_update(), db_close_cursor(), db_close_database(), db_commit_transaction(), db_create_database(), db_create_index(), db_create_table(), db_delete(), db_delete_database(), db_describe_table(), db_driver(), db_drop_column(), db_drop_index(), db_drop_table(), db_execute_immediate(), db_fetch(), db_find_database(), db_get_num_rows(), db_grant_on_table(), db_gversion(), db_insert(), db_list_databases(), db_list_indexes(), db_list_tables(), db_open_database(), db_open_insert_cursor(), db_open_select_cursor(), db_open_update_cursor(), db_shutdown_driver(), db_start_driver(), and db_update().
? (client only)
| procnum |
Definition at line 25 of file xdrprocedure.c.
References db_noproc_error(), DB_OK, DB_PROTOCOL_ERR, db_protocol_error(), DB_RECV_INT, DB_SEND_INT, and procnum.
Test database connection.
Definition at line 45 of file driver_state.c.
Referenced by db_d_close_database(), and db_d_open_database().
Add column to table.
| driver | db driver |
| tableName | table name |
| column | new column description (dbColumn structure) |
Definition at line 28 of file c_add_col.c.
References db__set_protocol_fds(), DB_OK, DB_PROC_ADD_COLUMN, DB_RECV_RETURN_CODE, DB_SEND_COLUMN_DEFINITION, DB_SEND_STRING, and DB_START_PROCEDURE_CALL.
Allocate columns' flags for cursor.
| cursor | pointer to dbCursor |
Definition at line 275 of file cursor.c.
References db_calloc(), db_get_cursor_number_of_columns(), db_get_error_code(), DB_OK, db_unset_cursor_column_flag(), and NULL.
Referenced by db_open_update_cursor().
Allocate table for cursor.
| cursor | pointer to dbCursor |
| ncols | number of column in table |
Definition at line 38 of file cursor.c.
References db_alloc_table(), db_get_error_code(), DB_OK, and NULL.
Allocate dirent array.
| count | number of entities in the array |
Definition at line 166 of file lib/db/dbmi_base/dirent.c.
References count, db_calloc(), db_dirent(), db_init_string(), name, and NULL.
Referenced by db_dirent().
Allocate array of handles.
| count | number of handles in the array |
Definition at line 109 of file handle.c.
References count, db_calloc(), and db_init_handle().
Referenced by db_list_databases().
Allocate index array.
| count | number of items |
Definition at line 73 of file db/dbmi_base/index.c.
References count, db_calloc(), and db_init_index().
Referenced by db__recv_index_array().
Allocate index columns.
| index | pointer to dbIndex |
| ncols | number of columns to be allocated |
Definition at line 56 of file db/dbmi_base/index.c.
References _db_index::columnNames, db_alloc_string_array(), db_get_error_code(), DB_OK, NULL, and _db_index::numColumns.
Referenced by db__recv_index(), and db_create_index2().
Allocate dbString array.
| count | number of items to be allocated |
Definition at line 181 of file string.c.
References count, db_calloc(), and db_init_string().
Referenced by db__recv_string_array(), and db_alloc_index_columns().
Allocate a table with a specific number of columns.
| ncols | number of columns which should be allocated |
Definition at line 28 of file dbmi_base/table.c.
References _db_table::columns, db_calloc(), db_free(), db_init_column(), db_init_table(), db_malloc(), NULL, and _db_table::numColumns.
Referenced by db__recv_table_definition(), db_alloc_cursor_table(), db_clone_table(), P_Create_Aux2_Table(), and P_Create_Aux4_Table().
Append string to dbString.
| x | pointer to dbString |
| s | string to be appended |
Definition at line 205 of file string.c.
References db_enlarge_string(), db_get_string(), DB_OK, db_set_string(), and x.
Referenced by db_d_append_error(), db_d_report_error(), db_delete_table(), db_double_quote_string(), db_list_drivers(), db_select_CatValArray(), db_table_to_sql(), IL_write_point_2d(), P_Aux_to_Vector(), P_Drop_Aux_Table(), and P_Sparse_Points().
Append a specific column to given table.
| table | Pointer to dbTable |
| column | Pointer to a dbColumn to append. A copy of the column is stored, so the original column can be deleted. |
Definition at line 374 of file dbmi_base/table.c.
References _db_table::columns, db_copy_column(), DB_FAILED, DB_OK, db_realloc(), NULL, and _db_table::numColumns.
Toggles printing of DBMI error messages.
| flag | ? |
Definition at line 247 of file db/dbmi_base/error.c.
Referenced by db_driver().
Set auto print protocol error.
| flag | ? |
Definition at line 258 of file db/dbmi_base/error.c.
Referenced by db_driver().
Begin transaction.
| driver | db driver |
Definition at line 56 of file c_execute.c.
References db__set_protocol_fds(), DB_OK, DB_PROC_BEGIN_TRANSACTION, DB_RECV_RETURN_CODE, and DB_START_PROCEDURE_CALL.
Referenced by P_Sparse_Points().
?
| cursor | db cursor |
Definition at line 26 of file c_bindupdate.c.
References db__set_protocol_fds(), db_get_cursor_number_of_columns(), DB_OK, DB_PROC_BIND_UPDATE, DB_RECV_RETURN_CODE, DB_SEND_SHORT_ARRAY, DB_SEND_TOKEN, and DB_START_PROCEDURE_CALL.
Allocate memory.
On failure is called db_memory_error().
| n | number of entities |
| m | entity size |
Definition at line 69 of file db/dbmi_base/alloc.c.
References db_memory_error(), and NULL.
Referenced by db__recv_double_array(), db__recv_float_array(), db__recv_int_array(), db__recv_short_array(), db_alloc_cursor_column_flags(), db_alloc_dirent_array(), db_alloc_handle_array(), db_alloc_index_array(), db_alloc_string_array(), db_alloc_table(), and db_copy_column().
| int db_CatValArray_alloc | ( | dbCatValArray * | arr, |
| int | n | ||
| ) |
Allocate dbCatValArray.
| arr | pointer to dbCatValArray |
| n | number of items |
Definition at line 401 of file value.c.
References DB_OK, and G_calloc.
Referenced by db_select_CatValArray(), and Vedit_bulk_labeling().
| void db_CatValArray_free | ( | dbCatValArray * | arr | ) |
Free allocated dbCatValArray.
| arr | pointer to dbCatValArray |
Definition at line 373 of file value.c.
References DB_C_TYPE_DATETIME, DB_C_TYPE_STRING, db_free(), db_free_string(), and G_free().
Referenced by IL_vector_input_data_2d(), NetA_get_node_costs(), Vect_net_build_graph(), Vect_net_ttb_build_graph(), and Vedit_bulk_labeling().
| 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 469 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 519 of file db/dbmi_client/select.c.
References DB_FAILED, DB_OK, G_debug(), and NULL.
Referenced by IL_vector_input_data_2d(), NetA_get_node_costs(), Vect_net_build_graph(), and Vect_net_ttb_build_graph().
| 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 494 of file db/dbmi_client/select.c.
References DB_FAILED, DB_OK, and NULL.
Referenced by IL_vector_input_data_2d(), Vect_net_build_graph(), and Vect_net_ttb_build_graph().
| void db_CatValArray_init | ( | dbCatValArray * | arr | ) |
Initialize dbCatValArray.
| arr | pointer to dbCatValArray to be initialized |
Definition at line 361 of file value.c.
References NULL.
Referenced by IL_vector_input_data_2d(), NetA_get_node_costs(), Vect_net_build_graph(), and Vect_net_ttb_build_graph().
| int db_CatValArray_realloc | ( | dbCatValArray * | arr, |
| int | n | ||
| ) |
Realloc dbCatValArray.
| arr | pointer to dbCatValArray |
| n | number of items |
| void db_CatValArray_sort | ( | dbCatValArray * | arr | ) |
Sort key/value array by key.
| [in,out] | arr | dbCatValArray (key/value array) |
Definition at line 421 of file db/dbmi_client/select.c.
Referenced by db_select_CatValArray().
| int db_CatValArray_sort_by_value | ( | dbCatValArray * | arr | ) |
Sort key/value array by value.
| [in,out] | arr | dbCatValArray (key/value array) |
Definition at line 434 of file db/dbmi_client/select.c.
References DB_C_TYPE_DATETIME, DB_C_TYPE_DOUBLE, DB_C_TYPE_INT, DB_C_TYPE_STRING, DB_FAILED, and DB_OK.
Referenced by Vedit_bulk_labeling().
Convert character to lowercase.
| s | character to be modified |
Definition at line 22 of file case.c.
Referenced by db_Cstring_to_lowercase().
Convert character to uppercase.
| s | character to be modified |
Definition at line 33 of file case.c.
Referenced by db_Cstring_to_uppercase(), and db_nocase_compare().
Clear error status.
Definition at line 170 of file db/dbmi_base/error.c.
References DB_OK.
Referenced by db_dirent(), and db_driver().
Make a new exact copy of an existing table.
New memory is allocated for the clone, the columns-content will be copied too.
| src | Pointer to dbTable |
Definition at line 396 of file dbmi_base/table.c.
References _db_table::columns, db_alloc_table(), db_copy_column(), db_copy_string(), db_get_table_number_of_columns(), _db_table::description, NULL, _db_table::priv_delete, _db_table::priv_insert, and _db_table::tableName.
Close cursor.
| cursor | cursor to be close |
Definition at line 27 of file c_close_cur.c.
References db__set_protocol_fds(), db_free_cursor(), DB_OK, DB_PROC_CLOSE_CURSOR, DB_RECV_RETURN_CODE, DB_SEND_TOKEN, and DB_START_PROCEDURE_CALL.
Referenced by db_get_table_number_of_rows(), db_select_CatValArray(), db_select_int(), db_select_value(), NetA_init_distinct(), NetA_init_timetable_from_db(), and Vect_write_ascii().
Close database connection.
| driver | db driver |
Definition at line 26 of file c_closedb.c.
References db__set_protocol_fds(), DB_OK, DB_PROC_CLOSE_DATABASE, DB_RECV_RETURN_CODE, and DB_START_PROCEDURE_CALL.
Referenced by db_close_database_shutdown_driver(), IL_write_point_2d(), and Vect_write_ascii().
Close driver/database connection.
| driver | db driver |
Definition at line 61 of file db.c.
References db_close_database(), DB_FAILED, DB_OK, db_shutdown_driver(), and G_debug().
Referenced by db_delete_table(), db_get_table_number_of_rows(), db_table_exists(), Gp_load_sites_thematic(), IL_vector_input_data_2d(), NetA_get_node_costs(), NetA_init_timetable_from_db(), V1_close_ogr(), V1_close_pg(), Vect_cats_set_constraint(), Vect_copy_table_by_cats(), Vect_get_column_names(), Vect_get_column_names_types(), Vect_get_column_types(), Vect_net_build_graph(), Vect_net_ttb_build_graph(), Vect_rename(), Vect_set_varray_from_db(), and Vect_write_ascii().
Get column ctype.
Supported types:
| driver | DB driver |
| tab | table name |
| col | column name |
Definition at line 99 of file dbmi_client/column.c.
References db_column_sqltype(), and db_sqltype_to_Ctype().
Referenced by IL_vector_input_data_2d(), and Vect_write_ascii().
Get column sqltype.
See db_sqltype_name().
Supported types:
| driver | DB driver |
| tab | table name |
| col | column name |
Definition at line 51 of file dbmi_client/column.c.
References db_describe_table(), db_free_string(), db_free_table(), db_get_column_name(), db_get_column_sqltype(), db_get_table_column(), db_get_table_number_of_columns(), db_init_string(), DB_OK, and db_set_string().
Referenced by db_column_Ctype().
Commit transaction.
| driver | db driver |
Definition at line 82 of file c_execute.c.
References db__set_protocol_fds(), DB_OK, DB_PROC_COMMIT_TRANSACTION, DB_RECV_RETURN_CODE, and DB_START_PROCEDURE_CALL.
Referenced by P_Sparse_Points().
?
| column | pointer to dbColumn |
| string | pointer to dbString |
Definition at line 80 of file columnfmt.c.
References db_convert_value_to_string(), db_get_column_default_value(), and db_get_column_sqltype().
Referenced by db_print_column_definition().
?
| column | pointer to dbColumn |
| string | pointer to dbString |
Definition at line 62 of file columnfmt.c.
References db_convert_value_to_string(), db_get_column_sqltype(), and db_get_column_value().
?
| Cstring | string buffer |
| column | pointer to dbColumn |
Definition at line 43 of file columnfmt.c.
References db_convert_Cstring_to_value(), db_get_column_default_value(), and db_get_column_sqltype().
?
| Cstring | string buffer |
| column | pointer to dbColumn |
Definition at line 25 of file columnfmt.c.
References db_convert_Cstring_to_value(), db_get_column_sqltype(), and db_get_column_value().
Convert string to value.
| Cstring | string buffer | |
| sqltype | SQL data type | |
| [out] | value | pointer to dbValue |
Definition at line 31 of file valuefmt.c.
References _, DB_C_TYPE_DATETIME, DB_C_TYPE_DOUBLE, DB_C_TYPE_INT, DB_C_TYPE_STRING, db_convert_Cstring_to_value_datetime(), db_error(), DB_FAILED, DB_OK, db_set_value_double(), db_set_value_int(), db_set_value_string(), and db_sqltype_to_Ctype().
Referenced by db_convert_Cstring_to_column_default_value(), and db_convert_Cstring_to_column_value().
Convert datetime string to value.
The format of buf must be as follows
| buf | input string buffer | |
| sqltype | SQL data type | |
| [out] | value | pointer to dbValue to be set |
Definition at line 203 of file datetime.c.
References DB_DAY, DB_FRACTION, DB_HOUR, db_interval_range(), DB_MINUTE, DB_MONTH, db_nocase_compare(), DB_OK, DB_SECOND, db_set_value_datetime_current(), db_set_value_day(), db_set_value_hour(), db_set_value_minute(), db_set_value_month(), db_set_value_seconds(), db_set_value_year(), DB_SQL_TYPE_DATE, DB_SQL_TYPE_TIME, DB_SQL_TYPE_TIMESTAMP, and DB_YEAR.
Referenced by db_convert_Cstring_to_value().
Convert datetime value into string.
| value | pointer to dbValue | |
| sqltype | SQL data type | |
| [out] | string | pointer to dbString |
Definition at line 31 of file datetime.c.
References DB_DAY, DB_FRACTION, db_get_value_day(), db_get_value_hour(), db_get_value_minute(), db_get_value_month(), db_get_value_seconds(), db_get_value_year(), DB_HOUR, db_interval_range(), DB_MINUTE, DB_MONTH, DB_SECOND, db_set_string(), DB_SQL_TYPE_DATE, DB_SQL_TYPE_TIME, DB_SQL_TYPE_TIMESTAMP, db_test_value_datetime_current(), and DB_YEAR.
Referenced by db_convert_value_to_string().
Convert value to string.
| value | pointer to dbValue | |
| sqltype | SQL data type | |
| [out] | string | pointer to dbString |
Definition at line 68 of file valuefmt.c.
References _, DB_C_TYPE_DATETIME, DB_C_TYPE_DOUBLE, DB_C_TYPE_INT, DB_C_TYPE_STRING, db_convert_value_datetime_into_string(), db_error(), DB_FAILED, db_get_value_double(), db_get_value_int(), db_get_value_string(), db_set_string(), db_sqltype_to_Ctype(), db_test_value_isnull(), and G_trim_decimal().
Referenced by db_convert_column_default_value_to_string(), and db_convert_column_value_to_string().
Copy a db column from source to destination.
| src | The column to copy from |
| dest | An allocated column to copy to which will be initialized. In case dest is NULL a new column will be allocated and returned |
Definition at line 472 of file dbmi_base/column.c.
References _db_column::columnName, _db_column::dataLen, db_calloc(), db_copy_string(), db_copy_value(), db_init_column(), _db_column::defaultValue, _db_column::description, _db_column::hasDefaultValue, _db_column::hostDataType, NULL, _db_column::nullAllowed, _db_column::precision, _db_column::scale, _db_column::select, _db_column::sqlDataType, _db_column::update, _db_column::useDefaultValue, and _db_column::value.
Referenced by db_append_table_column(), db_clone_table(), db_get_column(), and db_set_table_column().
Copy dbmscap entry.
| dst | destination |
| src | source |
Definition at line 79 of file dbmscap.c.
References _dbmscap::comment, _dbmscap::driverName, _dbmscap::startup, and strcpy.
Referenced by db_start_driver().
Copy dbString.
| dst | destination dbString |
| src | source dbString |
Definition at line 230 of file string.c.
References db_get_string(), and db_set_string().
Referenced by db_clone_table(), db_copy_column(), and db_copy_value().
| 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_drvname | name of driver from table is copied |
| from_dbname | name of database from table is copied |
| from_tblname | name of table to be copied |
| to_drvname | name of driver to - where table is copied to |
| to_dbname | name of database to - where table is copied to |
| to_tblname | name of copied table |
Definition at line 443 of file copy_tab.c.
References NULL.
Referenced by V1_close_nat(), and Vect_rename().
| 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_drvname | name of driver from table is copied |
| from_dbname | name of database from table is copied |
| from_tblname | name of table to be copied |
| to_drvname | name of driver to - where table is copied to |
| to_dbname | name of database to - where table is copied to |
| to_tblname | 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 514 of file copy_tab.c.
References NULL.
Referenced by Vect_copy_table_by_cats().
| 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_drvname | name of driver from table is copied |
| from_dbname | name of database from table is copied |
| from_tblname | name of table to be copied |
| to_drvname | name of driver to - where table is copied to |
| to_dbname | name of database to - where table is copied to |
| to_tblname | name of copied table |
| select | full select statement |
Definition at line 488 of file copy_tab.c.
References NULL.
| 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_drvname | name of driver from table is copied |
| from_dbname | name of database from table is copied |
| from_tblname | name of table to be copied |
| to_drvname | name of driver to - where table is copied to |
| to_dbname | name of database to - where table is copied to |
| to_tblname | name of copied table |
| where | WHERE SQL condition (without where key word) |
Definition at line 465 of file copy_tab.c.
References NULL.
Copy value.
Copy value from src to destination
| dst | destination dbValue |
| src | source dbValue |
Definition at line 340 of file value.c.
References _db_date_time::current, _db_value::d, _db_date_time::day, db_copy_string(), _db_date_time::hour, _db_value::i, _db_value::isNull, _db_date_time::minute, _db_date_time::month, _db_string::nalloc, _db_value::s, _db_date_time::seconds, _db_value::t, and _db_date_time::year.
Referenced by db_copy_column(), and db_select_value().
Create database.
| driver | db driver |
| handle | handle |
Definition at line 27 of file c_createdb.c.
References db__set_protocol_fds(), DB_OK, DB_PROC_CREATE_DATABASE, DB_RECV_RETURN_CODE, DB_SEND_HANDLE, and DB_START_PROCEDURE_CALL.
Create index.
| driver | db driver |
| index | index info (pointer to dbIndex structure) |
Definition at line 28 of file c_create_idx.c.
References db__set_protocol_fds(), DB_OK, DB_PROC_CREATE_INDEX, DB_RECV_RETURN_CODE, DB_RECV_STRING, DB_SEND_INDEX, DB_START_PROCEDURE_CALL, and _db_index::indexName.
Referenced by db_create_index2().
Create unique index.
| driver | db driver |
| table_name | table name |
| column_name | column name (where to create index) |
Definition at line 61 of file c_create_idx.c.
References db_alloc_index_columns(), db_create_index(), db_free_index(), db_init_index(), db_set_index_column_name(), db_set_index_name(), db_set_index_table_name(), db_set_index_type_unique(), and NULL.
Referenced by Vect_copy_table_by_cats(), and Vect_rename().
Create table.
| driver | db driver |
| table | table description (pointer to dbTable structure) |
Definition at line 27 of file c_create_tab.c.
References db__set_protocol_fds(), DB_OK, DB_PROC_CREATE_TABLE, DB_RECV_RETURN_CODE, DB_SEND_TABLE_DEFINITION, and DB_START_PROCEDURE_CALL.
Referenced by P_Create_Aux2_Table(), and P_Create_Aux4_Table().
Convert string to lowercase.
| s | string buffer to be modified |
Definition at line 44 of file case.c.
References db_char_to_lowercase().
Convert string to lowercase.
| s | string buffer to be modified |
Definition at line 55 of file case.c.
References db_char_to_uppercase().
Add column to table.
Definition at line 26 of file d_add_col.c.
References db_driver_add_column, db_free_column(), db_free_string(), db_init_column(), db_init_string(), DB_OK, DB_RECV_COLUMN_DEFINITION, DB_RECV_STRING, DB_SEND_FAILURE, DB_SEND_SUCCESS, and name.
Begin transaction.
Definition at line 56 of file d_execute.c.
References db_driver_begin_transaction, DB_OK, DB_SEND_FAILURE, and DB_SEND_SUCCESS.
ADD.
Definition at line 25 of file d_bindupdate.c.
References db_driver_bind_update, db_error(), DB_FAILED, db_find_token(), DB_OK, DB_RECV_SHORT_ARRAY, DB_RECV_TOKEN, DB_SEND_FAILURE, DB_SEND_SUCCESS, db_test_cursor_any_column_flag(), db_test_cursor_type_update(), and NULL.
Close cursor.
Definition at line 26 of file d_close_cur.c.
References db__drop_cursor_from_driver_state(), db_driver_close_cursor, db_drop_token(), db_error(), DB_FAILED, db_find_token(), db_free(), db_free_cursor(), DB_OK, DB_RECV_TOKEN, DB_SEND_FAILURE, DB_SEND_SUCCESS, and NULL.
Close database connection.
Definition at line 25 of file d_closedb.c.
References db__close_all_cursors(), db__init_driver_state(), db__mark_database_closed(), db__test_database_open(), db_driver_close_database, db_error(), DB_OK, DB_SEND_FAILURE, and DB_SEND_SUCCESS.
Commit transaction.
Definition at line 80 of file d_execute.c.
References db_driver_commit_transaction, DB_OK, DB_SEND_FAILURE, and DB_SEND_SUCCESS.
Create database.
Definition at line 26 of file d_createdb.c.
References db_driver_create_database, db_free_handle(), db_init_handle(), DB_OK, DB_RECV_HANDLE, DB_SEND_FAILURE, and DB_SEND_SUCCESS.
Create index.
Definition at line 26 of file d_create_idx.c.
References db_driver_create_index, db_free_index(), db_init_index(), DB_OK, DB_RECV_INDEX, DB_SEND_FAILURE, DB_SEND_STRING, DB_SEND_SUCCESS, and _db_index::indexName.
Create table.
Definition at line 26 of file d_create_tab.c.
References db_driver_create_table, db_free_table(), DB_OK, DB_RECV_TABLE_DEFINITION, DB_SEND_FAILURE, and DB_SEND_SUCCESS.
Delete record (?)
Definition at line 25 of file d_delete.c.
References db_driver_delete, db_error(), DB_FAILED, db_find_token(), DB_OK, DB_RECV_TOKEN, DB_SEND_FAILURE, DB_SEND_SUCCESS, db_test_cursor_type_update(), and NULL.
Delete database.
Definition at line 26 of file d_deletedb.c.
References db_driver_delete_database, db_free_handle(), db_init_handle(), DB_OK, DB_RECV_HANDLE, DB_SEND_FAILURE, and DB_SEND_SUCCESS.
Describe table.
Definition at line 26 of file d_desc_table.c.
References db_driver_describe_table, db_free_string(), db_free_table(), db_get_string(), db_init_string(), DB_OK, DB_RECV_STRING, DB_SEND_FAILURE, DB_SEND_SUCCESS, DB_SEND_TABLE_DEFINITION, db_set_table_name(), and name.
Drop column.
Definition at line 26 of file d_drop_col.c.
References db_driver_drop_column, db_free_string(), db_init_string(), DB_OK, DB_RECV_STRING, DB_SEND_FAILURE, and DB_SEND_SUCCESS.
Drop index.
Definition at line 26 of file d_drop_index.c.
References db_driver_drop_index, db_free_string(), db_init_string(), DB_OK, DB_RECV_STRING, DB_SEND_FAILURE, DB_SEND_SUCCESS, and name.
Drop table.
Definition at line 26 of file d_drop_tab.c.
References db_driver_drop_table, db_free_string(), db_init_string(), DB_OK, DB_RECV_STRING, DB_SEND_FAILURE, DB_SEND_SUCCESS, and name.
Execute SQL statements.
Definition at line 26 of file d_execute.c.
References db_driver_execute_immediate, db_free_string(), db_init_string(), DB_OK, DB_RECV_STRING, DB_SEND_FAILURE, and DB_SEND_SUCCESS.
Fetch data.
Definition at line 27 of file d_fetch.c.
References db_driver_fetch, DB_FAILED, db_find_token(), DB_OK, DB_RECV_INT, DB_RECV_TOKEN, DB_SEND_FAILURE, DB_SEND_INT, DB_SEND_SUCCESS, and DB_SEND_TABLE_DATA.
Find database.
Definition at line 26 of file d_finddb.c.
References db_driver_find_database, db_free_handle(), db_init_handle(), DB_OK, DB_RECV_HANDLE, DB_SEND_FAILURE, DB_SEND_HANDLE, DB_SEND_INT, and DB_SEND_SUCCESS.
Get number of selected rows.
Definition at line 25 of file d_rows.c.
References db_driver_get_num_rows, db_find_token(), DB_OK, DB_RECV_TOKEN, DB_SEND_FAILURE, DB_SEND_INT, and DB_SEND_SUCCESS.
Grant privileges on table.
Definition at line 26 of file d_priv.c.
References db_driver_grant_on_table, db_free_string(), db_init_string(), DB_OK, DB_RECV_INT, DB_RECV_STRING, DB_SEND_FAILURE, and DB_SEND_SUCCESS.
Insert new record into table.
Definition at line 25 of file d_insert.c.
References db_driver_insert, db_error(), DB_FAILED, db_find_token(), DB_OK, DB_RECV_TABLE_DATA, DB_RECV_TOKEN, DB_SEND_FAILURE, DB_SEND_SUCCESS, db_test_cursor_type_insert(), and NULL.
List databases.
Definition at line 26 of file d_listdb.c.
References count, db_driver_list_databases, db_free_handle_array(), db_free_string_array(), DB_OK, DB_RECV_STRING_ARRAY, DB_SEND_FAILURE, DB_SEND_HANDLE, DB_SEND_INT, and DB_SEND_SUCCESS.
List indexes.
Definition at line 26 of file d_list_idx.c.
References count, db_driver_list_indexes, db_free_index_array(), db_free_string(), db_init_string(), DB_OK, DB_RECV_STRING, DB_SEND_FAILURE, DB_SEND_INDEX_ARRAY, and DB_SEND_SUCCESS.
List available tables for given connection.
Definition at line 25 of file d_list_tabs.c.
References count, db_driver_list_tables, DB_OK, DB_RECV_INT, DB_SEND_FAILURE, DB_SEND_STRING_ARRAY, and DB_SEND_SUCCESS.
Open database connection.
Definition at line 26 of file d_opendb.c.
References db__mark_database_open(), db__test_database_open(), db_driver_open_database, db_error(), db_free_handle(), db_get_handle_dbname(), db_get_handle_dbschema(), db_init_handle(), DB_OK, DB_RECV_HANDLE, DB_SEND_FAILURE, and DB_SEND_SUCCESS.
Open insert cursor.
Definition at line 25 of file d_openinsert.c.
References db__add_cursor_to_driver_state(), db_driver_open_insert_cursor, db_get_error_code(), db_init_cursor(), db_malloc(), db_new_token(), DB_OK, DB_RECV_TABLE_DEFINITION, DB_SEND_FAILURE, DB_SEND_INT, DB_SEND_SUCCESS, DB_SEND_TOKEN, db_set_cursor_table(), db_set_cursor_type_insert(), and NULL.
Open select cursor.
Definition at line 26 of file d_openselect.c.
References db__add_cursor_to_driver_state(), db_driver_open_select_cursor, db_free_string(), db_get_error_code(), db_init_cursor(), db_init_string(), db_malloc(), db_new_token(), DB_OK, DB_RECV_INT, DB_RECV_STRING, DB_SEND_FAILURE, DB_SEND_INT, DB_SEND_SUCCESS, DB_SEND_TABLE_DEFINITION, DB_SEND_TOKEN, db_set_cursor_type_readonly(), and NULL.
Open update cursor.
Definition at line 26 of file d_openupdate.c.
References db__add_cursor_to_driver_state(), db_driver_open_update_cursor, db_free_string(), db_get_error_code(), db_init_cursor(), db_init_string(), db_malloc(), db_new_token(), DB_OK, DB_RECV_INT, DB_RECV_STRING, DB_SEND_FAILURE, DB_SEND_INT, DB_SEND_SUCCESS, DB_SEND_TABLE_DEFINITION, DB_SEND_TOKEN, db_set_cursor_type_update(), and NULL.
Report error message for DB driver.
Definition at line 94 of file d_error.c.
References db_append_string(), db_error(), db_get_string(), and init().
?
Definition at line 25 of file d_update.c.
References db_driver_update, db_error(), DB_FAILED, db_find_token(), DB_OK, DB_RECV_TABLE_DATA, DB_RECV_TOKEN, DB_SEND_FAILURE, DB_SEND_SUCCESS, db_test_cursor_any_column_flag(), db_test_cursor_type_update(), and NULL.
Get version info.
Definition at line 24 of file d_version.c.
References DB_OK, DB_SEND_C_STRING, DB_SEND_SUCCESS, and DB_VERSION.
Get dbmscap file name.
Definition at line 57 of file dbmscap.c.
Referenced by db_read_dbmscap().
Turn off debugging.
Definition at line 216 of file db/dbmi_base/error.c.
Turn on debugging.
Definition at line 208 of file db/dbmi_base/error.c.
Delete record (?)
| cursor | db cursor |
Definition at line 26 of file c_delete.c.
References db__set_protocol_fds(), DB_OK, DB_PROC_DELETE, DB_RECV_RETURN_CODE, DB_SEND_TOKEN, and DB_START_PROCEDURE_CALL.
Delete database.
| driver | db driver |
| handle | handle info |
Definition at line 27 of file c_deletedb.c.
References db__set_protocol_fds(), DB_OK, DB_PROC_DELETE_DATABASE, DB_RECV_RETURN_CODE, DB_SEND_HANDLE, and DB_START_PROCEDURE_CALL.
Delete table.
| drvname | driver name |
| dbname | database name |
| tblname | table name |
Definition at line 29 of file delete_tab.c.
References _, db_append_string(), db_close_database_shutdown_driver(), db_execute_immediate(), DB_FAILED, db_get_string(), db_init_string(), DB_OK, db_set_string(), db_start_driver_open_database(), G_debug(), G_warning(), and NULL.
Referenced by Vect__delete(), and Vect_rename().
Describe table.
| driver | db driver | |
| name | table name | |
| [out] | table | pointer to dbTable structure |
Definition at line 28 of file c_desc_table.c.
References db__set_protocol_fds(), DB_OK, DB_PROC_DESCRIBE_TABLE, DB_RECV_RETURN_CODE, DB_RECV_TABLE_DEFINITION, DB_SEND_STRING, DB_START_PROCEDURE_CALL, and name.
Referenced by db_column_sqltype(), db_get_column(), Vect_get_column_names(), Vect_get_column_names_types(), Vect_get_column_types(), and Vect_write_ascii().
Read directory and build an array of dbDirent's.
Append one entry with name = NULL to mark end of array
| dirname | directory name | |
| [out] | n | number of entities |
Definition at line 51 of file lib/db/dbmi_base/dirent.c.
References closedir(), count, db_alloc_dirent_array(), db_clear_error(), db_dirent(), db_free(), db_isdir(), db_malloc(), DB_OK, db_set_string(), db_syserror(), _db_dirent::isdir, max, name, NULL, opendir(), _db_dirent::perm, readdir(), and rewinddir().
Referenced by db_alloc_dirent_array(), db_dirent(), and db_free_dirent_array().
Replace each ' is replaced by ''.
| src | pointer to dbString |
Definition at line 240 of file string.c.
References db_append_string(), db_free_string(), db_get_string(), db_init_string(), db_set_string(), and NULL.
Drop column.
| driver | db driver |
| tableName | table name |
| columnName | column name to be dropped |
Definition at line 28 of file c_drop_col.c.
References db__set_protocol_fds(), DB_OK, DB_PROC_DROP_COLUMN, DB_RECV_RETURN_CODE, DB_SEND_STRING, and DB_START_PROCEDURE_CALL.
Drop index.
| driver | db driver |
| name | index name |
Definition at line 27 of file c_drop_index.c.
References db__set_protocol_fds(), DB_OK, DB_PROC_DROP_INDEX, DB_RECV_RETURN_CODE, DB_SEND_STRING, DB_START_PROCEDURE_CALL, and name.
Drop table.
| driver | db driver |
| name | table name to be dropped |
Definition at line 28 of file c_drop_tab.c.
References db__set_protocol_fds(), DB_OK, DB_PROC_DROP_TABLE, DB_RECV_RETURN_CODE, DB_SEND_STRING, DB_START_PROCEDURE_CALL, and name.
Referenced by V1_close_nat().
Drop token.
| token | pointer to dbToken |
Definition at line 42 of file db/dbmi_base/token.c.
References NONE.
Referenced by db_d_close_cursor().
Enlarge dbString.
| x | pointer to dbString |
| len | requested string size |
Definition at line 120 of file string.c.
References DB_MEMORY_ERR, DB_OK, db_realloc(), NULL, and x.
Referenced by db__recv_string(), and db_append_string().
Report error message.
| s | error message (can be NULL) |
Definition at line 69 of file db/dbmi_base/error.c.
References _, DB_FAILED, db_free(), db_print_error(), db_store(), and NULL.
Referenced by db__recv_return_code(), db__recv_table_data(), db__recv_value(), db__send_value(), db_convert_Cstring_to_value(), db_convert_value_to_string(), db_d_bind_update(), db_d_close_cursor(), db_d_close_database(), db_d_delete(), db_d_insert(), db_d_open_database(), db_d_report_error(), db_d_update(), db_get_index_column_name(), db_memory_error(), db_noproc_error(), db_procedure_not_implemented(), db_protocol_error(), db_set_index_column_name(), db_start_driver(), and db_syserror().
Execute SQL statements.
| driver | db driver |
| SQLstatement | SQL statement (alter, update, ...) |
Definition at line 27 of file c_execute.c.
References db__set_protocol_fds(), DB_OK, DB_PROC_EXECUTE_IMMEDIATE, DB_RECV_RETURN_CODE, DB_SEND_STRING, and DB_START_PROCEDURE_CALL.
Referenced by db_delete_table(), IL_write_point_2d(), P_Drop_Aux_Table(), and P_Sparse_Points().
Fetch data from open cursor.
| cursor | pointer to dbCursor | |
| position | cursor position | |
| [out] | more | get more (0 for no data to be fetched) |
Definition at line 28 of file c_fetch.c.
References db__set_protocol_fds(), DB_OK, DB_PROC_FETCH, DB_RECV_INT, DB_RECV_RETURN_CODE, DB_RECV_TABLE_DATA, DB_SEND_INT, DB_SEND_TOKEN, and DB_START_PROCEDURE_CALL.
Referenced by db_select_CatValArray(), db_select_int(), db_select_value(), NetA_init_distinct(), NetA_init_timetable_from_db(), P_Aux_to_Vector(), and Vect_write_ascii().
Find database.
| driver | db driver | |
| handle | handle info | |
| [out] | found | if non-zero database found |
Definition at line 29 of file c_finddb.c.
References db__set_protocol_fds(), db_free_handle(), db_get_handle_dbname(), db_get_handle_dbschema(), DB_OK, DB_PROC_FIND_DATABASE, DB_RECV_HANDLE, DB_RECV_INT, DB_RECV_RETURN_CODE, DB_SEND_HANDLE, db_set_handle(), and DB_START_PROCEDURE_CALL.
Find token.
| token | pointer to dbToken |
Definition at line 30 of file db/dbmi_base/token.c.
References NONE.
Referenced by db_d_bind_update(), db_d_close_cursor(), db_d_delete(), db_d_fetch(), db_d_get_num_rows(), db_d_insert(), and db_d_update().
Free allocated memory.
| s | pointer to memory to be freed |
Definition at line 111 of file db/dbmi_base/alloc.c.
References free().
Referenced by db__close_all_cursors(), db__mark_database_closed(), db_alloc_table(), db_CatValArray_free(), db_d_close_cursor(), db_dirent(), db_error(), db_free_cursor_column_flags(), db_free_dbmscap(), db_free_dirent_array(), db_free_handle_array(), db_free_index_array(), db_free_string(), db_free_string_array(), db_free_table(), db_set_error_who(), and db_shutdown_driver().
Frees column structure.
| column | pointer to dbColumn |
Definition at line 454 of file dbmi_base/column.c.
References db_free_string().
Referenced by db_d_add_column(), db_free_table(), Vect_net_build_graph(), and Vect_net_ttb_build_graph().
Free allocated dbCursor.
| cursor | pointer to dbCursor |
Definition at line 51 of file cursor.c.
References db_free_cursor_column_flags(), db_free_table(), and db_init_cursor().
Referenced by db_close_cursor(), and db_d_close_cursor().
Free columns' flags of cursor.
| cursor | pointer to dbCursor |
Definition at line 294 of file cursor.c.
References db_free(), and NULL.
Referenced by db_free_cursor().
Free dbmscap.
| list | pointer to dbDbmscap |
Definition at line 264 of file dbmscap.c.
References db_free(), and _dbmscap::next.
Referenced by db_list_drivers(), and db_start_driver().
Free dbDirent.
| db_dirent | pointer to dbDirent |
| count | number of entities in the array |
Definition at line 117 of file lib/db/dbmi_base/dirent.c.
References count, db_dirent(), db_free(), db_free_string(), and name.
Free dbHandle structure.
| handle | pointer to dbHandle |
Definition at line 79 of file handle.c.
References db_free_string(), _db_handle::dbName, and _db_handle::dbSchema.
Referenced by db_d_create_database(), db_d_delete_database(), db_d_find_database(), db_d_open_database(), db_find_database(), and db_free_handle_array().
Free array of handles.
| handle | pointer to first dbHandle in the array |
| count | number of handles in the array |
Definition at line 91 of file handle.c.
References count, db_free(), and db_free_handle().
Referenced by db_d_list_databases().
Free allocated dbIndex.
| index | pointer to dbIndex to be freed |
Definition at line 39 of file db/dbmi_base/index.c.
References _db_index::columnNames, db_free_string(), db_free_string_array(), db_init_index(), _db_index::indexName, _db_index::numColumns, and _db_index::tableName.
Referenced by db_create_index2(), db_d_create_index(), and db_free_index_array().
Free index array.
| list | dbIndex array |
| count | number of items in the array |
Definition at line 92 of file db/dbmi_base/index.c.
References count, db_free(), and db_free_index().
Referenced by db_d_list_indexes().
Free allocated space for dbString.
| x | pointer to dbString |
Definition at line 150 of file string.c.
References db_free(), db_init_string(), and x.
Referenced by db__recv_return_code(), db_CatValArray_free(), db_column_sqltype(), db_d_add_column(), db_d_describe_table(), db_d_drop_column(), db_d_drop_index(), db_d_drop_table(), db_d_execute_immediate(), db_d_grant_on_table(), db_d_list_indexes(), db_d_open_select_cursor(), db_d_open_update_cursor(), db_double_quote_string(), db_free_column(), db_free_dirent_array(), db_free_handle(), db_free_index(), db_free_string_array(), db_free_table(), db_grant_on_table(), db_select_CatValArray(), db_select_int(), and db_select_value().
Free allocated dbString array.
| a | pointer to 1st dbString in the array |
| n | number of items in array |
Definition at line 163 of file string.c.
References db_free(), and db_free_string().
Referenced by db__recv_string_array(), db_d_list_databases(), db_free_index(), and db_table_exists().
Free the table.
| table | pointer to dbTable |
Definition at line 68 of file dbmi_base/table.c.
References _db_table::columns, db_free(), db_free_column(), db_free_string(), _db_table::description, _db_table::numColumns, and _db_table::tableName.
Referenced by db_column_sqltype(), db_d_create_table(), db_d_describe_table(), db_free_cursor(), db_get_column(), and Vect_write_ascii().
Get column structure by table and column name.
Column is set to new dbColumn structure or NULL if column was not found
| Driver | DB driver | |
| tname | table name | |
| cname | column name | |
| [out] | Column | column structure to store within |
Definition at line 124 of file dbmi_client/column.c.
References _, db_copy_column(), db_describe_table(), DB_FAILED, db_free_table(), db_get_column_name(), db_get_table_column(), db_get_table_number_of_columns(), db_init_string(), DB_OK, db_set_string(), G_debug(), G_strcasecmp(), G_warning(), and NULL.
Referenced by Vect_net_build_graph(), and Vect_net_ttb_build_graph().
Returns column default value for given column structure.
| column | pointer to dbColumn |
Definition at line 39 of file dbmi_base/column.c.
Referenced by db__recv_column_default_value(), db__send_column_default_value(), db_convert_column_default_value_to_string(), and db_convert_Cstring_to_column_default_value().
Returns column description for given column.
| column | pointer to dbColumn |
Definition at line 444 of file dbmi_base/column.c.
References db_get_string().
Referenced by db_print_column_definition().
Get column host type.
| column | pointer to dbColumn |
Definition at line 154 of file dbmi_base/column.c.
Get column's length.
| column | pointer to dbColumn |
Definition at line 303 of file dbmi_base/column.c.
Referenced by db_print_column_definition(), and db_table_to_sql().
Returns column name for given column.
| column | pointer to dbColumn |
Definition at line 418 of file dbmi_base/column.c.
References db_get_string().
Referenced by db_column_sqltype(), db_get_column(), db_print_column_definition(), db_table_to_sql(), Vect_get_column_names(), Vect_get_column_names_types(), and Vect_write_ascii().
Get column precision.
| column | pointer to dbColumn |
Definition at line 117 of file dbmi_base/column.c.
Referenced by db_print_column_definition().
Get column scale.
| column | pointer to dbColumn |
Definition at line 94 of file dbmi_base/column.c.
Referenced by db_print_column_definition().
Get select privileges.
| column | pointer to dbColumn |
Definition at line 346 of file dbmi_base/column.c.
Referenced by db_get_table_select_priv(), and db_print_column_definition().
Returns column sqltype for column.
The function db_sqltype_name() returns sqltype description.
| column | pointer to dbColumn |
Definition at line 142 of file dbmi_base/column.c.
Referenced by db__recv_column_default_value(), db__recv_column_value(), db__send_column_default_value(), db__send_column_value(), db_column_sqltype(), db_convert_column_default_value_to_string(), db_convert_column_value_to_string(), db_convert_Cstring_to_column_default_value(), db_convert_Cstring_to_column_value(), db_print_column_definition(), db_select_CatValArray(), db_select_int(), db_table_to_sql(), P_Aux_to_Vector(), Vect_get_column_names_types(), Vect_get_column_types(), Vect_net_build_graph(), and Vect_net_ttb_build_graph().
Get update privileges.
| column | pointer to dbColumn |
Definition at line 378 of file dbmi_base/column.c.
Referenced by db_get_table_update_priv(), and db_print_column_definition().
Returns column value for given column structure.
| column | pointer to dbColumn |
Definition at line 27 of file dbmi_base/column.c.
Referenced by db__recv_column_value(), db__send_column_value(), db_convert_column_value_to_string(), db_convert_Cstring_to_column_value(), db_select_CatValArray(), db_select_int(), db_select_value(), NetA_init_distinct(), NetA_init_timetable_from_db(), P_Aux_to_Vector(), and Vect_write_ascii().
| int db_get_connection | ( | dbConnection * | connection | ) |
Get default DB connection settings for the current mapset.
| [out] | connection | pointer to dbConnection to be modified |
Definition at line 73 of file db/dbmi_base/connect.c.
References DB_FAILED, db_get_login(), DB_OK, G_getenv_nofatal2(), G_VAR_MAPSET, G_zero(), and NULL.
Referenced by db_start_driver(), V1_close_nat(), and Vect_default_field_info().
Get number of columns.
| cursor | pointer to dbCursor |
Definition at line 393 of file cursor.c.
References db_get_cursor_table(), and db_get_table_number_of_columns().
Referenced by db_alloc_cursor_column_flags(), db_bind_update(), and db_test_cursor_any_column_flag().
Get table allocated by cursor.
| cursor | pointer to dbCursor |
Definition at line 67 of file cursor.c.
Referenced by db_get_cursor_number_of_columns(), db_open_insert_cursor(), db_select_CatValArray(), db_select_int(), db_select_value(), NetA_init_distinct(), NetA_init_timetable_from_db(), P_Aux_to_Vector(), and Vect_write_ascii().
Get database name from current DB connection settings.
Definition at line 43 of file db/dbmi_base/default_name.c.
References G_getenv_nofatal2(), G_store(), G_VAR_MAPSET, and NULL.
Get driver name from current DB connection settings.
Definition at line 27 of file db/dbmi_base/default_name.c.
References G_getenv_nofatal2(), G_store(), G_VAR_MAPSET, and NULL.
Get group name from current DB connection settings.
Definition at line 75 of file db/dbmi_base/default_name.c.
References G_getenv_nofatal2(), G_store(), G_VAR_MAPSET, and NULL.
Get schema name from current DB connection settings.
Definition at line 59 of file db/dbmi_base/default_name.c.
References G_getenv_nofatal2(), G_store(), G_VAR_MAPSET, and NULL.
Get error code.
Definition at line 125 of file db/dbmi_base/error.c.
References DB_OK.
Referenced by db__recv_index(), db__recv_index_array(), db__recv_table_definition(), db_alloc_cursor_column_flags(), db_alloc_cursor_table(), db_alloc_index_columns(), db_d_open_insert_cursor(), db_d_open_select_cursor(), db_d_open_update_cursor(), and db_set_index_column_name().
Get error message.
Definition at line 237 of file db/dbmi_base/error.c.
References NULL.
Referenced by db__send_failure().
brief Get 'who' string
Definition at line 59 of file db/dbmi_base/error.c.
Get handle database name.
| handle | pointer to dbHandle |
Definition at line 57 of file handle.c.
References db_get_string(), and _db_handle::dbName.
Referenced by db_d_open_database(), and db_find_database().
Get handle schema name.
| handle | pointer to dbHandle |
Definition at line 69 of file handle.c.
References db_get_string(), and _db_handle::dbSchema.
Referenced by db_d_open_database(), and db_find_database().
Get column number.
| index | pointer to dbIndex |
| column_num | column number |
Definition at line 194 of file db/dbmi_base/index.c.
References _, _db_index::columnNames, db_error(), db_get_string(), NULL, and _db_index::numColumns.
Referenced by db_print_index().
Get index name.
| index | pointer to dbIndex |
Definition at line 124 of file db/dbmi_base/index.c.
References db_get_string(), and _db_index::indexName.
Referenced by db_print_index().
Get number of columns.
| index | pointer to dbIndex |
Definition at line 162 of file db/dbmi_base/index.c.
References _db_index::numColumns.
Referenced by db_print_index().
Get table name.
| index | pointer to dbIndex |
Definition at line 150 of file db/dbmi_base/index.c.
References db_get_string(), and _db_index::tableName.
Referenced by db_print_index().
| int db_get_login | ( | const char * | driver, |
| const char * | database, | ||
| const char ** | user, | ||
| const char ** | password, | ||
| const char ** | host, | ||
| const char ** | port | ||
| ) |
Get login parameters for driver/database.
If driver/database is not found, output arguments are set to NULL.
| driver | driver name | |
| database | database name (can be NULL) | |
| [out] | user | name |
| [out] | password | string |
| [out] | host | name |
| [out] | port |
Definition at line 382 of file login.c.
Referenced by db_get_connection(), and db_get_login2().
| int db_get_login2 | ( | const char * | driver, |
| const char * | database, | ||
| const char ** | user, | ||
| const char ** | password, | ||
| const char ** | host, | ||
| const char ** | port | ||
| ) |
Get login parameters for driver/database.
If driver/database is not found, output arguments are set to NULL.
| driver | driver name | |
| database | database name (can be NULL) | |
| [out] | user | name |
| [out] | password | string |
| [out] | host | name |
| [out] | port |
Definition at line 361 of file login.c.
References db_get_login().
Get number of selected rows.
| cursor | db select cursor |
Definition at line 26 of file c_rows.c.
References db__set_protocol_fds(), DB_OK, DB_PROC_ROWS, DB_RECV_INT, DB_RECV_RETURN_CODE, DB_SEND_TOKEN, and DB_START_PROCEDURE_CALL.
Referenced by db_get_table_number_of_rows(), and db_select_CatValArray().
Get string.
| x | pointer to dbString |
Definition at line 140 of file string.c.
References x.
Referenced by db__recv_return_code(), db__recv_string(), db__send_string(), db_append_string(), db_copy_string(), db_d_describe_table(), db_d_report_error(), db_delete_table(), db_double_quote_string(), db_get_column_description(), db_get_column_name(), db_get_handle_dbname(), db_get_handle_dbschema(), db_get_index_column_name(), db_get_index_name(), db_get_index_table_name(), db_get_table_column_by_name(), db_get_table_description(), db_get_table_name(), db_get_table_number_of_rows(), db_get_value_string(), db_list_drivers(), db_print_column_definition(), db_select_CatValArray(), db_table_exists(), db_table_to_sql(), db_zero_string(), IL_write_point_2d(), NetA_init_distinct(), and NetA_init_timetable_from_db().
Returns column structure for given table and column number.
| table | pointer to dbTable |
| idx | column index (starting with '0') |
Definition at line 309 of file dbmi_base/table.c.
References _db_table::columns, NULL, and _db_table::numColumns.
Referenced by db__recv_table_data(), db__send_table_data(), db_column_sqltype(), db_get_column(), db_get_table_column_by_name(), db_print_table_definition(), db_select_CatValArray(), db_select_int(), db_select_value(), db_table_to_sql(), NetA_init_distinct(), NetA_init_timetable_from_db(), P_Aux_to_Vector(), P_Create_Aux2_Table(), P_Create_Aux4_Table(), Vect_get_column_names(), Vect_get_column_names_types(), Vect_get_column_types(), and Vect_write_ascii().
Returns column structure for given table and column name.
| table | pointer to dbTable |
| name | the name of the column |
Definition at line 325 of file dbmi_base/table.c.
References _db_column::columnName, columns, db_get_string(), db_get_table_column(), name, NULL, and _db_table::numColumns.
Get table delete privileges.
| table | pointer to dbTable |
Definition at line 295 of file dbmi_base/table.c.
References _db_table::priv_delete.
Referenced by db_print_table_definition().
Get the description of the table.
| table | pointer to dbTable |
Definition at line 126 of file dbmi_base/table.c.
References db_get_string(), and _db_table::description.
Referenced by db_print_table_definition().
Get table insert privileges.
| table | pointer to dbTable |
Definition at line 263 of file dbmi_base/table.c.
References _db_table::priv_insert.
Referenced by db_print_table_definition().
Get the name of the table.
| table | pointer to dbTable |
Definition at line 101 of file dbmi_base/table.c.
References db_get_string(), and _db_table::tableName.
Referenced by db_print_table_definition(), and db_table_to_sql().
Return the number of columns of the table.
| table | pointer to dbTable |
Definition at line 138 of file dbmi_base/table.c.
References _db_table::numColumns.
Referenced by db_clone_table(), db_column_sqltype(), db_get_column(), db_get_cursor_number_of_columns(), db_print_table_definition(), db_table_to_sql(), Vect_get_column_names(), Vect_get_column_names_types(), Vect_get_column_types(), and Vect_write_ascii().
Get number of rows of table.
| driver | db driver |
| sql | SQL statement |
Definition at line 111 of file dbmi_client/table.c.
References _, db_close_cursor(), db_close_database_shutdown_driver(), db_get_num_rows(), db_get_string(), DB_OK, db_open_select_cursor(), DB_SEQUENTIAL, and G_warning().
Get table select privileges.
| table | pointer to dbTable |
Definition at line 199 of file dbmi_base/table.c.
References db_get_column_select_priv().
Get table update privileges.
| table | pointer to dbTable |
Definition at line 231 of file dbmi_base/table.c.
References db_get_column_update_priv().
Get value as double.
For given value and C type of value returns double representation.
| value | pointer to dbValue |
| ctype | C data type |
Definition at line 65 of file value.c.
References DB_C_TYPE_DOUBLE, DB_C_TYPE_INT, DB_C_TYPE_STRING, db_get_value_double(), db_get_value_int(), and db_get_value_string().
Get day value.
| value | pointer to dbValue |
Definition at line 128 of file value.c.
References _db_date_time::day, and _db_value::t.
Referenced by db_convert_value_datetime_into_string().
Get double precision value.
| value | pointer to dbValue |
Definition at line 50 of file value.c.
References _db_value::d.
Referenced by db_convert_value_to_string(), db_get_value_as_double(), db_select_CatValArray(), db_select_int(), P_Aux_to_Vector(), and Vect_write_ascii().
Get hour value.
| value | pointer to dbValue |
Definition at line 140 of file value.c.
References _db_date_time::hour, and _db_value::t.
Referenced by db_convert_value_datetime_into_string().
Get integer value.
| value | pointer to dbValue |
Definition at line 38 of file value.c.
References _db_value::i.
Referenced by db_convert_value_to_string(), db_get_value_as_double(), db_select_CatValArray(), db_select_int(), Gp_load_sites_thematic(), Gv_load_vect_thematic(), NetA_init_distinct(), NetA_init_timetable_from_db(), and Vect_write_ascii().
Get minute value.
| value | pointer to dbValue |
Definition at line 152 of file value.c.
References _db_date_time::minute, and _db_value::t.
Referenced by db_convert_value_datetime_into_string().
Get month value.
| value | pointer to dbValue |
Definition at line 116 of file value.c.
References _db_date_time::month, and _db_value::t.
Referenced by db_convert_value_datetime_into_string().
Get seconds value.
| value | pointer to dbValue |
Definition at line 164 of file value.c.
References _db_date_time::seconds, and _db_value::t.
Referenced by db_convert_value_datetime_into_string().
Get string value.
| value | pointer to dbValue |
Definition at line 92 of file value.c.
References db_get_string(), and _db_value::s.
Referenced by db_convert_value_to_string(), db_get_value_as_double(), db_select_CatValArray(), db_select_int(), Gp_load_sites_thematic(), Gv_load_vect_thematic(), and Vect_write_ascii().
Get year value.
| value | pointer to dbValue |
Definition at line 104 of file value.c.
References _db_value::t, and _db_date_time::year.
Referenced by db_convert_value_datetime_into_string().
Grant privileges on table.
| driver | db driver |
| tableName | table name |
| priv | privileges DB_PRIV_SELECT |
| to | grant to DB_GROUP | DB_PUBLIC |
Definition at line 29 of file c_priv.c.
References db__set_protocol_fds(), db_free_string(), db_init_string(), DB_OK, DB_PROC_GRANT_ON_TABLE, DB_RECV_RETURN_CODE, DB_SEND_INT, DB_SEND_STRING, db_set_string(), DB_START_PROCEDURE_CALL, and name.
Referenced by Vect_copy_table_by_cats().
Get version info.
Note: renamed from db_version to db_gversion to avoid name conflict with Berkeley DB etc.
| driver | db driver | |
| [out] | client_version | client version |
| [out] | driver_version | driver version |
Definition at line 31 of file c_version.c.
References db__set_protocol_fds(), db_init_string(), DB_OK, DB_PROC_VERSION, DB_RECV_RETURN_CODE, DB_RECV_STRING, db_set_string(), DB_START_PROCEDURE_CALL, and DB_VERSION.
Initialize dbColumn.
| column | pointer to dbColumn to be initialized |
Definition at line 388 of file dbmi_base/column.c.
References db_init_string(), and db_zero().
Referenced by db_alloc_table(), db_copy_column(), and db_d_add_column().
Initialize dbCursor.
| cursor | pointer to dbCursor to be initialized |
Definition at line 23 of file cursor.c.
References G_zero().
Referenced by db_d_open_insert_cursor(), db_d_open_select_cursor(), db_d_open_update_cursor(), db_free_cursor(), db_open_select_cursor(), and db_open_update_cursor().
Initialize handle (i.e database/schema)
| handle | pointer to dbHandle to be initialized |
Definition at line 23 of file handle.c.
References db_init_string(), _db_handle::dbName, and _db_handle::dbSchema.
Referenced by db_alloc_handle_array(), db_d_create_database(), db_d_delete_database(), db_d_find_database(), db_d_open_database(), db_start_driver_open_database(), IL_vector_input_data_2d(), Vect_get_column_names(), Vect_get_column_names_types(), Vect_get_column_types(), Vect_net_build_graph(), Vect_net_ttb_build_graph(), and Vect_write_ascii().
Initialize dbIndex.
| index | pointer to dbIndex to be initialized |
Definition at line 25 of file db/dbmi_base/index.c.
References _db_index::columnNames, db_init_string(), _db_index::indexName, NULL, _db_index::numColumns, _db_index::tableName, and _db_index::unique.
Referenced by db__recv_index(), db_alloc_index_array(), db_create_index2(), db_d_create_index(), and db_free_index().
Initialize dbString.
| [out] | x | pointer to dbString |
Definition at line 25 of file string.c.
Referenced by db__recv_return_code(), db__send_Cstring(), db_alloc_dirent_array(), db_alloc_string_array(), db_column_sqltype(), db_d_add_column(), db_d_describe_table(), db_d_drop_column(), db_d_drop_index(), db_d_drop_table(), db_d_execute_immediate(), db_d_grant_on_table(), db_d_init_error(), db_d_list_indexes(), db_d_open_select_cursor(), db_d_open_update_cursor(), db_delete_table(), db_double_quote_string(), db_free_string(), db_get_column(), db_grant_on_table(), db_gversion(), db_init_column(), db_init_handle(), db_init_index(), db_init_table(), db_list_drivers(), db_print_column_definition(), db_select_CatValArray(), db_select_int(), db_select_value(), IL_vector_input_data_2d(), NetA_init_timetable_from_db(), P_Aux_to_Vector(), P_Drop_Aux_Table(), P_Sparse_Points(), V1_close_nat(), Vect_get_column_names(), Vect_get_column_names_types(), Vect_get_column_types(), Vect_net_build_graph(), Vect_net_ttb_build_graph(), and Vect_write_ascii().
Initialize the table to zero.
| table | pointer to dbTable |
Definition at line 56 of file dbmi_base/table.c.
References db_init_string(), db_zero(), _db_table::description, and _db_table::tableName.
Referenced by db_alloc_table().
Insert new record into table.
| cursor | db cursor |
Definition at line 26 of file c_insert.c.
References db__set_protocol_fds(), DB_OK, DB_PROC_INSERT, DB_RECV_RETURN_CODE, DB_SEND_TABLE_DATA, DB_SEND_TOKEN, and DB_START_PROCEDURE_CALL.
Define range based on SQL data type.
| sqltype | SQL data type | |
| [out] | from | |
| [out] | to |
Definition at line 24 of file interval.c.
References DB_DAY, DB_FRACTION, DB_HOUR, DB_MINUTE, DB_MONTH, DB_SECOND, DB_SQL_TYPE_DATE, DB_SQL_TYPE_TIME, and DB_YEAR.
Referenced by db_convert_Cstring_to_value_datetime(), db_convert_value_datetime_into_string(), and db_sqltype_name().
Test if path is a directory.
| path | pathname |
Definition at line 29 of file isdir.c.
References AMI_STREAM< T >::AMI_STREAM(), DB_FAILED, DB_OK, S_ISDIR, and x.
Referenced by db_dirent().
Check if output is legal table name.
Rule: [A-Za-z][A-Za-z0-9_@]*
| s | table name to be checked |
Definition at line 31 of file legal_dbname.c.
References _, DB_FAILED, DB_OK, G_warning(), and GNAME_MAX.
| int db_list_databases | ( | dbDriver * | driver, |
| dbString * | path, | ||
| int | npaths, | ||
| dbHandle ** | handles, | ||
| int * | count | ||
| ) |
List databases.
| driver | db driver | |
| path | db path | |
| npaths | number of given paths | |
| [out] | handles | handle infos |
| [out] | count | number of handle infos |
Definition at line 30 of file c_listdb.c.
References count, db__set_protocol_fds(), db_alloc_handle_array(), DB_OK, DB_PROC_LIST_DATABASES, DB_RECV_HANDLE, DB_RECV_INT, DB_RECV_RETURN_CODE, DB_SEND_STRING_ARRAY, and DB_START_PROCEDURE_CALL.
Return comma separated list of existing DB drivers, used for driver parameter options.
Definition at line 23 of file c_list_drivers.c.
References db_append_string(), db_free_dbmscap(), db_get_string(), db_init_string(), db_read_dbmscap(), _dbmscap::driverName, _dbmscap::next, and NULL.
List indexes.
| driver | db driver | |
| table_name | table name | |
| [out] | list | list of db indexes |
| [out] | count | number of items in the list |
Definition at line 29 of file c_list_idx.c.
References count, db__set_protocol_fds(), DB_OK, DB_PROC_LIST_INDEXES, DB_RECV_INDEX_ARRAY, DB_RECV_RETURN_CODE, DB_SEND_STRING, and DB_START_PROCEDURE_CALL.
List available tables for given connection.
| driver | db driver | |
| [out] | names | list of table names |
| [out] | count | number of items in the list |
| system | ? |
Definition at line 39 of file c_list_tabs.c.
References count, db__set_protocol_fds(), DB_OK, DB_PROC_LIST_TABLES, DB_RECV_RETURN_CODE, DB_RECV_STRING_ARRAY, DB_SEND_INT, and DB_START_PROCEDURE_CALL.
Referenced by db_table_exists().
Allocate memory.
On failure is called db_memory_error().
| n | number of bytes to be allocated |
Definition at line 47 of file db/dbmi_base/alloc.c.
References db_memory_error(), malloc(), and NULL.
Referenced by db_alloc_table(), db_d_open_insert_cursor(), db_d_open_select_cursor(), db_d_open_update_cursor(), db_dirent(), db_start_driver(), and db_store().
Report memory error.
Definition at line 133 of file db/dbmi_base/error.c.
References _, db_error(), and DB_MEMORY_ERR.
Referenced by db_calloc(), db_malloc(), and db_realloc().
Add new token.
| address | dbAddress of token to be added |
Definition at line 55 of file db/dbmi_base/token.c.
References db_realloc(), NONE, and NULL.
Referenced by db_d_open_insert_cursor(), db_d_open_select_cursor(), and db_d_open_update_cursor().
Compare strings case-insensitive.
| a,b | string buffers to be compared |
Definition at line 69 of file case.c.
References b, db_char_to_uppercase(), and t.
Referenced by db_convert_Cstring_to_value_datetime().
Report no procedure error.
| procnum | procedure number |
Definition at line 158 of file db/dbmi_base/error.c.
References _, db_error(), DB_NOPROC, and procnum.
Referenced by db__start_procedure_call().
Open database connection.
| driver | db driver |
| handle | handle info (database and schema name) |
Definition at line 27 of file c_opendb.c.
References db__set_protocol_fds(), DB_OK, DB_PROC_OPEN_DATABASE, DB_RECV_RETURN_CODE, DB_SEND_HANDLE, and DB_START_PROCEDURE_CALL.
Referenced by db_start_driver_open_database(), IL_vector_input_data_2d(), Vect_get_column_names(), Vect_get_column_names_types(), Vect_get_column_types(), and Vect_write_ascii().
Open insert cursor.
| driver | db driver |
| cursor | cursor to be opened |
Definition at line 27 of file c_openinsert.c.
References db__set_protocol_fds(), db_get_cursor_table(), DB_OK, DB_PROC_OPEN_INSERT_CURSOR, DB_RECV_INT, DB_RECV_RETURN_CODE, DB_RECV_TOKEN, DB_SEND_TABLE_DEFINITION, and DB_START_PROCEDURE_CALL.
Open select cursor.
Open modes:
Data can be fetched by db_fetch().
Cursor should be closed by db_close_cursor().
| driver | pointer to dbDriver |
| select | SQL select statement (pointer to dbString) |
| cursor | pointer to dbCursor to be opened |
| mode | open mode |
Definition at line 37 of file c_openselect.c.
References db__set_protocol_fds(), db_init_cursor(), DB_OK, DB_PROC_OPEN_SELECT_CURSOR, DB_RECV_INT, DB_RECV_RETURN_CODE, DB_RECV_TABLE_DEFINITION, DB_RECV_TOKEN, DB_SEND_INT, DB_SEND_STRING, and DB_START_PROCEDURE_CALL.
Referenced by db_get_table_number_of_rows(), db_select_CatValArray(), db_select_int(), db_select_value(), NetA_init_distinct(), NetA_init_timetable_from_db(), P_Aux_to_Vector(), and Vect_write_ascii().
| int db_open_update_cursor | ( | dbDriver * | driver, |
| dbString * | table_name, | ||
| dbString * | select, | ||
| dbCursor * | cursor, | ||
| int | mode | ||
| ) |
Open update cursor.
| driver | db driver |
| table_name | table name |
| select | SQL update statement (?) |
| cursor | db cursor to be opened |
| mode | open mode (?) |
Definition at line 30 of file c_openupdate.c.
References db__set_protocol_fds(), db_alloc_cursor_column_flags(), db_init_cursor(), DB_OK, DB_PROC_OPEN_UPDATE_CURSOR, DB_RECV_INT, DB_RECV_RETURN_CODE, DB_RECV_TABLE_DEFINITION, DB_RECV_TOKEN, DB_SEND_INT, DB_SEND_STRING, and DB_START_PROCEDURE_CALL.
Print column definition info.
| fd | file descriptor |
| column | column info |
Definition at line 51 of file printtab.c.
References db_convert_column_default_value_to_string(), db_get_column_description(), db_get_column_length(), db_get_column_name(), db_get_column_precision(), db_get_column_scale(), db_get_column_select_priv(), db_get_column_sqltype(), db_get_column_update_priv(), db_get_string(), db_init_string(), db_sqltype_name(), db_test_column_has_default_value(), and db_test_column_null_allowed().
Referenced by db_print_table_definition().
Print error.
If not defined, the error message is printed to stderr.
Definition at line 182 of file db/dbmi_base/error.c.
Referenced by db_error().
Report index.
| fd | file where to print index info |
| index | pointer to dbIndex |
Definition at line 254 of file db/dbmi_base/index.c.
References db_get_index_column_name(), db_get_index_name(), db_get_index_number_of_columns(), db_get_index_table_name(), and db_test_index_type_unique().
Print table definition info.
| fd | file descriptor |
| table | table info |
Definition at line 26 of file printtab.c.
References db_get_table_column(), db_get_table_delete_priv(), db_get_table_description(), db_get_table_insert_priv(), db_get_table_name(), db_get_table_number_of_columns(), and db_print_column_definition().
Report 'not implemented' error.
| name | name of functionality |
Definition at line 144 of file db/dbmi_base/error.c.
References _, db_error(), DB_NOPROC, and name.
Referenced by db__driver_add_column(), db__driver_bind_update(), db__driver_close_cursor(), db__driver_close_database(), db__driver_create_database(), db__driver_create_table(), db__driver_delete(), db__driver_delete_database(), db__driver_describe_table(), db__driver_drop_column(), db__driver_drop_index(), db__driver_drop_table(), db__driver_execute_immediate(), db__driver_fetch(), db__driver_find_database(), db__driver_get_num_rows(), db__driver_insert(), db__driver_list_databases(), db__driver_list_indexes(), db__driver_list_tables(), db__driver_open_database(), db__driver_open_insert_cursor(), db__driver_open_select_cursor(), db__driver_open_update_cursor(), and db__driver_update().
Report protocol error.
Definition at line 85 of file db/dbmi_base/error.c.
References _, db_error(), and DB_PROTOCOL_ERR.
Referenced by db__recv_char(), db__recv_double(), db__recv_double_array(), db__recv_float(), db__recv_float_array(), db__recv_int(), db__recv_int_array(), db__recv_return_code(), db__recv_short(), db__recv_short_array(), db__recv_string(), db__recv_string_array(), db__send_char(), db__send_double(), db__send_double_array(), db__send_float(), db__send_float_array(), db__send_int(), db__send_int_array(), db__send_short(), db__send_short_array(), db__send_string(), and db__start_procedure_call().
Read dbmscap.
dbmscap file was used in grass5.0 but it is not used in grass5.7 until we find it necessary. All code for dbmscap file is commented here.
Instead of in dbmscap file db_read_dbmscap() searches for available dbmi drivers in /driver/db/
Definition at line 98 of file dbmscap.c.
References closedir(), db_dbmscap_filename(), db_syserror(), file, G_asprintf(), G_convert_dirseps_to_host(), G_debug(), G_free(), G_gisbase(), G_malloc, G_str_replace(), name, NULL, opendir(), and readdir().
Referenced by db_list_drivers(), and db_start_driver().
Reallocate memory.
On failure is called db_memory_error().
| s | pointer to memory |
| n | number of newly allocated bytes |
Definition at line 93 of file db/dbmi_base/alloc.c.
References db_memory_error(), malloc(), and NULL.
Referenced by db__add_cursor_to_driver_state(), db_append_table_column(), db_enlarge_string(), and db_new_token().
| 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 | |
| where | where statement | |
| [out] | cvarr | dbCatValArray to store within |
Definition at line 273 of file db/dbmi_client/select.c.
References _, db_append_string(), DB_C_TYPE_DATETIME, DB_C_TYPE_DOUBLE, DB_C_TYPE_INT, DB_C_TYPE_STRING, db_CatValArray_alloc(), db_CatValArray_sort(), db_close_cursor(), db_fetch(), db_free_string(), db_get_column_sqltype(), db_get_column_value(), db_get_cursor_table(), db_get_num_rows(), db_get_string(), db_get_table_column(), db_get_value_double(), db_get_value_int(), db_get_value_string(), db_init_string(), DB_NEXT, DB_OK, db_open_select_cursor(), DB_SEQUENTIAL, db_set_string(), db_sqltype_to_Ctype(), G_asprintf(), G_debug(), G_free(), G_warning(), _db_value::isNull, malloc(), NULL, and _db_value::t.
Referenced by IL_vector_input_data_2d(), NetA_get_node_costs(), Vect_net_build_graph(), and Vect_net_ttb_build_graph().
| 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.
References _, count, DB_C_TYPE_DOUBLE, DB_C_TYPE_INT, DB_C_TYPE_STRING, db_close_cursor(), db_fetch(), db_free_string(), db_get_column_sqltype(), db_get_column_value(), db_get_cursor_table(), db_get_table_column(), db_get_value_double(), db_get_value_int(), db_get_value_string(), db_init_string(), DB_NEXT, DB_OK, db_open_select_cursor(), DB_SEQUENTIAL, db_set_string(), db_sqltype_to_Ctype(), G_asprintf(), G_debug(), G_free(), G_malloc, G_realloc, G_warning(), and NULL.
Referenced by Vect_cats_set_constraint(), Vect_set_varray_from_db(), and Vect_write_ascii().
| 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 207 of file db/dbmi_client/select.c.
References _, count, db_close_cursor(), db_copy_value(), db_fetch(), db_free_string(), db_get_column_value(), db_get_cursor_table(), db_get_table_column(), db_init_string(), DB_NEXT, DB_OK, db_open_select_cursor(), DB_SEQUENTIAL, db_set_string(), G_asprintf(), G_free(), G_warning(), G_zero(), and NULL.
Referenced by Gp_load_sites_thematic(), Gv_load_vect_thematic(), and Vect_write_ascii().
Set column description.
| column | pointer to dbColumn |
| description | column's description |
Definition at line 432 of file dbmi_base/column.c.
References db_set_string().
Set default value identificator.
| column | pointer to dbColumn |
Definition at line 164 of file dbmi_base/column.c.
Unset default value identificator.
| column | pointer to dbColumn |
Definition at line 176 of file dbmi_base/column.c.
Set column host data type.
| column | pointer to dbColumn |
| type | data type |
Definition at line 82 of file dbmi_base/column.c.
Set column's length.
| column | pointer to dbColumn |
| length | value |
Definition at line 314 of file dbmi_base/column.c.
Set column name.
| column | pointer to dbColumn |
| name | column name |
Definition at line 406 of file dbmi_base/column.c.
References db_set_string(), and name.
Referenced by P_Create_Aux2_Table(), and P_Create_Aux4_Table().
Set null value to be allowed.
| column | pointer to dbColumn |
Definition at line 268 of file dbmi_base/column.c.
Set column precision.
| column | pointer to dbColumn |
| precision | value |
Definition at line 128 of file dbmi_base/column.c.
Set column scale.
| column | pointer to dbColumn |
| scale | column scale value |
Definition at line 105 of file dbmi_base/column.c.
Set select privileges to be granted.
| column | pointer to dbColumn |
Definition at line 324 of file dbmi_base/column.c.
References DB_GRANTED.
Referenced by db_set_table_select_priv_granted().
Unset select privileges.
| column | pointer to dbColumn |
Definition at line 334 of file dbmi_base/column.c.
References DB_NOT_GRANTED.
Referenced by db_set_table_select_priv_not_granted().
Define column sqltype for column.
The function db_sqltype_name() returns sqltype description.
| column | pointer to dbColumn |
| sqltype | SQL data type (see list) |
Definition at line 71 of file dbmi_base/column.c.
Referenced by P_Create_Aux2_Table(), and P_Create_Aux4_Table().
Set update privileges to be granted.
| column | pointer to dbColumn |
Definition at line 356 of file dbmi_base/column.c.
References DB_GRANTED.
Referenced by db_set_table_update_priv_granted().
Unset update privileges.
| column | pointer to dbColumn |
Definition at line 366 of file dbmi_base/column.c.
References DB_NOT_GRANTED.
Referenced by db_set_table_update_priv_not_granted().
Set default value to be used.
| column | pointer to dbColumn |
Definition at line 235 of file dbmi_base/column.c.
| int db_set_connection | ( | dbConnection * | connection | ) |
Set default DB connection settings.
This function sets environmental variables as DB_DRIVER, DB_DATABASE, DB_SCHEMA, DB_GROUP.
| connection | pointer to dbConnection with default settings |
Definition at line 28 of file db/dbmi_base/connect.c.
References DB_OK, G_setenv2(), G_unsetenv2(), and G_VAR_MAPSET.
Referenced by db_set_default_connection().
Set column's flag.
| cursor | pointer to dbCursor |
| col | column index (starting with '0') |
Definition at line 356 of file cursor.c.
Referenced by db_set_cursor_column_for_update().
Set Column flag to 'update'.
| cursor | pointer to dbCursor |
| col | column index (starting with '0') |
Definition at line 307 of file cursor.c.
References db_set_cursor_column_flag().
Set 'intensive' cursor mode.
| cursor | pointer to dbCursor |
Definition at line 226 of file cursor.c.
References DB_INSENSITIVE.
Set table for given cursor.
| cursor | pointer to dbCursor |
| table | pointer to dbTable |
Definition at line 78 of file cursor.c.
Referenced by db_d_open_insert_cursor().
Set cursor to be writable (insert)
| cursor | pointer to dbCursor |
Definition at line 131 of file cursor.c.
References DB_INSERT.
Referenced by db_d_open_insert_cursor().
Set cursor to be read-only (select)
| cursor | pointer to dbCursor |
Definition at line 111 of file cursor.c.
References DB_READONLY.
Referenced by db_d_open_select_cursor().
Set cursor to be writable (update)
| cursor | pointer to dbCursor |
Definition at line 121 of file cursor.c.
References DB_UPDATE.
Referenced by db_d_open_update_cursor().
Sets up database connection settings using GRASS default from dbmi.h.
This function ignores current DB connection settings and uses GRASS default settings instead.
Definition at line 95 of file db/dbmi_base/default_name.c.
References _, DB_DEFAULT_DRIVER, DB_OK, db_set_connection(), G_debug(), G_fatal_error(), G_location_path(), G_make_mapset_object_group(), G_mapset(), G_zero(), and GPATH_MAX.
Referenced by Vect_default_field_info().
Define standard error handler for open database connection.
This handler:
Note: It's recommended to call this routine after db_start_driver_open_database().
| driver | DB driver |
Definition at line 38 of file db/dbmi_client/handler.c.
References G_add_error_handler().
Set 'who' for error messages.
| me | my name |
Definition at line 46 of file db/dbmi_base/error.c.
References db_free(), and db_store().
Set handle (database and schema name)
| handle | pointer to dbHandle |
| dbName | database name |
| dbSchema | schema name |
Definition at line 39 of file handle.c.
References DB_OK, db_set_string(), _db_handle::dbName, and _db_handle::dbSchema.
Referenced by db_find_database(), db_start_driver_open_database(), IL_vector_input_data_2d(), Vect_get_column_names(), Vect_get_column_names_types(), Vect_get_column_types(), and Vect_write_ascii().
Set column name.
| index | pointer to dbIndex |
| column_num | column number |
| name | name to be set |
Definition at line 177 of file db/dbmi_base/index.c.
References _, _db_index::columnNames, db_error(), db_get_error_code(), db_set_string(), name, and _db_index::numColumns.
Referenced by db_create_index2().
Set index name.
| index | pointer to dbIndex |
| name | name to be set |
Definition at line 112 of file db/dbmi_base/index.c.
References db_set_string(), _db_index::indexName, and name.
Referenced by db_create_index2().
Set table name.
| index | pointer to dbIndex |
| name | name to be set |
Definition at line 138 of file db/dbmi_base/index.c.
References db_set_string(), name, and _db_index::tableName.
Referenced by db_create_index2().
Set index type to non-unique.
| index | pointer to dbIndex |
Definition at line 228 of file db/dbmi_base/index.c.
References _db_index::unique.
Set index type to unique.
| index | pointer to dbIndex |
Definition at line 212 of file db/dbmi_base/index.c.
References _db_index::unique.
Referenced by db_create_index2().
| int db_set_login | ( | const char * | driver, |
| const char * | database, | ||
| const char * | user, | ||
| const char * | password, | ||
| const char * | host, | ||
| const char * | port, | ||
| int | overwrite | ||
| ) |
Set login parameters for driver/database.
| driver | driver name |
| database | database name |
| user | user name |
| password | password string |
| host | host name |
| port | |
| overwrite | TRUE to overwrite existing connections |
Definition at line 290 of file login.c.
Referenced by db_set_login2().
| int db_set_login2 | ( | const char * | driver, |
| const char * | database, | ||
| const char * | user, | ||
| const char * | password, | ||
| const char * | host, | ||
| const char * | port, | ||
| int | overwrite | ||
| ) |
Set login parameters for driver/database.
| driver | driver name |
| database | database name |
| user | user name |
| password | password string |
| host | host name |
| port | |
| overwrite | TRUE to overwrite existing connections |
Definition at line 268 of file login.c.
References db_set_login().
Inserts string to dbString (enlarge string)
| [in,out] | x | pointer to dbString |
| s | string to be inserted |
Definition at line 41 of file string.c.
References x.
Referenced by db_append_string(), db_column_sqltype(), db_convert_value_datetime_into_string(), db_convert_value_to_string(), db_copy_string(), db_delete_table(), db_dirent(), db_double_quote_string(), db_get_column(), db_grant_on_table(), db_gversion(), db_select_CatValArray(), db_select_int(), db_select_value(), db_set_column_description(), db_set_column_name(), db_set_handle(), db_set_index_column_name(), db_set_index_name(), db_set_index_table_name(), db_set_table_description(), db_set_table_name(), db_set_value_string(), db_table_to_sql(), NetA_init_timetable_from_db(), V1_close_nat(), Vect_get_column_names(), Vect_get_column_names_types(), Vect_get_column_types(), and Vect_write_ascii().
Inserts string to dbString (overwrite current value)
| [in,out] | x | pointer to dbString |
| s | string to be inserted |
Definition at line 55 of file string.c.
References x.
Referenced by db__send_Cstring().
Set a specific column for given table and column number.
| table | Pointer to dbTable |
| idx | Column index (starting with '0'). The index must be in range. |
| column | Pointer to a dbColumn to insert. A copy of the column stored, so the original column can be deleted. |
Definition at line 356 of file dbmi_base/table.c.
References _db_table::columns, db_copy_column(), DB_FAILED, DB_OK, and _db_table::numColumns.
Grant delete privileges for table.
| table | pointer to dbTable |
Definition at line 273 of file dbmi_base/table.c.
References DB_GRANTED, and _db_table::priv_delete.
Set delete privileges not granted for table.
| table | pointer to dbTable |
Definition at line 283 of file dbmi_base/table.c.
References DB_NOT_GRANTED, and _db_table::priv_delete.
Set the description of the table.
| table | pointer to dbTable |
| description | description of the table |
Definition at line 114 of file dbmi_base/table.c.
References db_set_string(), and _db_table::description.
Referenced by P_Create_Aux2_Table(), and P_Create_Aux4_Table().
Grant insert privileges for table.
| table | pointer to dbTable |
Definition at line 241 of file dbmi_base/table.c.
References DB_GRANTED, and _db_table::priv_insert.
Set insert privileges not granted for table.
| table | pointer to dbTable |
Definition at line 251 of file dbmi_base/table.c.
References DB_NOT_GRANTED, and _db_table::priv_insert.
Set the name of the table.
| table | pointer to dbTable |
| name | The name of the table |
Definition at line 89 of file dbmi_base/table.c.
References db_set_string(), name, and _db_table::tableName.
Referenced by db_d_describe_table(), P_Create_Aux2_Table(), and P_Create_Aux4_Table().
Grant selection privileges for all columns.
| table | pointer to dbTable |
Definition at line 177 of file dbmi_base/table.c.
References db_set_column_select_priv_granted().
Set selection privileges not granted for all columns.
| table | pointer to dbTable |
Definition at line 187 of file dbmi_base/table.c.
References db_set_column_select_priv_not_granted().
Grant update privileges for all columns.
| table | pointer to dbTable |
Definition at line 209 of file dbmi_base/table.c.
References db_set_column_update_priv_granted().
Set update privileges not granted for all columns.
| table | pointer to dbTable |
Definition at line 219 of file dbmi_base/table.c.
References db_set_column_update_priv_not_granted().
Set datetime to current.
| value | pointer to dbValue |
Definition at line 315 of file value.c.
References _db_date_time::current, db_set_value_not_null(), and _db_value::t.
Referenced by db_convert_Cstring_to_value_datetime().
Set value to non-current.
| value | pointer to dbValue |
Definition at line 326 of file value.c.
References _db_date_time::current, db_set_value_not_null(), and _db_value::t.
Referenced by db_set_value_day(), db_set_value_hour(), db_set_value_minute(), db_set_value_month(), db_set_value_seconds(), and db_set_value_year().
Set day value.
| value | pointer to dbValue |
| day | day value |
Definition at line 255 of file value.c.
References _db_date_time::day, db_set_value_datetime_not_current(), and _db_value::t.
Referenced by db_convert_Cstring_to_value_datetime().
Set double precision value.
| value | pointer to dbValue |
| d | double value |
Definition at line 207 of file value.c.
References _db_value::d, and db_set_value_not_null().
Referenced by db_convert_Cstring_to_value().
Set hour value.
| value | pointer to dbValue |
| hour | hour value |
Definition at line 267 of file value.c.
References db_set_value_datetime_not_current(), _db_date_time::hour, and _db_value::t.
Referenced by db_convert_Cstring_to_value_datetime().
Set integer value.
| value | pointer to dbValue |
| i | integer value |
Definition at line 195 of file value.c.
References db_set_value_not_null(), and _db_value::i.
Referenced by db_convert_Cstring_to_value().
Set minute value.
| value | pointer to dbValue |
| minute | minute value |
Definition at line 279 of file value.c.
References db_set_value_datetime_not_current(), _db_date_time::minute, and _db_value::t.
Referenced by db_convert_Cstring_to_value_datetime().
Set month value.
| value | pointer to dbValue |
| month | month value |
Definition at line 243 of file value.c.
References db_set_value_datetime_not_current(), _db_date_time::month, and _db_value::t.
Referenced by db_convert_Cstring_to_value_datetime().
Set value to not null.
| value | pointer to dbValue |
Definition at line 184 of file value.c.
References _db_value::isNull.
Referenced by db_set_value_datetime_current(), db_set_value_datetime_not_current(), db_set_value_double(), db_set_value_int(), and db_set_value_string().
Set value to null.
| value | pointer to dbValue |
Definition at line 174 of file value.c.
References _db_value::isNull.
Set seconds value.
| value | pointer to dbValue |
| seconds | seconds value |
Definition at line 291 of file value.c.
References db_set_value_datetime_not_current(), _db_date_time::seconds, and _db_value::t.
Referenced by db_convert_Cstring_to_value_datetime().
Set string value.
| value | pointer to dbValue |
| s | string value |
Definition at line 219 of file value.c.
References db_set_string(), db_set_value_not_null(), and _db_value::s.
Referenced by db_convert_Cstring_to_value().
Set year value.
| value | pointer to dbValue |
| year | year value |
Definition at line 231 of file value.c.
References db_set_value_datetime_not_current(), _db_value::t, and _db_date_time::year.
Referenced by db_convert_Cstring_to_value_datetime().
Closedown the driver, and free the driver structure.
Note: the management of the memory for the driver structure probably should be handled differently.
db_start_driver() could take a pointer to driver structure as an argument, instead of returning the pointer to allocated then there would be no hidden free required
| driver | pointer to dbDriver to be freed |
Definition at line 36 of file shutdown.c.
References db__set_protocol_fds(), db_free(), DB_PROC_SHUTDOWN_DRIVER, DB_START_PROCEDURE_CALL, db_unset_error_handler_driver(), G_wait(), and NULL.
Referenced by db_close_database_shutdown_driver(), db_start_driver_open_database(), IL_write_point_2d(), Vect_get_column_names(), Vect_get_column_names_types(), Vect_get_column_types(), and Vect_write_ascii().
Get SQL data type description.
| sqltype | SQL data type |
Definition at line 25 of file sqltype.c.
References DB_DATETIME_MASK, DB_DAY, DB_FRACTION, DB_HOUR, db_interval_range(), DB_MINUTE, DB_MONTH, DB_SECOND, DB_SQL_TYPE_CHARACTER, DB_SQL_TYPE_DATE, DB_SQL_TYPE_DECIMAL, DB_SQL_TYPE_DOUBLE_PRECISION, DB_SQL_TYPE_INTEGER, DB_SQL_TYPE_INTERVAL, DB_SQL_TYPE_NUMERIC, DB_SQL_TYPE_REAL, DB_SQL_TYPE_SERIAL, DB_SQL_TYPE_SMALLINT, DB_SQL_TYPE_TEXT, DB_SQL_TYPE_TIME, DB_SQL_TYPE_TIMESTAMP, DB_YEAR, and strcpy.
Referenced by db_print_column_definition(), db_table_to_sql(), Vect_get_column_names_types(), and Vect_get_column_types().
Get C data type based on given SQL data type.
| sqltype | SQL data type |
Definition at line 24 of file sqlCtype.c.
References DB_C_TYPE_DATETIME, DB_C_TYPE_DOUBLE, DB_C_TYPE_INT, DB_C_TYPE_STRING, DB_DATETIME_MASK, DB_SQL_TYPE_DATE, DB_SQL_TYPE_DOUBLE_PRECISION, DB_SQL_TYPE_INTEGER, DB_SQL_TYPE_INTERVAL, DB_SQL_TYPE_REAL, DB_SQL_TYPE_SERIAL, DB_SQL_TYPE_SMALLINT, DB_SQL_TYPE_TIME, and DB_SQL_TYPE_TIMESTAMP.
Referenced by db__recv_column_default_value(), db__recv_column_value(), db__send_column_default_value(), db__send_column_value(), db_column_Ctype(), db_convert_Cstring_to_value(), db_convert_value_to_string(), db_select_CatValArray(), db_select_int(), P_Aux_to_Vector(), Vect_net_build_graph(), and Vect_net_ttb_build_graph().
Initialize a new dbDriver for db transaction.
If name is NULL, the db name will be assigned connection.driverName.
| name | driver name |
Definition at line 51 of file start.c.
References close, db__recv_return_code(), db__set_protocol_fds(), db_copy_dbmscap_entry(), db_error(), db_free_dbmscap(), db_get_connection(), db_malloc(), DB_OK, db_read_dbmscap(), db_syserror(), _dbmscap::driverName, fdopen, G_debug(), G_get_gisrc_mode(), G_getenv_nofatal(), G_GISRC_MODE_FILE, G_GISRC_MODE_MEMORY, G_putenv(), G_spawn_ex(), name, _dbmscap::next, NULL, READ, SF_BACKGROUND, SF_CLOSE_DESCRIPTOR, SF_REDIRECT_DESCRIPTOR, and WRITE.
Referenced by db_start_driver_open_database(), IL_vector_input_data_2d(), Vect_get_column_names(), Vect_get_column_names_types(), Vect_get_column_types(), and Vect_write_ascii().
Open driver/database connection.
| drvname | driver name |
| dbname | database name |
Definition at line 28 of file db.c.
References _, db_init_handle(), DB_OK, db_open_database(), db_set_handle(), db_shutdown_driver(), db_start_driver(), G_debug(), G_warning(), and NULL.
Referenced by db_delete_table(), db_table_exists(), Gp_load_sites_thematic(), Gv_load_vect_thematic(), NetA_get_node_costs(), NetA_init_timetable_from_db(), V1_close_nat(), Vect_cats_set_constraint(), Vect_copy_table_by_cats(), Vect_net_build_graph(), Vect_net_ttb_build_graph(), Vect_rename(), and Vect_set_varray_from_db().
Make a copy of string buffer.
Allocated string buffer should be freed by db_free().
| s | source string buffer |
Definition at line 28 of file db/dbmi_base/alloc.c.
References db_malloc(), and strcpy.
Referenced by db__mark_database_open(), db_error(), and db_set_error_who().
Report system error.
| s | error message |
Definition at line 101 of file db/dbmi_base/error.c.
References db_error().
Referenced by db_dirent(), db_driver(), db_read_dbmscap(), and db_start_driver().
Check if table exists.
| drvname | driver name |
| dbname | database name |
| tabname | table name |
Definition at line 32 of file dbmi_client/table.c.
References _, count, db_close_database_shutdown_driver(), db_free_string_array(), db_get_string(), db_list_tables(), DB_OK, db_start_driver_open_database(), G_debug(), G_fatal_error(), G_strcasecmp(), G_strlcpy(), G_warning(), and NULL.
Referenced by Vect__delete().
Create SQL CREATE string from table definition.
| table | pointer to dbTable |
| sql | dbString to store the SQL CREATE string |
Definition at line 428 of file dbmi_base/table.c.
References db_append_string(), DB_FAILED, db_get_column_length(), db_get_column_name(), db_get_column_sqltype(), db_get_string(), db_get_table_column(), db_get_table_name(), db_get_table_number_of_columns(), DB_OK, db_set_string(), DB_SQL_TYPE_CHARACTER, DB_SQL_TYPE_DATE, DB_SQL_TYPE_DECIMAL, DB_SQL_TYPE_DOUBLE_PRECISION, DB_SQL_TYPE_INTEGER, DB_SQL_TYPE_INTERVAL, DB_SQL_TYPE_NUMERIC, DB_SQL_TYPE_REAL, DB_SQL_TYPE_SMALLINT, DB_SQL_TYPE_TEXT, DB_SQL_TYPE_TIME, DB_SQL_TYPE_TIMESTAMP, db_sqltype_name(), G_debug(), and G_warning().
Check if column has defined default value.
| column | pointer to dbColumn |
Definition at line 199 of file dbmi_base/column.c.
Referenced by db_print_column_definition().
Check if column has defined default value.
| column | pointer to dbColumn |
Definition at line 212 of file dbmi_base/column.c.
Check if column has defined default value.
| column | pointer to dbColumn |
Definition at line 225 of file dbmi_base/column.c.
Checks if null value is allowed.
| column | pointer to dbColumn |
Definition at line 291 of file dbmi_base/column.c.
Referenced by db_print_column_definition().
Checks if default value is used.
| column | pointer to dbColumn |
Definition at line 258 of file dbmi_base/column.c.
Checks columns' flag.
Is any cursor column flag set?
| cursor | pointer to dbCursor |
Definition at line 413 of file cursor.c.
References db_get_cursor_number_of_columns(), and db_test_cursor_column_flag().
Referenced by db_d_bind_update(), db_d_update(), and db_test_cursor_any_column_for_update().
Check if columns' flag is 'update'.
| cursor | pointer to dbCursor |
Definition at line 345 of file cursor.c.
References db_test_cursor_any_column_flag().
Checks column's flag.
| cursor | pointer to dbCursor |
| col | column index (starting with '0') |
Definition at line 383 of file cursor.c.
Referenced by db_test_cursor_any_column_flag(), and db_test_cursor_column_for_update().
Check if column flag is 'update'.
| cursor | pointer to dbCursor |
| col | column index (starting with '0') |
Definition at line 332 of file cursor.c.
References db_test_cursor_column_flag().
Check if cursor mode is 'intensive'.
| cursor | pointer to dbCursor |
Definition at line 262 of file cursor.c.
References DB_INSENSITIVE.
Check cursor type.
| cursor | pointer to dbCursor |
Definition at line 144 of file cursor.c.
References DB_INSERT, DB_READONLY, and DB_UPDATE.
Check if cursor type is 'insert'.
| cursor | pointer to dbCursor |
Definition at line 171 of file cursor.c.
References DB_INSERT.
Referenced by db_d_insert().
Check if cursor type is 'update'.
| cursor | pointer to dbCursor |
Definition at line 158 of file cursor.c.
References DB_UPDATE.
Referenced by db_d_bind_update(), db_d_delete(), and db_d_update().
Test if type is unique.
| index | pointer to dbIndex |
Definition at line 243 of file db/dbmi_base/index.c.
References _db_index::unique.
Referenced by db_print_index().
Check if datatime is current.
| value | pointer to dbValue |
Definition at line 305 of file value.c.
References _db_date_time::current, and _db_value::t.
Referenced by db_convert_value_datetime_into_string().
Check of value is null.
| value | pointer to dbValue |
Definition at line 26 of file value.c.
References _db_value::isNull.
Referenced by db_convert_value_to_string(), and Vect_write_ascii().
Unset default value identificator.
| column | pointer to dbColumn |
Definition at line 186 of file dbmi_base/column.c.
Unset null value to be allowed.
| column | pointer to dbColumn |
Definition at line 278 of file dbmi_base/column.c.
Unset default value to be used.
| column | pointer to dbColumn |
Definition at line 245 of file dbmi_base/column.c.
Unset column's flag.
| cursor | pointer to dbCursor |
| col | column index (starting with '0') |
Definition at line 368 of file cursor.c.
Referenced by db_alloc_cursor_column_flags(), and db_unset_cursor_column_for_update().
Unset 'update' column flag.
| cursor | pointer to dbCursor |
| col | column index (starting with '0') |
Definition at line 318 of file cursor.c.
References db_unset_cursor_column_flag().
Remove error handler before closing the driver.
| driver | DB driver |
Definition at line 48 of file db/dbmi_client/handler.c.
References G_remove_error_handler().
Referenced by db_shutdown_driver().
?
| cursor | db cursor |
Definition at line 26 of file c_update.c.
References db__set_protocol_fds(), DB_OK, DB_PROC_UPDATE, DB_RECV_RETURN_CODE, DB_SEND_TABLE_DATA, DB_SEND_TOKEN, and DB_START_PROCEDURE_CALL.
Who am i?
Check environmental variable LOGNAME
Definition at line 26 of file db/dbmi_base/whoami.c.
References G_store().
Zero allocated space.
| s | pointer to memory |
| n | number of bytes |
Definition at line 23 of file db/dbmi_base/zero.c.
Referenced by db__init_driver_state(), db_init_column(), db_init_table(), and db_zero_string().
Zero string.
| x | pointer to dbString |
Definition at line 79 of file string.c.
References db_get_string(), db_zero(), and x.
Referenced by IL_write_point_2d(), P_Aux_to_Vector(), and Vect_write_ascii().