Schema API for altering the schema. All the fuctions here are located in RDM DB Engine Library. Linker option: More...

Collaboration diagram for Update Functions:

Functions

RDM_RETCODE rdm_dbAlterCatalog (RDM_DB db, const RDM_TCHAR_T *ddlStmt)
Process a schema DDL command. More...

Detailed Description

Schema API for altering the schema. All the fuctions here are located in RDM DB Engine Library. Linker option:

    -lrdmrdm

Function Documentation

rdm_dbAlterCatalog()

RDM_RETCODE rdm_dbAlterCatalog ( RDM_DB db,
const RDM_TCHAR_T * ddlStmt
)

#include <rdmdbapi.h>

Process a schema DDL command.

This function processes a schema DDL (data definition language) command

The DDL commands allow for modifying the format and structure of a database. This function can be used to create a new database or to alter the structure of an existing database. The use of this function requires exclusive access to the schema. This can be gained by issuing a call to rdm_dbStartUpdate() with the schema (RDM_LOCK_SCHEMA) as one of the tables to write lock.

The changes made to the schema will be visible locally immediately, but will not be made available to other sessions until the transaction has been committed. If the transaction is aborted then the database structure will be unchanged.

Locking Requirements
Write lock on the schema (RDM_LOCK_SCHEMA)
Return values
sOKAY Normal, successful return.
eNOSTARTUPDATE An update operation was attempted when no rdm_dbStartUpdate() is active.
eNOTLOCKED Attempt to access a table for reading or update without proper locks.
eDDL_ALTERACT Invalid ALTER action spec.
eDDL_CONSTRNOTFOUND Constraint not found.
eDDL_DROPNOTNULL Cannot DROP NOT NULL: column is not defined as NOT NULL.
eDDL_DUPTABNAME Duplicate table name.
eDDL_NULLCONFLICT NOT NULL constraint specified for a column that has NULL values or a NULL default value.
eDDL_SYNTAX Syntax error.
eINVFORUNION Invalid operation on unioned db.
ePRECOMMITTED A precommitted transaction must be committed or rolled back before further operations on this database are allowed.
eREADONLY Database is read-only and cannot be updated.
See also
rdm_dbStartUpdate
rdm_dbSetCatalog
rdm_dbEnd
ddl_ug
Parameters
[in] db [in] A valid RDM database handle
[in] ddlStmt [in] The ddl statement to execute