Typedefs | |
typedef int(* | DatabaseFunc_HandleRequest )(DBMessage *msg) |
UserFunction called to handle a database request. More... | |
Functions | |
int | mdlDB_attachActiveEntityDscr (MSElementDescrH elDscr) |
Links a complex element contained in an element descriptor with the active entity. More... | |
int | mdlDB_attachActiveEntityElement (MSElementP out, MSElementP in) |
Links a graphic element with the active entity. More... | |
int | mdlDB_buildDALinkFromLink (UShort attributes[], int *linkLength, DatabaseLink *link) |
Used to build a displayable attribute linkage from an existing database linkage. More... | |
int | mdlDB_closeReport () |
Closes report tables in the database after report generation. More... | |
int | mdlDB_copyElement (MSElementP el) |
Processes the attribute linkages of an element as if the element were copied in the design file using a MicroStation command. More... | |
int | mdlDB_decodeLink (DatabaseLink *link, UShort attributes[]) |
Extracts linkage parameters from a database linkage. More... | |
int | mdlDB_defineAEByLink (DatabaseLink *link) |
Used to define a new active entity based on a database linkage. More... | |
int | mdlDB_defineAEBySQLInsert (WCharCP sqlInsert) |
Used to define a new active entity from an SQL INSERT statement. More... | |
int | mdlDB_defineAEBySQLSelect (WCharCP sqlSelect) |
used to define an active entity based on an existing row in a database table. More... | |
int | mdlDB_defineFenceFilter (WCharCP filter) |
Used to establish a new fence filter for a database table. More... | |
int | mdlDB_deleteElement (MSElementP el) |
Processes an element's attribute linkages as if the element were deleted from the design file with a MicroStation command. More... | |
int | mdlDB_detachAttributesDscr (MSElementDescrH elDscrPP) |
Removes only attribute linkages recognized by the database server from the complex element contained in the element descriptor pointed to by elemDscrPP. More... | |
int | mdlDB_detachAttributesElement (MSElementP out, MSElementP in) |
Removes only attribute linkages recognized by the database server from the input element in. More... | |
int | mdlDB_displayActiveEntity () |
Displays the active entity. More... | |
int | mdlDB_editActiveEntity () |
Displays the active entity and allows editing of the individual fields. More... | |
int | mdlDB_elementFilter (MSElementCP el) |
Tests to determine whether an element contains attribute data linkages that belong to the database server. More... | |
int | mdlDB_elementReport (MSElementP el) |
Processes database linkages on the input element in. More... | |
int | mdlDB_encodeLink (UShort attributes[], DatabaseLink *link) |
Used to convert a database linkage from internal format link to one in external file format attributes. More... | |
int | mdlDB_executeScreenForm (WCharCP formName, WCharCP arguments) |
Calls a database screen form. More... | |
int | mdlDB_fenceFilter (MSElementP el) |
Tests to determine whether an element contains attribute data linkages that belong to the database server and satisfy the current DEFINE SEARCH criteria. More... | |
int | mdlDB_largestMslink (UInt32 *mslinkKey, WCharCP tableName) |
Returns the highest MSLINK key of table tableName in mslink. More... | |
int | mdlDB_loadDADscr (MSElementDescrH elDscr) |
Loads a displayable attribute text node with attribute information from the database. More... | |
int | mdlDB_openReport () |
Initializes the report tables in the database to prepare for report generation. More... | |
int | mdlDB_reviewAttributes (MSElementP el) |
Interactively reviews attribute linkages present on an element. More... | |
static void | SetHandleRequestFunction (DatabaseFunc_HandleRequest requestFunction) |
An MDL application can use this to set a function to be called when a database request needs to be handled. More... | |
int | mdlDB_findLinks (LinkInfo **linksPP, int *numLinksP, DgnModelRefP modelRef, int entity, UInt32 mslink) |
Searches MicroStation's cache of element locations by mslink and entity, and returns an allocated array of information on found elements. More... | |
bool | mdlDB_isActive () |
Informs the caller if there is an active database connection. More... | |
bool | mdlDB_isAutoCommit () |
Informs the caller of the current Auto Commit Mode. More... | |
int | mdlDB_changeDatabase (int iDatabaseServerId, WCharCP sLoginString) |
Attempts to change the database connection to the specified database server with the given login string. More... | |
int | mdlDB_buildDBLinkExternal (void *p, int *length, int linkFormat, int properties, int linkageClass, int entity, UInt32 mslink, int dasType, bool databaseActive, DBType **dbTypeArray, int dbTypeArrayLength) |
Creates and returns a data linkage to an external database. More... | |
void | mdlDB_logSessionDebug (WCharCP logMessage) |
Used to send session debug messages to the MicroStation log file. More... | |
typedef int(* DatabaseFunc_HandleRequest)(DBMessage *msg) |
UserFunction called to handle a database request.
[in] | msrg | The database request packet. |
int mdlDB_attachActiveEntityDscr | ( | MSElementDescrH | elDscr | ) |
Links a complex element contained in an element descriptor with the active entity.
The active entity must have been established with the MicroStation FIND, CREATE ENTITY, DEFINE AE or ACTIVE ENTITY command. The database linkage that is created will be appended to any existing attributes present on the complex element pointed to by elemDscrPP. No existing linkages will be disturbed.
[in,out] | elDscr | Element descriptor to link to AE. |
int mdlDB_attachActiveEntityElement | ( | MSElementP | out, |
MSElementP | in | ||
) |
Links a graphic element with the active entity.
The active entity must have been established with the MicroStation FIND, CREATE ENTITY, DEFINE AE or ACTIVE ENTITY commands. The database linkage that is created will be appended to existing attributes present on the input element in, creating the output element out. No existing linkages will be disturbed.
[out] | out | Element with active entity attachment. |
[in] | in | Element to attach active entity. |
int mdlDB_buildDALinkFromLink | ( | UShort | attributes[], |
int * | linkLength, | ||
DatabaseLink * | link | ||
) |
Used to build a displayable attribute linkage from an existing database linkage.
[out] | attributes | The argument attributes receives the completed displayable attribute linkage. The displayable attribute linkage is in external file format and may be directly appended to an element with a function such as mdlElement_appendAttributes. The argument linkLength receives the length, in words, of the displayable attribute linkage. |
[out] | linkLength | Length (words) of linkage. |
[in] | link | database linkage |
int mdlDB_buildDBLinkExternal | ( | void * | p, |
int * | length, | ||
int | linkFormat, | ||
int | properties, | ||
int | linkageClass, | ||
int | entity, | ||
UInt32 | mslink, | ||
int | dasType, | ||
bool | databaseActive, | ||
DBType ** | dbTypeArray, | ||
int | dbTypeArrayLength | ||
) |
Creates and returns a data linkage to an external database.
[out] | p | Data buffer to fill with linkage. |
[out] | length | Size in words of finished linkage. |
[in] | linkFormat | ORACLE, IX etc. |
[in] | properties | Linkage properties. |
[in] | linkageClass | Linkage class. |
[in] | entity | Entity number. |
[in] | mslink | Mslink key field value. |
[in] | dasType | Displayable attribute type. |
[in] | databaseActive | If true, then dbTypeArray and dbTypeArrayLength are used. |
[in] | dbTypeArray | A pointer to an array of database types. |
[in] | dbTypeArrayLength | The number of database types in dbTypeArray. |
int mdlDB_changeDatabase | ( | int | iDatabaseServerId, |
WCharCP | sLoginString | ||
) |
Attempts to change the database connection to the specified database server with the given login string.
[in] | iDatabaseServerId | The database server id to change to. |
[in] | sLoginString | The login string to use for the given server. |
int mdlDB_closeReport | ( | ) |
Closes report tables in the database after report generation.
This function has no arguments. The MicroStation command ACTIVE REPORT defines the report table name.
int mdlDB_copyElement | ( | MSElementP | el | ) |
Processes the attribute linkages of an element as if the element were copied in the design file using a MicroStation command.
This function should be called to maintain the database tables in synchronization with the design file. It should be called only when elements are not copied with a MicroStation command.
[in] | el | Element to process linkages. |
int mdlDB_decodeLink | ( | DatabaseLink * | link, |
UShort | attributes[] | ||
) |
Extracts linkage parameters from a database linkage.
The database server decodes the element attribute data (attributes), and the linkage parameters are returned in the link structure. Regardless of the linkage type (ORACLE or ODBC), all MicroStation database linkages can be represented by the database independent structure DatabaseLink.
[out] | link | Datebase linkage. |
[in] | attributes | Element attribute data. |
int mdlDB_defineAEByLink | ( | DatabaseLink * | link | ) |
Used to define a new active entity based on a database linkage.
[in] | link | The argument link is a pointer to a database linkage in external (file format) format. The database linkage contains an entity number which specifies the table (through MSCATALOG) and an MSLINK key which specifies the row within the table. |
int mdlDB_defineAEBySQLInsert | ( | WCharCP | sqlInsert | ) |
Used to define a new active entity from an SQL INSERT statement.
It is used in NEW linkage mode to establish an active entity when there is no existing row in the database table which can be used as the basis for the active entity.
[in] | sqlInsert | SQL SERT statement. |
int mdlDB_defineAEBySQLSelect | ( | WCharCP | sqlSelect | ) |
used to define an active entity based on an existing row in a database table.
The argument sqlSelect defines an SQL SELECT statement. If the SELECT statement returns multiple rows the first one is used as the basis for the active entity.
[in] | sqlSelect | SQL SELECT Statement. |
int mdlDB_defineFenceFilter | ( | WCharCP | filter | ) |
Used to establish a new fence filter for a database table.
The argument sqlSelect is an SQL SELECT statement which specifies a subset of a table. The fence filter will limit all fence operations to only those elements which meet both the geometric criteria of the fence and the database criteria expressed by the SELECT statement.
[in] | filter | Filter condition. |
int mdlDB_deleteElement | ( | MSElementP | el | ) |
Processes an element's attribute linkages as if the element were deleted from the design file with a MicroStation command.
This function should be called to maintain the database tables in synchronization with the design file. It should be called only when elements are not deleted with a MicroStation command or the mdlElement_undoableDelete function.
[in] | el | Element to process. |
int mdlDB_detachAttributesDscr | ( | MSElementDescrH | elDscrPP | ) |
Removes only attribute linkages recognized by the database server from the complex element contained in the element descriptor pointed to by elemDscrPP.
No other types of user data linkages will be disturbed on the element. The configuration variable MS_LINKTYPE sets the types of linkages that the server processes.
[in,out] | elDscrPP | Element descriptor with linkages. |
int mdlDB_detachAttributesElement | ( | MSElementP | out, |
MSElementP | in | ||
) |
Removes only attribute linkages recognized by the database server from the input element in.
The element with no database linkages is returned in out. No other types of user data linkages will be disturbed on the element. The configuration variable MS_LINKTYPE sets the types of linkages that the server processes.
[out] | out | Element with attributes removed. |
[in] | in | Element to detach attributes. |
int mdlDB_displayActiveEntity | ( | ) |
Displays the active entity.
The active entity is the target row to which graphics elements will be linked.
int mdlDB_editActiveEntity | ( | ) |
Displays the active entity and allows editing of the individual fields.
int mdlDB_elementFilter | ( | MSElementCP | el | ) |
Tests to determine whether an element contains attribute data linkages that belong to the database server.
Elements can contain many types of attribute data linkages that belong to either application programs or the database interface.
[in] | el | Element with database linkages. |
int mdlDB_elementReport | ( | MSElementP | el | ) |
Processes database linkages on the input element in.
The database server will add one row to the corresponding report table for each occurrence of an attribute linkage. The MicroStation command ACTIVE REPORT defines the report table name.
[out] | el | Element to add to report tables |
int mdlDB_encodeLink | ( | UShort | attributes[], |
DatabaseLink * | link | ||
) |
Used to convert a database linkage from internal format link to one in external file format attributes.
The length, in bytes, of the attribute linkage is given by the linkSize member of link.
[out] | attributes | Element attribute data. |
[in] | link | Database linkage. |
int mdlDB_executeScreenForm | ( | WCharCP | formName, |
WCharCP | arguments | ||
) |
Calls a database screen form.
The formname argument should point to a string containing the name of the form to be executed. Unless a full pathname is given, the path indicated by the MS_DBASE configuration variable will be searched for the form.
[in] | formName | SQL*FORM to be displayed |
[in] | arguments | Points to a string containing arguments to be passed to the forms package for the database being used. The value NULL can be passed if no arguments are needed. |
int mdlDB_fenceFilter | ( | MSElementP | el | ) |
Tests to determine whether an element contains attribute data linkages that belong to the database server and satisfy the current DEFINE SEARCH criteria.
Elements can contain many types of attribute data linkages that belong to application programs or the database interface.
[in] | el | Element with database linkages. |
int mdlDB_findLinks | ( | LinkInfo ** | linksPP, |
int * | numLinksP, | ||
DgnModelRefP | modelRef, | ||
int | entity, | ||
UInt32 | mslink | ||
) |
Searches MicroStation's cache of element locations by mslink and entity, and returns an allocated array of information on found elements.
[out] | linksPP | Is the address of a pointer that will be set to point to the allocated array. It is the caller's responsibility to free the array when no longer needed. See dbdefs.h for the declaration of the LinkInfo typedef. |
[out] | numLinksP | Is the address of an integer that will be set to indicate the number of records in the array. |
[in] | modelRef | Is the model in which to search, or 0 to indicate all files which can be expressed as INVALID_MODELREF, or as (DgnModelRefP) 0. |
[in] | entity | Is the entity number to search by. Only elements with database linkages of this entity type will be found. Set entity to -1 to return information on all entity types. |
[in] | mslink | Is the linkage number to search by. By definition, there is only one record in a database that has a given mslink value, for each entity type. Only elements with database linkages with this mslink number will be found. Set mslink to 0 to return information on all links. |
bool mdlDB_isActive | ( | ) |
Informs the caller if there is an active database connection.
bool mdlDB_isAutoCommit | ( | ) |
Informs the caller of the current Auto Commit Mode.
int mdlDB_largestMslink | ( | UInt32 * | mslinkKey, |
WCharCP | tableName | ||
) |
Returns the highest MSLINK key of table tableName in mslink.
The largest MSLINK key in a table must be known while new rows are being added to the table. A call to mdlDB_largestMslink can be followed by mdlDB_buildLink to construct a new database linkage.
[out] | mslinkKey | Largest value of MSLINK column. |
[in] | tableName | Table Name. |
int mdlDB_loadDADscr | ( | MSElementDescrH | elDscr | ) |
Loads a displayable attribute text node with attribute information from the database.
The element descriptor elemDscrPP must point to a text node element with a displayable attribute database linkage.
[in,out] | elDscr | Text node to load. |
void mdlDB_logSessionDebug | ( | WCharCP | logMessage | ) |
Used to send session debug messages to the MicroStation log file.
[in] | logMessage | Session debug message to be written to the log file. |
int mdlDB_openReport | ( | ) |
Initializes the report tables in the database to prepare for report generation.
The contents of the report table defined by the MicroStation command ACTIVE REPORT are deleted.
int mdlDB_reviewAttributes | ( | MSElementP | el | ) |
Interactively reviews attribute linkages present on an element.
The database server will execute the REVIEW MicroStation command for the element linkages.
[in] | el | Element with database linkages. |
|
static |
An MDL application can use this to set a function to be called when a database request needs to be handled.
[in] | requestFunction | The new function to call, or NULL. |