Home |
Previous Page | Next Page Programming DataBlade Module Routines in C > Editing Routines in udr.c >
BladeSmith generates only minimal code for most routines
you create with the Routine wizard.
The Generated Code
BladeSmith generates only templates for most user-defined
routines.
The generated routine declares the routine, its return type,
and arguments. In addition to the arguments you specified when creating
the routine, these functions also have an MI_FPARAM argument.
Only generated routines that allow null values have code that uses
the MI_FPARAM argument. The generated code
in these routines uses MI_FPARAM to set
the return value of the routine to NULL.
Completing the Code
To complete the code for most user-defined routines, you
must:
- Add your declarations, if necessary.
- Remove the call to mi_db_error_raise(),
which raises an error stating that the routine is not implemented.
- Compute the return value and store it in the Gen_RetVal argument.
- Remove the call to mi_fp_setreturnisnull() that
sets the return value of your routine to NULL, if necessary.
For more information on programming routines, see the IBM Informix: DataBlade API Programmer's Guide.
Examples
The following example DataBlade modules have user-defined
routines:
- Business DataBlade module. Provides mathematic
functions for calculating loans.
- Circle DataBlade module. Provides distance
and containment functions that operate on opaque data types.
- FuzzyMatch DataBlade module. Provides
functions for handling row data types and comparing opaque data
types.
- Parts Explosion DataBlade module and DataBladeAPI DataBlade module. Provide
functions for handling and returning collection data types.
- Strings DataBlade module. Provides character-string
manipulation functions.
The Mercury DataBlade module exercise in the tutorial provides
examples of cast support functions.
Home |
[ Top of Page | Previous Page | Next Page | Contents |
Index ]