---- Readme for DBDK 3.6 Examples ---- ---- Informix Software, Inc. (C) 1997 ---- This directory contains several example DataBlade modules that demonstrate simple extensibility of the Informix Universal Server. The example modules included with version 3.6 of the Developers Kit, and available here, are: Routines/dapi/BusinessMath Sample business math functions to compute a payment schedule for a loan, the present value of a loan, and the future value of a loan. Routines/dapi/FuzzyMatch How to write a custom data matching function. Routines/dapi/PartsExplode A parts explosion demonstration, which shows how to use SQL queries inside C server functions to recursively expand a parts hierarchy. Routines/dapi/QueryData How to make SQL query calls from within the DataBlade API. Routines/dapi/Strings This sample DataBlade determines if one string contains another. Routines/dapi/TopKTerms Demonstrates how to write an iterator function that takes a set as an argument and returns a set. Routines/MMX/ImageScaling This example shows how to use embedded Intel MMX assembly instructions in a DataBlade. This example is for NT only. Routines/MMX/Strings This sample DataBlade uses MMX technology to determine if one string contains another. Client/c++api/UDTExporter How to access opaque data from client application using the C++ interface. Client/esqlc/UDTExporter How to access opaque data from an ESQL/C client application. DataBlade module which supports the client example. Client/c++api/UDTExporter/server or Client/esqlc/UDTExporter/server DataBlade module which supports the client examples. Types/dapi/Circle Two user-defined types (point and circle) and functions that operate over them to compute containment and distance. Types/dapi/Matrix An abstract data type that implements a 2D matrix of double precision numbers, and implements mathematical operations (addition and multiplication) on them. Types/dapi/MultiRepLO This example demonstrates how to use multirepresentational types. Types/MMX/Matrix This sample DataBlade uses MMX technology to multiply a matrix by a vector to get another vector. Indicies/RTree This is a sample implementation of an RTree index. Each of these examples includes a BladeSmith project file and source code, SQL registration scripts for use with BladeManager, a simple installation files for use with BladePack, and functional tests. Compiled binaries for the examples are not included and must be re-built using the source files. Building on UNIX ================ 1. Building the Shared Object File To re-build the binaries, you must first transfer the files to a Solaris machine, or copy the examples to an NFS mounted directory so they are accessible from both Solaris and NT. When transferring text files to a Unix machine, be sure to convert the carriage return/newlines to a Unix format (i.e. use ftp in text mode to do the conversion). Here is a description of how to build the Circle.3.6 example: On NT (to ftp files to Solaris machine): cd dbdk/examples/Types/dapi/Circle/src/C ftp > cd /Circle/src/C > ascii > prompt > mput * On Solaris (to build example): cd /Circle/src/C setenv INFORMIXDIR setenv CC setnev LD If the Informix Universal Server version is 9.1X use the following to build the blade. make -f UNIX.mak TARGET=$INFORMIXDIR/incl/dbdk/makeinc1.sol If the Informix Universal Server version is 9.20 use the following to build the blade. make -f UNIX.mak TARGET=$INFORMIXDIR/incl/dbdk/makeinc.solaris * Note that the makeinc1.sol file is shipped with the IUS server and is platform and compiler specific. After the make finishes, you will have a new shared object file, called /Circle/src/C/solaris-sparc/Circle.bld On NT (to ftp resulting binary to NT machine): cd /circle/src/C mkdir solaris-sparc cd solaris-sparc ftp > cd /Circle/src/C/solaris-sparc > bin > prompt > mget *.bld 2. Packaging the DataBlade Once the shared object file has been produced, you must use BladePack to copy it, and the associated project SQL scripts to the Informix server extension directory. On your NT machine, invoke BladePack on the file /Circle/install/Circle.prd and build the installation package. This creates a directory /Circle/cdrom which contains the shared object file, associated SQL scripts and an install script. Transfer the complete cdrom directory to your Solaris machine. Login as user "informix" and invoke the install script in the cdrom directory: > su informix > cd /Circle/cdrom > ./install The install script prompts for user input, select the default values: Target Directory: $INFORMIXDIR Installation Type: Typical The example DataBlade module will now appear automatically the next time BladeManager connects to the server from any NT or Solaris machine. 3. Registering the DataBlade To register the module in a database, use BladeManager to choose the appropriate database, and DataBlade module, and let it do the work. Building on NT for an NT server =============================== 1. Building the Shared Object File To build the example on NT: cd /Circle/src/C setenv INFORMIXDIR (for example, "setenv INFORMIXDIR c:\informix") nmake -f WinNT.mak The resultant DataBlade object file is placed in the WinNT-i386 subdirectory. Alternately, you may start the Microsoft Developer Studio and open the .mak project makefile. Open the makefile as a project workspace. Build the project by selecting Build/Rebuild all. This will compile the DataBlade module and place it in the Debug directory. A Release version may be built by selecting Build/Set Default Configuration /Releasefrom the program menu. Once built, the .bld file must be marked as read-only: attrib +R .bld The DataBlade will not work correctly if it is not marked as a read-only file. 2. Packaging the DataBlade Packaging the DataBlade requires InstallShield version 3.x. Once the shared object file has been produced, you must use BladePack to copy it, and the associated project SQL scripts to the Informix server extension directory. On your NT machine, invoke BladePack on the file /Circle/install/Circle.prd and build the installation package. This creates a directory /Circle/cdrom which contains the shared object file, associated SQL scripts and an install script. When building an NT installation, be sure to select WinNT/i386 (solaris/sparc is the default). Transfer the complete cdrom directory to your NT server machine. Login as user "informix" and invoke the install script in the cdrom directory: > cd /Circle/cdrom > ./setup.exe Note : Sometimes, you may find an error 'Paramater not correct' message box, while executing the setup.exe. This is due to the limitation of Installl Shield with respect to the path length limit / directory depth. Please copy the cdrom/ directory to a c:\temp\cdrom directory and execute the setup.exe program from that location to install the example. The install script prompts for user input, select the default values: Target Directory: $INFORMIXDIR Installation Type: Typical The example DataBlade module will now appear automatically the next time BladeManager connects to the server from any NT or Solaris machine. 3. Registering the DataBlade To register the module in a database, use BladeManager to choose the appropriate database, and DataBlade module, and let it do the work.