The purpose of the C stored function framework (framework, for
short) is to allow easy introduction of new functionality into the MIM
server. The main advantage of the code written within the C stored
function framework is that the stored function implementation can access
any of the internal MIM objects (such as SchSchema object,
for example).
New functionality written within the framework can be called in the
"usual" way, using the following bmim_client query, for
example:
%exec.units: 1 hour
SHOW
1: slice (10, 15, 2004)
WHEN
Date is after 1/1/2004
AND
Date is Wednesdaywhere slice is the name of the C stored
function.
This document is structured as follows.
the section called “Structure of a C Stored Function” describes the components of C stored functions.
the section called “Stored Function Framework” describes the utility functions available to writers of C stored functions. These utility functions expose part of the functionality of the MIM server.
the section called “Stored Function Life Cycle” describes the way the MIM server interacts with a C stored function while executing a user query.
the section called “Example: Providing a C Stored Function Wrapper for an Existing C Function” illustrates a complete example. Readers may wish to skim over the material in the section called “Structure of a C Stored Function” through the section called “Stored Function Life Cycle”, and then review that material after reading the section called “Example: Providing a C Stored Function Wrapper for an Existing C Function”.
the section called “Complete Predictor Code” and the section called “Complete Lazy Predictor Code” contain all the source code for the examples.