Programming Guide


Initializes access to a specific database engine

#include <dmuproto.h>
int dm_init(char *engine, int support_function, int case, char *arg);

A name you assign to the engine. If an application uses two or more engines, the application uses the mnemonic engine to indicate a particular DBMS. Most examples in the guide use a vendor name as the mnemonic, for example sybase or oracle, but any character string that is not a keyword is valid. For a list of keywords, refer to Chapter 13, "Keywords in Database Drivers." If engine is already installed, dm_init returns 0.

One of the function names documented in the dbiinit.c file. The file name is usually in the form dm_vendorsup where vendor is an abbreviated vendor name. For example:

Sets the case processing for the specified engine. The constants are shown in Table 5-4 in Description.

Reserved for future use. Set this parameter to 0.


C only



Before an application can access a database, Panther must perform an engine initialization. The initialization adds the engine name to the list of available engines, allocates a data structure for the engine, calls the engine's support function to initialize the data structure, and sets case handling for the engine. You can use the vendor_list structure in dbiinit.c to initialize an engine at startup or else use dm_init to initialize an engine at a later point in the application.

The case parameter specifies how Panther uses case to map column names to variables when executing a SELECT statement. Table 5-4 lists the available options.

Table 5-4 Database engine case constants

Constant Description


Use the case option set in the support function for that engine. For information on this setting, refer to the documentation for "Database Drivers."


Use case exactly as returned by the engine.


Force all column names returned by an engine to upper case. Therefore, the application should use upper case names for Panther variables.


Force all column names returned by an engine to lower case. Therefore, the application should use lower case names for Panther variables.

After the engine is initialized, the application can declare a connection on it.


#include <dmerror.h>
#include <smusrdbi.h>

int retcode;

retcode = dm_init("jdb", dm_jdbsup, DM_DEFAULT_CASE, 0);

See Also