This chapter provides the manual pages for the utilities and the mr routines. The utility manual pages can also be found in the $EMPRESSPATH/man directory and can be printed using the command:
For UNIX, using nroff -man filename.
For Windows, using type or more command.
The following is the list of manual pages for the utilities:
| Category | Sub-Category | Command |
| C/C++ API | empc++ | |
| empcc (UNIX) | ||
The following is the list of manual pages for the mr routines in alphabetical order:
| DESCRIPTION | Place a named procedure on the stack to be called by msexit and executed immediately before the program is terminated. The procedure passed to msclean is the last but one called by msexit. | ||
| SYNOPSIS | void msclean (void (* proc) (void)) | ||
| USAGE | msclean (proc ());
| ||
| RETURNS | None. | ||
| WARNINGS | Please note that this routine will become obsolete and be replaced in the near future with the multi-threading capability. This routine is not thread-safe and should not be used inside threads. |
| DESCRIPTION | This routine is used to improve the performance of inserts and updates into TEXT, NLSTEXT and BULK attributes. | ||
| SYNOPSIS | void msdtfsta (msbool enable) | ||
| USAGE | msdtfsta (enable);
| ||
| RETURNS | None. | ||
| WARNINGS | Please note that if you are using msdtfsta you must guarantee that the buffer used to convey the bulk or text data is static or unaltered until mradd or mrput is called by the program. This routine is intended to be used only with programming language (mx, mr, Precompiler) in Empress. It should not be used with any Data Definition Language (DDL) command such as CREATE TABLE, ALTER TABLE, etc. As a result these program must not use any mscallroutine which executes a DDL statement. |
| DESCRIPTION |
This routine call the cleanup procedures without terminating the program. |
| SYNOPSIS |
void msend (void) |
| USAGE |
msend (); |
| RETURNS |
None. |
| WARNINGS |
None. |
| DESCRIPTION | This routine calls msexitcleanup before terminating the program. It passes a value to the shell. | ||
| SYNOPSIS | void msexit (int value) | ||
| USAGE | msexit (value);
| ||
| RETURNS | None. | ||
| WARNINGS | The last procedure called by msexit checks to see if all user procedure space is freed; if not, a warning message about space allocated is printed. This routine is not thread-safe and should not be used inside threads. |
| DESCRIPTION | This routine call the cleanup procedures without terminating the program. |
| SYNOPSIS | void msexitcleanup (void) |
| USAGE | msexitcleanup (); |
| RETURNS | None. |
| WARNINGS | None. |
| DESCRIPTION | Initialize for mscall, mx and mr routines. |
| SYNOPSIS | msbool msinit (void) |
| USAGE | msinit (); |
| RETURNS | Return true if successful; false otherwise. |
| WARNINGS | None. |
| DESCRIPTION | Free the space allocated by mspsm_malloc. | ||
| SYNOPSIS | void mspsm_free (char* space) | ||
| USAGE | mspsm_free (space);
| ||
| RETURNS | None. | ||
| WARNINGS | This routine should be used only in Persistent Stored Modules (PSM). This routine is not thread-safe and should not be used inside threads. |
| DESCRIPTION | Allocate space for storing data in Persistent Stored Modules (PSM). | ||||
| SYNOPSIS | void* mspsm_malloc (int size) | ||||
| USAGE | space = mspsm_malloc (size);
| ||||
| RETURNS | Pointer (void*) to space allocated for storage used in Persistent Stored Module (PSM). | ||||
| WARNINGS | The space will remain allocated until freed internally by Empress RDBMS. If there is a need to free the space inside the PSM, Empress routine mspsm_free should be used. This routine is not thread-safe and should not be used inside threads. |
| DESCRIPTION | Changes the size of the space allocated by mspsm_malloc. | ||||||
| SYNOPSIS | void* mspsm_realloc (void* space, int size) | ||||||
| USAGE | realloc_space = mspsm_realloc (space, size);
| ||||||
| RETURNS | Pointer (void*) to space allocated for storage used in Persistent Stored Module (PSM). | ||||||
| WARNINGS | The space will remain allocated until freed internally by Empress RDBMS. This routine is not thread-safe and should not be used inside threads. |
| DESCRIPTION | This routine is used in trigger procedure to abort the corresponding operation. |
| SYNOPSIS | void mspsm_trig_abort_operation (void) |
| USAGE | mspsm_trig_abort_operation (); |
| RETURNS | None. |
| WARNINGS | The operation will be aborted only if the trigger is fired before the operation. This routine is not thread-safe and should not be used inside threads. |
| DESCRIPTION | This routine is used to get the table descriptor and the record descriptor in a trigger procedure. |
| SYNOPSIS |
void mspsm_trig_get_record_info (void** pmr,
void** poldrec,
void** pnewrec)
| USAGE | mspsm_trig_get_record_info (pmr, poldrec, pnewrec);
|
| RETURNS | None. |
| WARNINGS |
|
| DESCRIPTION | Insert a record into a given table; terminate calling program on failure. |
| SYNOPSIS | void mradd (addr record_desc) |
| USAGE | mradd (record_desc); |
| RETURNS | None. |
| WARNINGS | mraddend should be called to clean up after one or more calls to mradd. |
| DESCRIPTION | End a group of insertions. | ||||
| SYNOPSIS | msbool mraddend (addr record_desc) | ||||
| USAGE | flag = mraddend (record_desc);
| ||||
| RETURNS | Return true if successful; false otherwise. | ||||
| WARNINGS | None. |
| DESCRIPTION | This routine creates a user specified space in an existing overflow (.dtf) file. Since the data segment updating routine mrsubputi won't change the size of the bulk or text attribute value it operates on, using mrbuktxtcrt is the only way of preparing a space on disk to hold incoming data segment for insert or update to a larger object. This routine, mrbuktxtcrt, does not allocate system memory, so there is no problem with creating data segment that is much larger than existing system memory. The allocated overflow .dtf extents will be filled with null values. | ||||||
| SYNOPSIS | long mrbuktxtcrt (mrrdes* rec, mrades* mra, long size) | ||||||
| USAGE | flag = mrbuktxtcrt (rec, mra, size);
| ||||||
| RETURNS | Return -1 on failure. | ||||||
| WARNINGS | None. |
| DESCRIPTION | This routine returns the length of the BULK or TEXT data in bytes. | ||||
| SYNOPSIS | long mrbuktxtlen(mrrdes* rec, mrades* mra) | ||||
| USAGE | flag = mrbuktxtlen (rec, mra);
| ||||
| RETURNS | On success, returns the total length of the data in bytes. On failure, a -1 indicating that the attribute is not a BULK or TEXT data type. | ||||
| WARNINGS | If the attribute is text holding a C -style zero terminated string, the length returned will not include the zero terminator. |
| DESCRIPTION | Close data dictionary. |
| SYNOPSIS | void mrcldict (void) |
| USAGE | mrcldict (void); |
| RETURNS | None. |
| WARNINGS | None. |
| DESCRIPTION | Close a table, unlocking it if it is locked. | ||||
| SYNOPSIS | msbool mrclose (addr table_desc) | ||||
| USAGE | flag = mrclose (table_desc);
| ||||
| RETURNS | Return true if successful; false otherwise. | ||||
| WARNINGS | None. |
| DESCRIPTION | Compare an attribute value with a constant in file format. A pointer to a file format constant returned by one of the mrcvt routines may be used. | ||||||||||
| SYNOPSIS |
int mrcompare (addr record_desc,
addr attr_desc,
addr var_ptr)
| ||||||||||
| USAGE |
result = mrcompare (record_desc, attr_desc,
&var);
result = mrcompare (record_desc, attr_desc,
mrcvt (attr_desc, string));
| ||||||||||
| RETURNS | -1 if the attribute value is less than the constant; zero if the attribute value is equal to the constant; 1 if the attribute value is greater than the constant. | ||||||||||
| WARNINGS | None. |
| DESCRIPTION | Used to set the lower and upper bounds for a subsequent retrieval of a variable length data type value. | ||||||||
| SYNOPSIS |
msbool mrcontrol (addr attr_desc,
int lower_bound,
int upper_bound)
| ||||||||
| USAGE |
flag = mrcontrol (attr_desc, lower_bound,
upper_bound)
| ||||||||
| RETURNS | Return true if successful; false otherwise. | ||||||||
| WARNINGS | None. |
| DESCRIPTION | Copy the internal format of an attribute value to a variable. Used only in fixed applications; produces machine-dependent code. | ||||||||
| SYNOPSIS |
msbool mrcopyi (addr record_desc,
addr attr_desc,
addr var_ptr)
| ||||||||
| USAGE | flag = mrcopyi (record_desc, attr_desc, &var);
| ||||||||
| RETURNS | True (1) if the value is not NULL, false (0) otherwise. | ||||||||
| WARNINGS | Use of this routine results in non-portable code. The variable must be of the right type and length to store the attribute value retrieved, or the routine will fail. You must know how each Empress data type is stored on the machine for which you are writing. |
| DESCRIPTION | Copy the attribute values from one record into another. This routine is normally used when updating records. | ||||||
| SYNOPSIS |
msbool mrcopyr (addr new_rec_desc,
addr old_rec_desc)
| ||||||
| USAGE | flag = mrcopyr (new_rec_desc, old_rec_desc);
| ||||||
| RETURNS | Return true if successful; false otherwise. | ||||||
| WARNINGS | Both record_descriptors must refer to the same table. |
| DESCRIPTION | Assign an external format attribute value to the space allocated for it. | ||||||||
| SYNOPSIS |
msbool mrcopyv (addr record_desc,
addr attr_desc,
char* space)
| ||||||||
| USAGE |
flag = mrcopyv (record_desc, attr_desc,
space);
| ||||||||
| RETURNS | True (1), if the value of the attribute is not null; false (0), if the value of the attribute is null. | ||||||||
| WARNINGS | Should not be used to retrieve TEXT or BULK data type attributes. mrcopyv () terminates the calling program if the pointer passed as argument does not have space allocated to it. |
| DESCRIPTION | Convert an external format attribute value to file format (public buffer). | ||||||
| SYNOPSIS | addr mrcvt (addr attr_desc, char* string) | ||||||
| USAGE | value = mrcvt (attr_desc, string);
| ||||||
| RETURNS | Pointer (addr) to a file format attribute value if the conversion was successful, otherwise a zero pointer. | ||||||
| WARNINGS | mrcvt should be called immediately before the file format value is used, as the next call to many other mr routines will destroy the converted value. |
| DESCRIPTION | Convert an internal format attribute value to file format (semi-private buffer). | ||||||
| SYNOPSIS | addr mrcvti (addr attr_desc, addr var_ptr) | ||||||
| USAGE | value = mrcvti (attr_desc, var_ptr);
| ||||||
| RETURNS | Pointer (addr) to a file format attribute value if the conversion was successful, otherwise a zero pointer. | ||||||
| WARNINGS | mrcvti shares a buffer with mrcvtv, so the next call to either of these routines will destroy the converted value. |
| DESCRIPTION | Convert an internal format attribute value to file format (semi-private buffer). | ||||||
| SYNOPSIS | addr mrcvti2 (addr attr_desc, addr var_ptr) | ||||||
| USAGE | value = mrcvti2 (attr_desc, var_ptr);
| ||||||
| RETURNS | Pointer (addr) to a file format attribute value if the conversion was successful, otherwise a zero pointer. | ||||||
| WARNINGS | mrcvti2 shares a buffer with mrcvtv2, so the next call to either of these routines will destroy the converted value. |
| DESCRIPTION | Convert an internal format attribute value to file format (public buffer). | ||||||
| SYNOPSIS | addr mrcvtin (addr attr_desc, addr var_ptr) | ||||||
| USAGE | value = mrcvtin (attr_desc, var_ptr);
| ||||||
| RETURNS | Pointer (addr) to a file format attribute value if the conversion was successful, otherwise a zero pointer. | ||||||
| WARNINGS | mrcvtin should be called immediately before the converted value is to be used, since it shares a buffer with several other mr routines, and the next call to any of them will destroy the converted value. |
| DESCRIPTION | Convert an external format attribute value to file format. | ||||||
| SYNOPSIS | addr mrcvtv (addr attr_desc, char* string) | ||||||
| USAGE | value = mrcvtv (attr_desc, string);
| ||||||
| RETURNS | Pointer (addr) to a file format attribute value if the conversion was successful, otherwise a zero pointer. | ||||||
| WARNINGS | mrcvtv shares a buffer with mrcvti, so that the next call to either of these routines will destroy the converted value. |
| DESCRIPTION | Convert an external format attribute value to file format. | ||||||
| SYNOPSIS | addr mrcvtv2 (addr attr_desc, char* string) | ||||||
| USAGE | value = mrcvtv2 (attr_desc, string);
| ||||||
| RETURNS | Pointer (addr) to a file format attribute value if the conversion was successful, otherwise a zero pointer. | ||||||
| WARNINGS | mrcvtv2 shares a buffer with mrcvti2, so that the next call to either of these routines will destroy the converted value. |
| DESCRIPTION | Delete a record from a table; terminate calling program on failure. | ||
| SYNOPSIS | void mrdel (addr record_desc) | ||
| USAGE | mrdel (record_desc);
| ||
| RETURNS | None. | ||
| WARNINGS | The record must first have been specified in a call to mrgetbegin and then retrieved by a successful call to mrget. mrdelend should be called to do cleaning up after one or more calls to mrdel. If the table was opened in deferred mode and an update lock cannot be made on the table, the routine will fail. |
| DESCRIPTION | Clean up after deleting records from a table. | ||||
| SYNOPSIS | msbool mrdelend (addr record_desc) | ||||
| USAGE | flag = mrdelend (record_desc);
| ||||
| RETURNS | Return true if successful; false otherwise. | ||||
| WARNINGS | None. |
| DESCRIPTION | Abort building an expression. To be used in case any erroneous condition is detected while building an expression (this may be determined by the success or failure of the routines which add functions/operators or arguments/operands to the expression). Use of this routine precludes the use of mreend. |
| SYNOPSIS | void mreabort (void) |
| USAGE | mreabort (); |
| RETURNS | None. |
| WARNINGS | None. |
| DESCRIPTION | Start building an expression. This initializes an internal data structure. |
| SYNOPSIS | void mrebegin (void) |
| USAGE | mrebegin (); |
| RETURNS | None. |
| WARNINGS | Must be the first call when building an expression. |
| DESCRIPTION | Add a constant argument/operand of type type_desc to the expression. Note that although the constant is in external format (a string), it may represent any other data type, including such data types as date and decimal, for instance. | ||||||
| SYNOPSIS |
msbool mrecons (char* string,
addr type_desc)
| ||||||
| USAGE | flag = mrecons (string, type_desc);
| ||||||
| RETURNS | True if the addition is successful, false otherwise. | ||||||
| WARNINGS | None. |
| DESCRIPTION | Add a data type conversion operator to the expression. | ||||
| SYNOPSIS | msbool mrecvarg (addr type_desc) | ||||
| USAGE | flag = mrecvarg (type_desc);
| ||||
| RETURNS | True if conversion is possible, false otherwise. | ||||
| WARNINGS | None. |
| DESCRIPTION | Finish building an expression and return its descriptor. If the expression descriptor is used directly (that is, by calling mrerun) then mrefree must be used to free the descriptor when the expression is no longer needed. If the expression is used in a qualification the descriptor will be freed automatically by Empress. | ||
| SYNOPSIS | addr mreend (void) | ||
| USAGE | expr_desc = mreend ();
| ||
| RETURNS | Pointer (addr) to the expression descriptor. | ||
| WARNINGS | None. |
| DESCRIPTION | Free the expression descriptor. Must be called after the expression is not required any more. | ||||
| SYNOPSIS | msbool mrefree (addr expr_desc) | ||||
| USAGE | flag = mrefree (expr_desc);
| ||||
| RETURNS | Return true if successful; false otherwise. | ||||
| WARNINGS | None. |
| DESCRIPTION | Add a function or operator (i.e., an Empress supplied function/operator or user defined function/operator in Empress SQL). The name of the function, the number of arguments the function takes, and the types of arguments are checked against the arguments available. If any of these is invalid the function is not inserted in the expression. A failed call does not affect the expression stack. | ||||||
| SYNOPSIS | msbool mrefunc (char* func, int nargs) | ||||||
| USAGE | flag = mrefunc (func, nargs);
| ||||||
| RETURNS | True if the function addition is successful, false otherwise. | ||||||
| WARNINGS | None. |
| DESCRIPTION | Associate a control variable with the most recent variable. It is usually called immediately after mreivar is called. If the parameter mode of the variable is IN/INOUT, the control variable is used to indicate the input value; if the parameter mode of the variable is OUT/ INOUT, the control variable is used to indicate the output. The data type of a control variable is long of C data type, a pointer to control variable is passed to the function. The possible values of a control variable are:
| ||||||
| SYNOPSIS | msbool mreicvar (long* icvar) | ||||||
| USAGE | flag = mreicvar (icvar);
| ||||||
| RETURNS | True if successful; false otherwise. | ||||||
| WARNINGS | None. |
| DESCRIPTION | Add a variable argument/operand to the expression, using an indirect pointer to it. When the expression is evaluated, the current value of the variable is used in the expression. The type of the C variable used must correspond to the data type descriptor passed. Refer to Chapter 2 under "Data Type Correspondences". | ||||
| SYNOPSIS | void mreivar (addr* ivar, addr type_desc) | ||||
| USAGE | mreivar (ivar, type_desc);
| ||||
| RETURNS | None. | ||||
| WARNINGS | None. |
| DESCRIPTION | Add a function which checks whether the most recent argument/operand placed on the stack is NULL. | ||||
| SYNOPSIS | msbool mrenull (char* func) | ||||
| USAGE | flag = mrenull (func);
| ||||
| RETURNS | True if the function addition is successful, false otherwise. | ||||
| WARNINGS | None. |
| DESCRIPTION | Add an attribute argument/operand to the expression. The value of the attribute is taken from the specified record at the time the expression is evaluated. | ||||||
| SYNOPSIS |
msbool mrerecattr (addr record_desc,
addr attr_desc)
| ||||||
| USAGE | flag = mrerecattr (record_desc, attr_desc);
| ||||||
| RETURNS | Return true if successful; false otherwise. | ||||||
| WARNINGS | None. |
| DESCRIPTION | Return a string describing the current error condition. | ||
| SYNOPSIS | char* mrerrmsg (void) | ||
| USAGE | string = mrerrmsg ();
| ||
| RETURNS | A pointer (char*) to the text message describing the current error condition. | ||
| WARNINGS | mrerrmsg should be called immediately after an error; the string it reads may be corrupted by the next mr call. This routine is not thread-safe and should not be used inside threads. |
| DESCRIPTION | Run the expression and return a pointer to the result. The type of the result is the type of the expression. This routine may be called more than once with referenced variables and/or attribute values updated between calls. This routine should not be used if the expression is part of a qualification. If the result is stored in a C variable, the variable must be of the appropriate type. Refer to Chapter 2 under "Data Type Correspondences". | ||||
| SYNOPSIS | addr mrerun (addr expr_desc) | ||||
| USAGE | result = mrerun (expr_desc);
| ||||
| RETURNS | Pointer (addr) to the result if successful, otherwise NIL. | ||||
| WARNINGS | None. |
| DESCRIPTION | Free the space allocated by mrspv mrmalloc, mrrealloc. | ||
| SYNOPSIS | void mrfree (char* space) | ||
| USAGE | mrfree (space);
| ||
| RETURNS | None. | ||
| WARNINGS | None. |
| DESCRIPTION | Free space used for storing a record. | ||||
| SYNOPSIS | msbool mrfrrec (addr record_desc) | ||||
| USAGE | flag = mrfrrec (record_desc);
| ||||
| RETURNS | Return true if successful; false otherwise. | ||||
| WARNINGS | None. |
| DESCRIPTION | Obtain the name of an attribute, given the attribute_descriptor. | ||||
| SYNOPSIS | char* mrganame (addr attr_desc) | ||||
| USAGE | name = mrganame (attr_desc);
| ||||
| RETURNS | Pointer (char*) to the name of the specified attribute. | ||||
| WARNINGS | None. |
| DESCRIPTION | Get data type descriptor for the attribute given the attribute_descriptor. | ||||
| SYNOPSIS | addr mrgdtpar (addr attr_desc) | ||||
| USAGE | type_desc = mrgdtpar (attr_desc);
| ||||
| RETURNS | Pointer (addr) to a data type descriptor. | ||||
| WARNINGS | None. |
| DESCRIPTION | Retrieve a record from a table. | ||||
| SYNOPSIS | msbool mrget (addr retrieval_desc) | ||||
| USAGE | flag = mrget (retrieval_desc);
| ||||
| RETURNS | True (1) if successful; false (0) if unsuccessful, i.e., if all records have been retrieved. The calling program is terminated if the call fails. If the record is locked the call fails. | ||||
| WARNINGS | mrgetend should be called after one or more calls to mrget to do cleaning up. |
| DESCRIPTION | Associate a given qualification with one or more records; terminate the calling program on failure. | ||||||||||
| SYNOPSIS |
addr mrgetbegin (addr qual_desc, addr record_desc_1,
[ ... addr record_desc_n,] (addr)0)
| ||||||||||
| USAGE |
retrieval_desc = mrgetbegin (qual_desc, record_desc_1,
record_desc_2, ...., ADDRNIL);
| ||||||||||
| RETURNS | Pointer (addr) to the retrieval_descriptor to be passed to mrget. | ||||||||||
| WARNINGS | Use of two or more records implies a cross-product or join (see mrget). Hence the record_descriptors must be derived from different table_descriptors. All the attribute_descriptors in the mrq routines used to generate the qualification_descriptor should belong to the table_descriptor(s) corresponding to the record_descriptor(s) given as arguments to mrgetbegin, or the procedure will fail. Any qualification_descriptor passed to mrgetbegin will be destroyed, and cannot be re-used. |
| DESCRIPTION | Clean up after retrieving records from a table. | ||
| SYNOPSIS | void mrgetend (addr retrieval_desc) | ||
| USAGE | mrgetend (retrieval_desc);
| ||
| RETURNS | None. | ||
| WARNINGS | None. |
| DESCRIPTION | Obtain a pointer to a buffer containing an internal format attribute value. | ||||||
| SYNOPSIS |
addr mrgeti (addr record_desc,
addr attr_desc)
| ||||||
| USAGE | result = mrgeti (record_desc, attr_desc);
| ||||||
| RETURNS | A pointer (addr) to a buffer containing the internal format attribute value. The value so found should be used immediately, or else the buffer copied, since the next call to mrgetvs or mrgeti destroys its contents. |
| DESCRIPTION | Obtain a pointer to a record for later use. | ||||
| SYNOPSIS | long mrgetptr (addr record_desc) | ||||
| USAGE | record_ptr = mrgetptr (record_desc);
| ||||
| RETURNS | A pointer (long) to the record currently referred to by the record_descriptor. | ||||
| WARNINGS | This routine is only meaningful for tables and simple views. |
| DESCRIPTION | Obtain a record given a pointer to it. | ||||||
| SYNOPSIS |
int mrgetrec (addr record_desc,
long record_ptr)
| ||||||
| USAGE | flag = mrgetrec (record_desc, record_ptr);
| ||||||
| RETURNS | True (1) if successful, false (0) if unsuccessful, and -1 if the record is locked. | ||||||
| WARNINGS | None. |
| DESCRIPTION | Retrieve an integer attribute value. | ||||||
| SYNOPSIS |
int mrgetvi (addr record_desc,
addr attr_desc)
| ||||||
| USAGE | result = mrgetvi (record_desc, attr_desc);
| ||||||
| RETURNS | The attribute value as an integer. | ||||||
| WARNINGS | The routine will fail and terminate the calling program if the attribute value cannot be converted to an integer. |
| DESCRIPTION | Obtain a pointer to a buffer containing an external format attribute value. | ||||||
| SYNOPSIS |
char* mrgetvs (addr record_desc,
addr attr_desc)
| ||||||
| USAGE | result = mrgetvs (record_desc, attr_desc);
| ||||||
| RETURNS | A pointer (char*) to an internal buffer containing the external format attribute value. | ||||||
| WARNINGS | The value so found should be used immediately, or the buffer copied, since the next call to mrgetvs or mrgeti destroys its contents. |
| DESCRIPTION | Find the result of an aggregate function for an attribute. | ||||||||||
| SYNOPSIS |
char* mrgfunc (char* function,
addr retrieval_desc,
addr record_desc,
addr attr_desc)
| ||||||||||
| USAGE |
value = mrgfunc (function, retrieval_desc,
record_desc,
attr_desc);
| ||||||||||
| RETURNS | A pointer (char*) to the value of the function. If there are no records, an empty string is returned. | ||||||||||
| WARNINGS | mrgetend must be called to do cleaning up after mrgfunc, and the value found should be freed with mrfree. |
| DESCRIPTION | Obtain an attribute_descriptor for attribute i, where i is the number of the attribute. | ||||||
| SYNOPSIS |
addr mrigeta (addr table_desc,
int attr_number)
| ||||||
| USAGE |
attr_desc = mrigeta (table_desc,
attr_number);
| ||||||
| RETURNS | Pointer (addr) to the attribute_descriptor if successful, and a zero pointer if attr_number is invalid. | ||||||
| WARNINGS | None. |
| DESCRIPTION | Hold a record level lock on a retrieved record. | ||||
| SYNOPSIS | msbool mrlkrec (addr record_desc) | ||||
| USAGE | flag = mrlkrec (record_desc);
| ||||
| RETURNS | True (1) if successful; false (0) if unable to lock the record. | ||||
| WARNINGS | This routine will have effect only if the locking level for the table is RECORD. However, in case of non-RECORD lock level, this routine still returns true. |
| DESCRIPTION | Lock a table to restrict access by others while an application is running. | ||||
| SYNOPSIS | msbool mrlktab (addr table_desc) | ||||
| USAGE | flag = mrlktab (table_desc);
| ||||
| RETURNS | True (1) if successful; false (0) if unable to lock the table. | ||||
| WARNINGS | If the locking level for the table is NULL, mrlktab will have no effect (the routine still returns true). |
| DESCRIPTION | Space allocation for data storage which will subsequently be used by Empress RDBMS. | ||||
| SYNOPSIS | void* mrmalloc (int size) | ||||
| USAGE | space = mrmalloc (size);
| ||||
| RETURNS | Pointer (void*) to the space allocated. | ||||
| WARNINGS | The space will remain allocated until specifically freed using mrfree. |
| DESCRIPTION | Allocate space for storage of a record. | ||||
| SYNOPSIS | addr mrmkrec (addr table_desc) | ||||
| USAGE | record_desc = mrmkrec (table_desc);
| ||||
| RETURNS | Pointer (addr) to the record_descriptor. | ||||
| WARNINGS | The space allocated for the record_desc will stay allocated unless specifically freed using mrfrrec. |
| DESCRIPTION | Assign a C integer to a given attribute in a record; terminate the calling program on failure. | ||||||
| SYNOPSIS |
void mrmptvi (addr record_desc,
addr attr_desc,
int value)
| ||||||
| USAGE |
mrmptvi (record_desc, attr_desc,
integer);
| ||||||
| RETURNS | Nothing; the calling program is terminated if mrmptvi fails. | ||||||
| WARNINGS | None. |
| DESCRIPTION | Assign a value to a given attribute in a record; terminate calling program on failure. | ||||||
| SYNOPSIS |
void mrmptvs (addr record_desc,
addr attr_desc,
char* value)
| ||||||
| USAGE | mrmptvs (record_desc, attr_desc, value);
| ||||||
| RETURNS | Nothing; the calling program is terminated if mrmptvs fails. | ||||||
| WARNINGS | None. |
| DESCRIPTION | To mark the starting point of mutual exclusion (mutex) piece of code. All the code between mrmutexlock () and mrmutexunlock are thread safe. |
| SYNOPSIS | void mrmutexlock (void) |
| USAGE | mrmutexlock () |
| RETURNS | None. |
| WARNINGS | None. |
| DESCRIPTION | To mark the end point of mutual exclusion (mutex) piece of code. All the code between mrmutexlock () and mrmutexunlock are thread safe. |
| SYNOPSIS | void mrmutexunlock (void) |
| USAGE | mrmutexunlock () |
| RETURNS | None. |
| WARNINGS | None. |
| DESCRIPTION | Obtain an attribute_descriptor for the named attribute. | ||||||
| SYNOPSIS |
addr mrngeta (addr table_desc,
char* attr_name)
| ||||||
| USAGE | attr_desc = mrngeta (table_desc, attr_name);
| ||||||
| RETURNS | Pointer (addr) to the attribute_descriptor if successful, and a zero pointer if unsuccessful (e.g., invalid name). | ||||||
| WARNINGS | None. |
| DESCRIPTION | See if a whole record is NULL. | ||||
| SYNOPSIS | msbool mrnullr (addr record_desc) | ||||
| USAGE | flag = mrnullr (record_desc);
| ||||
| RETURNS | True (1) if the record is NULL; false (0) if not. | ||||
| WARNINGS | None. |
| DESCRIPTION | See if an attribute value in the record is NULL. | ||||||
| SYNOPSIS | msbool mrnullv (addr record_desc, addr attr_desc) | ||||||
| USAGE | flag = mrnullv (record_desc, attr_desc);
| ||||||
| RETURNS | True (1) if the attribute value is NULL; false (0) if not. | ||||||
| WARNINGS | None. |
| DESCRIPTION | Open a data dictionary for internal access by the mr routines; terminate the calling program on failure. | ||||
| SYNOPSIS |
void mropdict (char* database_name,
char mode)
| ||||
| USAGE | mropdict (database_name, mode);
| ||||
| RETURNS | None. | ||||
| WARNINGS | It is generally unwise to specify the current directory when calling mropdict (i.e., you should not run applications while in the database directory), because of the danger of damaging files in the database when new files are created. If read mode is specified and the person executing the program has no read permission on the data dictionary tables, or if update mode is specified and the person executing the program has no read and write permission on the data dictionary tables, mropdict will fail and terminate the program calling it. |
| DESCRIPTION | Open a table for use with the mr routines; terminate on failure. The table is set up for locking at the level indicated in the data dictionary. If table level locking is set, the table is locked by this routine. | ||||||||
| SYNOPSIS |
addr mropen (char* database_name,
char* table_name,
char mode)
| ||||||||
| USAGE |
table_desc = mropen (database_name,
table_name, mode);
| ||||||||
| RETURNS | Pointer (addr) to a table_descriptor if successful. If unsuccessful, nothing is returned and the program calling it is terminated. | ||||||||
| WARNINGS | It is generally unwise to specify the current directory when calling mropen (i.e., you should not run applications while in the database directory), because of the danger of damaging files in the database when new files are created. If read mode is specified and the person executing the program has no read permission on the data dictionary tables, or if update mode is specified and the person executing the program has no read and write permission on the data dictionary tables, mropen will fail and terminate the program calling it. |
| DESCRIPTION | Retrieve the previous record from a table. | ||||
| SYNOPSIS | msbool mrprev (addr retrieval_desc) | ||||
| USAGE | flag = mrprev (retrieval_desc);
| ||||
| RETURNS | True (1) if successful; false (0) if unsuccessful, i.e., if all records have been retrieved. If the record is locked the call fails. The calling program is terminated if the call fails. | ||||
| WARNINGS | mrgetend should be called after one or more calls to mrprev to do cleaning up. |
| DESCRIPTION | Print an error message depending on a previous error; terminate the calling program. |
| SYNOPSIS | void mrprterr (void) |
| USAGE | mrprterr (); |
| RETURNS | None. |
| WARNINGS | This routine is not thread-safe and should not be used inside threads. |
| DESCRIPTION | Update a record. | ||||
| SYNOPSIS |
void mrput (addr new_rec_desc,
addr old_rec_desc)
| ||||
| USAGE | mrput (new_rec_desc, old_rec_desc);
| ||||
| RETURNS | None. | ||||
| WARNINGS | The old_rec_desc must point to a record which has been retrieved by calls to mrgetbegin and mrget, otherwise mrput will fail. If the table was opened in deferred mode and an update lock cannot be made on the table the routine will fail. |
| DESCRIPTION | Assign an internal format value to a given attribute in a record. | ||||||||
| SYNOPSIS |
msbool mrputi (addr record_desc,
addr attr_desc,
addr var_ptr)
| ||||||||
| USAGE |
flag = mrputi (record_desc, attr_desc,
var_ptr);
| ||||||||
| RETURNS | True (1) if successful; false (0) if unable to convert the given value to fit the attribute. | ||||||||
| WARNINGS | If the routine returns false (0), the value for the attribute in the space pointed to by the record_descriptor is not guaranteed to be unchanged. Use of this routine results in non-portable code. If there is a range check on the attribute, this routine does not check if the value is valid for the range. |
| DESCRIPTION | Assign a C integer to a given attribute in a record. | ||||||||
| SYNOPSIS |
msbool mrputvi (addr record_desc,
addr attr_desc,
int value)
| ||||||||
| USAGE |
flag = mrputvi (record_desc, attr_desc,
integer);
| ||||||||
| RETURNS | True (1) if successful; false (0) if unable to convert the given value to fit the attribute. | ||||||||
| WARNINGS | If the routine returns false (0), the value for the attribute in the space pointed to by the record_descriptor is not guaranteed to be unchanged. |
| DESCRIPTION | Assign a value in external format to a given attribute in a record. | ||||||||
| SYNOPSIS |
msbool mrputvs (addr record_desc,
addr attr_desc,
char* value)
| ||||||||
| USAGE |
flag = mrputvs (record_desc, attr_desc,
value);
| ||||||||
| RETURNS | True (1) if successful; false (0) if unable to convert the given value to fit the attribute. | ||||||||
| WARNINGS | If the routine returns false (0), the value for the attribute in the space pointed to by the record_descriptor is not guaranteed to be unchanged. |
| DESCRIPTION | Perform an AND operation on two qualification_descriptors obtained from any of the mrq routines. | ||||||
| SYNOPSIS |
addr mrqand (addr qual_desc_1,
addr qual_desc_2)
| ||||||
| USAGE | qual_desc = mrqand (qual_desc_1, qual_desc_2);
| ||||||
| RETURNS | Pointer (addr) to a qualification_descriptor. | ||||||
| WARNINGS | mrqand destroys the qualification_descriptors in its argument list and frees the space allocated to them, so they cannot be used again. |
| DESCRIPTION | Compare an attribute value to another attribute value. | ||||||||
| SYNOPSIS |
addr mrqatr (char* operator,
addr attr_desc_1,
addr attr_desc_2)
| ||||||||
| USAGE |
qual_desc = mrqatr (operator, attr_desc_1,
attr_desc_2);
| ||||||||
| RETURNS | Pointer (addr) to a qualification_descriptor. | ||||||||
| WARNINGS | The two attributes compared must be compatible, otherwise mrqatr will fail. |
| DESCRIPTION | Compare an attribute value with a constant in file format. A pointer to a file format constant returned by one of the mrcvt routines may be used. | ||||||||||
| SYNOPSIS |
addr mrqcon (char* operator,
addr attr_desc,
addr var_ptr)
| ||||||||||
| USAGE |
qual_desc = mrqcon (operator, attr_desc, &var);
qual_desc = mrqcon (operator, attr_desc,
mrcvt (attr_desc, string));
| ||||||||||
| RETURNS | Pointer (addr) to a qualification_descriptor. | ||||||||||
| WARNINGS | None. |
| DESCRIPTION | Check whether a given pathname is a valid Empress database. | ||||
| SYNOPSIS | msbool mrqdb (char* directory) | ||||
| USAGE | flag = mrqdb (directory);
| ||||
| RETURNS | True (1) if the directory is an Empress database; false (0) if not. | ||||
| WARNINGS | None. |
| DESCRIPTION | Put an expression in the qualification. This returns a qualification _descriptor which may then be passed to one of the retrieval initialization routines such as, mrgetbegin. | ||||
| SYNOPSIS | addr mrqexpr (addr expr_desc) | ||||
| USAGE | qual_desc = mrqexpr (expr_desc)
| ||||
| RETURNS | Pointer to qualification_descriptor. If the expression descriptor is not a descriptor for a valid expression, the routine will fail terminating the calling program. |
| DESCRIPTION | Compare an attribute value to a C integer. | ||||||
| SYNOPSIS | addr mrqieq (addr attr_desc, int integer) | ||||||
| USAGE | qual_desc = mrqieq (attr_desc, integer);
| ||||||
| RETURNS | Pointer (addr) to a qualification_descriptor. | ||||||
| WARNINGS | None. |
| DESCRIPTION | Qualify a set of previously found records. | ||||||
| SYNOPSIS | addr mrqlst (addr table_desc, long array[]) | ||||||
| USAGE | qual_desc = mrqlst (table_desc, array);
| ||||||
| RETURNS | Pointer (addr) to a qualification_descriptor. | ||||||
| WARNINGS | None. |
| DESCRIPTION | Compare an attribute value to a pattern. | ||||||||
| SYNOPSIS |
addr mrqmch (char* operator,
addr attr_desc,
char* pattern)
| ||||||||
| USAGE |
qual_desc = mrqmch (operator, attr_desc,
pattern);
| ||||||||
| RETURNS | Pointer (addr) to a qualification_descriptor. | ||||||||
| WARNINGS | None. |
| DESCRIPTION | Perform a NOT operation on a qualification_descriptor, obtained from any of the mrq routines, to reverse its sense. | ||
| SYNOPSIS | addr mrqnot (addr qual_desc) | ||
| USAGE | qual_desc = mrqnot (qual_desc);
| ||
| RETURNS | Pointer (addr) to a qualification_descriptor. | ||
| WARNINGS | mrqnot destroys its argument qualification_descriptor and frees the space allocated to it, so it cannot be used again. |
| DESCRIPTION | Compare an attribute value to NULL. | ||||||
| SYNOPSIS | addr mrqnul (char* operator, addr attr_desc) | ||||||
| USAGE | qual_desc = mrqnul (operator, attr_desc);
| ||||||
| RETURNS | Pointer (addr) to a qualification_descriptor. | ||||||
| WARNINGS | None. |
| DESCRIPTION | Perform an OR operation on two qualification_descriptors obtained from any of the mrq routines. | ||||||
| SYNOPSIS |
addr mrqor (addr qual_desc_1,
addr qual_desc_2)
| ||||||
| USAGE |
qual_desc = mrqor (qual_desc_1,
qual_desc_2);
| ||||||
| RETURNS | Pointer (addr) to a qualification_descriptor. | ||||||
| WARNINGS | mrqor destroys the qualification_descriptors in its argument list and frees the space allocated to them, so they cannot be used again. |
| DESCRIPTION | Compare an attribute value to a given range. The limits of the range are specified as pointers to file format values. Pointers returned by the mrcvt routines may be used. | ||||||||||||||||
| SYNOPSIS |
addr mrqrng (addr attr_desc, addr lower_limit,
char limit_type_1,
addr upper_limit,
char limit_type_2)
| ||||||||||||||||
| USAGE |
qual_desc = mrqrng (attr_desc, lower_limit,
limit_type_1, upper_limit,
limit_type_2);
qual_desc = mrqrng (attr_desc,
mrcvtv (attr_desc, string_1),
limit_type_1,
mrcvtv2 (attr_desc, string_2),
limit_type_2);
| ||||||||||||||||
| RETURNS | Pointer (addr) to a qualification_descriptor. | ||||||||||||||||
| WARNINGS | None. |
| DESCRIPTION | Test if an attribute value is equal to a string. | ||||||
| SYNOPSIS | addr mrqseq (addr attr_desc, char* string) | ||||||
| USAGE | qual_desc = mrqseq (attr_desc, string);
| ||||||
| RETURNS | Pointer (addr) to a qualification_descriptor. | ||||||
| WARNINGS | The routine will fail and terminate the calling program if the string cannot be converted to a legal attribute value of the correct data type. |
| DESCRIPTION | Changes the size of the space allocated by mrmalloc. | ||||||
| SYNOPSIS | void* mrrealloc (void* space, int size) | ||||||
| USAGE | realloc_space = mrrealloc (space, size);
| ||||||
| RETURNS | Pointer (void*) to space allocated which will be used by Empress RDBMS. | ||||||
| WARNINGS | The space will remain allocated until freed by mrfree. |
| DESCRIPTION | Make a second or subsequent attempt to retrieve a record from a table. | ||||
| SYNOPSIS | int mrreget (addr retrieval_desc) | ||||
| USAGE | flag = mrreget (retrieval_desc);
| ||||
| RETURNS | 1 if successful; 0 when all records have been retrieved; and -1 if the record is locked. If the routine fails, the variable mroperr will contain one of the MRER... codes described in the header file mrerrno.h, and may be examined to determine the cause of failure. | ||||
| WARNINGS | mrgetend should be called after one or more calls to mrreget to do cleaning up. |
| DESCRIPTION | Make a second or subsequent attempt to retrieve the previous record from a table. | ||||
| SYNOPSIS | int mrreprev (addr retrieval_desc) | ||||
| USAGE | flag = mrreprev (retrieval_desc);
| ||||
| RETURNS | 1 if successful; 0 when all records have been retrieved; and -1 if the record is locked. If the routine fails, the variable mroperr will contain one of the MRER... codes described in the header file mrerrno.h, and may be examined to determine the cause of failure. | ||||
| WARNINGS | mrgetend should be called after one or more calls to mrreprev to do cleaning up. |
| DESCRIPTION | Assign a NULL value to all attributes in a record. | ||||
| SYNOPSIS | msbool mrsetnr (addr record_desc) | ||||
| USAGE | flag = mrsetnr (record_desc);
| ||||
| RETURNS | Return true if successful; false otherwise. | ||||
| WARNINGS | None. |
| DESCRIPTION | Assign a NULL value to a given attribute in a record. | ||||||
| SYNOPSIS | msbool mrsetnv (addr record_desc, addr attr_desc) | ||||||
| USAGE | flag = mrsetnv (record_desc, attr_desc);
| ||||||
| RETURNS | Return true if successful; false otherwise. | ||||||
| WARNINGS | None. |
| DESCRIPTION | Allocate space to store an external format attribute value. | ||||
| SYNOPSIS | char* mrspv (addr attr_desc) | ||||
| USAGE | space = mrspv (attr_desc);
| ||||
| RETURNS | Pointer (char*) to space allocated for storage of the external format attribute value. If used on a text or bulk data type attribute, it returns a zero pointer. | ||||
| WARNINGS | The space will remain allocated until explicitly freed by calling mrfree. The routine cannot be used to allocate space for TEXT or BULK data type attributes. |
| DESCRIPTION | Associate a given qualification with one or more records for sorted output; terminate the calling program on failure. | ||||||||||||||||||
| SYNOPSIS |
addr mrsrtbegin (addr qual_desc, char indicator,
addr record_desc_1,
[ ... addr record_desc_n,] (addr)0,
addr attr_desc_1, char type,
[ ... addr attr_desc_n, char type,]
(addr)0)
| ||||||||||||||||||
| USAGE |
retrieval_desc = mrsrtbegin (qual_desc, indicator,
record_desc_1, record_desc_2, ... , ADDRNIL,
attr_desc_1, type, attr_desc_2, type, .... ,
ADDRNIL);
| ||||||||||||||||||
| RETURNS | Pointer (addr) to a retrieval_descriptor which is used by mrget. | ||||||||||||||||||
| WARNINGS | Use of two records implies a cross-product or join (see mrget), so the two records should be from different tables. All the attribute_descriptors in the mrq routines used to generate the qualification_descriptor should belong to the table_descriptor(s) corresponding to the record_descriptor(s) given as arguments to mrsrtbegin, or the procedure will fail. Any qualification_descriptor passed to mrsrtbegin will be destroyed, and cannot be re-used. |
| DESCRIPTION | Initiates the start of an update operation of data segment. | ||||
| SYNOPSIS | msbool mrsubbegin (addr record_desc) | ||||
| USAGE | flag = mrsubbegin (record_desc);
| ||||
| RETURNS | Return true if successful; false otherwise. | ||||
| WARNINGS | mrsubbegin will activate locking for partial updates. It is recommended that this call is made before an mradd or mrput call inside the same insert or update loop. If you want proper locking behaviour you must put all your partial updates of data segment inside the record between mrsubbegin and mrsubend. |
| DESCRIPTION | Indicates the end of an update operation of data segment. | ||||
| SYNOPSIS | msbool mrsubend (addr record_desc) | ||||
| USAGE | flag = mrsubend (record_desc);
| ||||
| RETURNS | Return true if successful; false otherwise. | ||||
| WARNINGS | None. |
| DESCRIPTION | This routine retrieves a segment of data from a BULK or TEXT attribute. | ||||||||||
| SYNOPSIS |
long mrsubgeti (mrrdes* rec, mrades* mra, addr* buktxtint,
long offset, long size)
| ||||||||||
| USAGE | flag = mrsubgeti (rec, mra, buktxtint, offset, size);
| ||||||||||
| RETURNS | Returns -1 on failure. | ||||||||||
| WARNINGS | In order to retrieve a data segment smaller than the entire data, the .dtf file checksum must be turned off (zero) for the table in question. Also notice that buktxtint is a pointer to a pointer, not the same as the simple pointer buktxtint in mrsubputi. |
| DESCRIPTION | This routine performs a data segment update for BULK or TEXT data type. It overwrites the sections of data within the attribute. | ||||||||
| SYNOPSIS |
long mrsubputi (mrrdes* rec, mrades* mra,
addr buktxtint, long offset)
| ||||||||
| USAGE | flag = mrsubputi (rec, mra, buktxtint, offset);
| ||||||||
| RETURNS | Returns -1 on failure. | ||||||||
| WARNINGS | None.
|
| DESCRIPTION | Insert a record into a given table, indicating whether the insertion was successful or not. mrtadd should be used when an attribute has a unique index on it. | ||||
| SYNOPSIS | msbool mrtadd (addr record_desc) | ||||
| USAGE | flag = mrtadd (record_desc);
| ||||
| RETURNS | True (1) if successful; false (0) if unsuccessful. If the routine is unsuccessful, the variable mroperr will contain one of the MRER... codes described in the header file mrerrno.h, and may be examined to determine the cause of failure. | ||||
| WARNINGS | mraddend should be called to clean up after one or more calls to mrtadd. |
| DESCRIPTION | Delete a record from a table; do not terminate if unsuccessful. | ||||
| SYNOPSIS | msbool mrtdel (addr record_desc) | ||||
| USAGE | flag = mrtdel (record_desc);
| ||||
| RETURNS | True (1) if successful; false (0) if not. If the routine is unsuccessful, the variable mroperr will contain one of the MRER... codes described in the header file mrerrno.h, and may be examined to determine the cause of failure. | ||||
| WARNINGS | The record must first have been specified in a call to one of the mrgetbegin routines and then retrieved by a successful call to one of the mrget routines. mrdelend should be called to do cleaning up after one or more calls to mrtdel. |
| DESCRIPTION | Retrieve a record from a table; do not terminate calling program if unsuccessful. | ||||
| SYNOPSIS | int mrtget (addr retrieval_desc) | ||||
| USAGE | flag = mrtget (retrieval_desc);
| ||||
| RETURNS | 1 if successful; 0 when all records have been retrieved; and -1 if the record is locked. If the routine is unsuccessful, the variable mroperr will contain one of the MRER... codes described in the header filemrerrno.h, and may be examined to determine the cause of failure. | ||||
| WARNINGS | mrgetend should be called to do cleaning up after one or more calls to mrtget. |
| DESCRIPTION | Find the count, sum, average, minimum, or maximum value for an attribute; do not terminate the calling program if unsuccessful. | ||||||||||
| SYNOPSIS |
char* mrtgfunc (char* function,
addr retrieval_desc,
addr record_desc,
addr attr_desc)
| ||||||||||
| USAGE |
value = mrtgfunc (function, retrieval_desc,
record_desc, attr_desc);
| ||||||||||
| RETURNS | A pointer (char*) to the value of the function, or CHARNIL if not all the appropriate records could be accessed. If the routine is unsuccessful, the variable mroperr will contain one of the MRER... codes described in the header file mrerrno.h, and may be examined to determine the cause of failure. If there are no records, an empty string is returned. | ||||||||||
| WARNINGS | mrgetend must be called to do cleaning up after mrgfunc, and the value found should be freed with mrfree. |
| DESCRIPTION | Associate a given qualification with one or more records. Do not terminate the calling program if unsuccessful. | ||||||||||
| SYNOPSIS |
addr mrtgtbegin (addr qual_desc, addr record_desc_1,
[ ... addr record_desc_n,] (addr)0)
| ||||||||||
| USAGE |
retrieval_desc = mrtgtbegin (qual_desc, record_desc_1,
record_desc_2, .... , ADDRNIL);
| ||||||||||
| RETURNS | Pointer (addr) to a retrieval_descriptor to be passed to one of the mrget routines if all appropriate records could be accessed; (addr)0 (ADDRNIL) otherwise. If the routine is unsuccessful, the variable mroperr will contain one of the MRER... codes described in the header file mrerrno.h, and may be examined to determine the cause of failure. | ||||||||||
| WARNINGS | Use of two or more records implies a cross-product or join (see mrget), so the record_descriptors must be derived from different table_descriptors. All the attribute_descriptors in the mrq routines used to generate the qualification_descriptor must belong to the table_descriptor(s) corresponding to the record_descriptor(s) given as arguments to mrtgtbegin, or the procedure will fail. Any qualification_descriptor passed to mrtgtbegin will be destroyed, and cannot be re-used. |
| DESCRIPTION | Open a data dictionary for internal access by the mr routines; do not terminate the calling program if unsuccessful. | ||||||
| SYNOPSIS |
msbool mrtopdict (char* database_name,
char mode)
| ||||||
| USAGE | flag = mrtopdict (database_name, mode);
| ||||||
| RETURNS | True (1) if successful, false (0) on failure. If the routine is unsuccessful, the variable mroperr will contain one of the MRER... codes listed in the header file mrerrno.h, and may be examined to determine the cause of failure. | ||||||
| WARNINGS | It is generally unwise to specify the current directory when calling mropdict (i.e., you should not run applications while in the database directory), because of the danger of damaging files in the database when new files are created. If read mode is specified and the person executing the program has no read permission on the data dictionary tables, or if update mode is specified and the person executing the program has no read and write permission on the data dictionary tables, mrtopdict will fail. |
| DESCRIPTION | Open a table for use with the mr routines; do not terminate if unsuccessful. The table is set up for locking at the level indicated in the data dictionary. If table level locking is set, the table is locked by this routine. | ||||||||
| SYNOPSIS |
addr mrtopen (char* database_name,
char* table_name,
char mode)
| ||||||||
| USAGE |
table_desc = mrtopen (database_name,
table_name, mode);
| ||||||||
| RETURNS | Pointer (addr) to table_descriptor if successful; a zero pointer if unsuccessful. If the routine is unsuccessful, the variable mroperr will contain one of the MRER... codes described in the header file mrerrno.h, and may be examined to determine the cause of failure. | ||||||||
| WARNINGS | It is generally unwise to specify the current directory when calling mrtopen (i.e., you should not run applications while in the database directory), because of the danger of damaging files in the database when new files are created. If read mode is specified and the person executing the program has no read permission on the data dictionary tables, or if update mode is specified and the person executing the program has no read and write permission on the data dictionary tables, mrtopen will not succeed. |
| DESCRIPTION | Retrieve the previous record from a table; do not terminate calling program if unsuccessful. | ||||
| SYNOPSIS | int mrtprev (addr retrieval_desc) | ||||
| USAGE | flag = mrtprev (retrieval_desc);
| ||||
| RETURNS | 1 if successful; 0 when all records have been retrieved; and -1 if the record is locked. If the routine is unsuccessful, the variable mroperr will contain one of the MRER... codes described in the header file mrerrno.h, and may be examined to determine the cause of failure. | ||||
| WARNINGS | mrgetend should be called to do cleaning up after one or more calls to mrtprev. |
| DESCRIPTION | Update a record, indicating success or failure of the update. mrtput should be used when an attribute has a unique index on it. | ||||||
| SYNOPSIS |
msbool mrtput (addr new_rec_desc,
addr old_rec_desc)
| ||||||
| USAGE | flag = mrtput (new_rec_desc, old_rec_desc);
| ||||||
| RETURNS | True (1) if successful; false (0) if unsuccessful. If the routine is unsuccessful, the variable mroperr will contain one of the MRER... codes described in the header file mrerrno.h, and may be examined to determine the cause of failure. | ||||||
| WARNINGS | The original record_descriptor must point to a record which has been retrieved by calls to mrgetbegin and mrget, otherwise mrtput will fail. |
| DESCRIPTION | Compare an attribute value to another attribute value; report if unsuccessful. | ||||||||
| SYNOPSIS |
addr mrtqatr (char* operator,
addr attr_desc_1,
addr attr_desc_2)
| ||||||||
| USAGE |
qual_desc = mrtqatr (operator, attr_desc_1,
attr_desc_2);
| ||||||||
| RETURNS | Pointer (addr) to a qualification_descriptor; ADDRNIL (addr)0 on failure. If the routine is unsuccessful, the variable mroperr will contain one of the MRER... codes described in the header file mrerrno.h, and may be examined to determine the cause of failure. | ||||||||
| WARNINGS | The two attributes compared must be compatible, otherwise mrtqatr will fail. |
| DESCRIPTION | Compare an attribute value with a constant in file format; report if unsuccessful. A pointer to a file format constant returned by one of the mrcvt routines may be used. | ||||||||||
| SYNOPSIS |
addr mrtqcon (char* operator,
addr attr_desc,
addr var_ptr)
| ||||||||||
| USAGE |
qual_desc = mrtqcon (operator, attr_desc,
&var);
qual_desc = mrtqcon (operator, attr_desc,
mrcvt (attr_desc, string));
| ||||||||||
| RETURNS | Pointer (addr) to a qualification_descriptor; ADDRNIL (addr)0 on failure. If the routine is unsuccessful, the variable mroperr will contain one of the MRER... codes described in the header file mrerrno.h, and may be examined to determine the cause of failure. | ||||||||||
| WARNINGS | None. |
| DESCRIPTION | Compare an attribute value to a pattern; report if unsuccessful. | ||||||||
| SYNOPSIS |
addr mrtqmch (char* operator,
addr attr_desc,
char* pattern)
| ||||||||
| USAGE |
qual_desc = mrtqmch (operator, attr_desc,
pattern);
| ||||||||
| RETURNS | Pointer (addr) to a qualification_descriptor; ADDRNIL (addr)0 on failure. If the routine is unsuccessful, the variable mroperr will contain one of the MRER... codes described in the header file mrerrno.h, and may be examined to determine the cause of failure. | ||||||||
| WARNINGS | None. |
| DESCRIPTION | Compare an attribute value to NULL; report if unsuccessful. | ||||||
| SYNOPSIS | addr mrtqnul (char* operator, addr attr_desc) | ||||||
| USAGE | qual_desc = mrtqnul (operator, attr_desc);
| ||||||
| RETURNS | Pointer (addr) to a qualification_descriptor; ADDRNIL (addr)0 on failure. If the routine is unsuccessful, the variable mroperr will contain one of the MRER... codes described in the header file mrerrno.h, and may be examined to determine the cause of failure. | ||||||
| WARNINGS | None. |
| DESCRIPTION | Compare an attribute value to a given range; report if unsuccessful. | ||||||||||||||||
| SYNOPSIS |
addr mrtqrng (addr attr_desc,
addr lower_limit,
char limit_type_1,
addr upper_limit,
char limit_type_2)
| ||||||||||||||||
| USAGE |
qual_desc = mrtqrng (attr_desc, lower_limit,
limit_type_1, upper_limit,
limit_type_2);
qual_desc = mrtqrng (attr_desc,
mrcvtv (attr_desc, string_1),
limit_type_1,
mrcvtv2 (attr_desc, string_2),
limit_type_2);
| ||||||||||||||||
| RETURNS | Pointer (addr) to a qualification_descriptor; ADDRNIL (addr)0 if unsuccessful. If the routine fails, the variable mroperr will contain one of the MRER... codes described in the header file mrerrno.h, and may be examined to determine the cause of failure. | ||||||||||||||||
| WARNINGS | None. |
| DESCRIPTION | Cancel a transaction and return the database to its former condition. | ||
| SYNOPSIS | msbool mrtrcancel (void) | ||
| USAGE | flag = mrtrcancel ();
| ||
| RETURNS | True (1) if successful; false (0) if unsuccessful. | ||
| WARNINGS | None. |
| DESCRIPTION | Commit a transaction and make all changes to the database permanent. | ||
| SYNOPSIS | msbool mrtrcommit (void) | ||
| USAGE | flag = mrtrcommit ();
| ||
| RETURNS | True (1) if successful; false (0) if unsuccessful. | ||
| WARNINGS | A transaction must be in progress. |
| DESCRIPTION | Roll back the transaction to the save point. | ||||
| SYNOPSIS | msbool mrtrrollback (char* savepoint) | ||||
| USAGE | flag = mrtrrollback (savepoint);
| ||||
| RETURNS | True (1) if successful; false (0) if unsuccessful. | ||||
| WARNINGS | A transaction must be in progress and the save point must be set. If mrtrrollback is called after delete or update of a record within mrgetbegin and mrgetend, the content of the record becomes undefined. |
| DESCRIPTION | Set a save point in the transaction. | ||||
| SYNOPSIS | msbool mrtrsave (char* savepoint) | ||||
| USAGE | flag = mrtrsave (savepoint);
| ||||
| RETURNS | True (1) if successful; false (0) if unsuccessful. | ||||
| WARNINGS | A transaction must be in progress. |
| DESCRIPTION | Start a transaction. | ||
| SYNOPSIS | msbool mrtrstart (void) | ||
| USAGE | flag = mrtrstart ();
| ||
| RETURNS | True (1) if a transaction is started; false (0) if not. Failure usually means a transaction is already in progress. | ||
| WARNINGS | None. |
| DESCRIPTION | Associate a given qualification with one or more records for sorted output; do not terminate the calling program on failure. | ||||||||||||||||
| SYNOPSIS |
addr mrtsrbegin (addr qual_desc, char indicator,
addr record_desc_1,
[ ... addr record_desc_n,] (addr)0,
addr attr_desc_1, char type,
[ ... addr attr_desc_n, char type,] (addr)0)
| ||||||||||||||||
| USAGE |
retrieval_desc = mrtsrbegin (qual_desc, indicator, record_desc_1,
record_desc_2, .... , ADDRNIL, attr_desc_1, type,
attr_desc_2, type, .... , ADDRNIL);
| ||||||||||||||||
| RETURNS | Pointer (addr) to a retrieval_descriptor which is used by mrget if all appropriate records could be accessed; ADDRNIL (addr)0 otherwise. If the routine fails, the variable mroperr will contain one of the MRER... codes described in the header file mrerrno.h, and may be examined to determine the cause of failure. | ||||||||||||||||
| WARNINGS | Use of two records implies a cross-product or join (see mrget), so the two records should be from different tables. All the attribute_descriptors in the mrq routines used to generate the qualification_descriptor should belong to the table_descriptor(s) corresponding to the record_descriptor(s) given as arguments to mrtsrbegin, or the procedure will fail. Any qualification_descriptor passed to mrtsrbegin will be destroyed, and cannot be re-used. |
| DESCRIPTION | Unlock a record. This routine is used to unlock records that have been retrieved using mrgetrec, and to release locks created with mrlkrec. | ||||
| SYNOPSIS | msbool mrulrec (addr record_desc) | ||||
| USAGE | flag = mrulrec (record_desc);
| ||||
| RETURNS | Return true if successful; false otherwise. | ||||
| WARNINGS | The routine will fail if the record is not locked. |
| DESCRIPTION | Unlock a table after running an application. | ||||
| SYNOPSIS | msbool mrultab (addr table_desc) | ||||
| USAGE | flag = mrultab (table_desc);
| ||||
| RETURNS | Return true if successful; false otherwise. | ||||
| WARNINGS | None. |
| DESCRIPTION | Sets options on a statement handle. mrsetstmtoption will modify the expected behavior of mr routines that retrieve, insert, update and delete records. The concept of a connection and a statement handle will be introduced in the future. Current mrsetstmtoption routine uses a default statement handle MRSTMT_DEFAULT. | ||||||||||||||||||||||
| SYNOPSIS | msbool mrsetstmtoption (addr stmthandle, int option, addr arg) | ||||||||||||||||||||||
| USAGE | flag = mrsetstmtoption (stmthandle, option, arg>);
| ||||||||||||||||||||||
| RETURNS | Return true if successful; false otherwise. | ||||||||||||||||||||||
| WARNINGS | None. |