|
|
| int db::Database::create_table |
( |
const NameChar * |
table_name, |
|
|
const FieldDescSet & |
fields, |
|
|
const IndexDescSet & |
indexes | |
|
) |
| | |
Create a new table named table_name.
The fields and indexes objects must be created and defined before using this function to create a new table.
- Parameters:
-
| table_name | The name of the new table. (required) |
| fields | A list of the fields that the table should have in it. (required) |
| indexes | A list of the indexes that the table should have. (required) |
- Returns:
- DB_NOERROR When successful.
- DB_EFIELD Invalid filed name. First character must be a letter.
- DB_EINVAL Caused by: table_name is null, fields is null, indexes is null.
- DB_ENAME table_name is not in a valid format. Valid name is letter(aA-zZ)+zero or more aplhanumeric characters. Underscore is considered a valid character.
- DB_ERECORDSIZE Record size too large for chosen page size.
- DB_ESTATE Database has not been opened.
- Note:
- Do not call this function while a transaction is active. If necessary, call tx_commit or tx_abort to finish the current transaction. This function is not atomic.
- See also:
- Table, Table::create, describe_table, update_table
|