INFORMIX
DataBlade Developers Kit User's Guide
Appendix C: Testing for an Sbspace
Home Contents Index Master Index New Book

Testing for an Sbspace

If you DataBlade module contains data types that contain smart large object data (BLOB and CLOB data types), an sbspace to store the smart large object must exist for each database in which users register the DataBlade module. If the required sbspace does not exist, registration fails.

You can test for the existence of a particular sbspace when BladeManager prepares your DataBlade module for registration using the following procedure. If you test for the sbspace and it does not exist, registration fails and BladeManager writes an error message to the registration log. If you do not test for the sbspace and it does not exist, registration fails with an obscure error message.

To implement a test for a particular sbspace, use BladeSmith to add a custom SQL statement to your DataBlade module that executes the SYSBldTstSBSpace() function. This is the syntax of the EXECUTE FUNCTION statement that executes SYSBldTstSBSpace():

opt_name is the name of the required sbspace. To indicate the default sbspace, replace "opt_name" with " ".

To add this user-defined routine to your registration script

    1. In BladeSmith, define the DataBlade module object that has a data type of BLOB or CLOB.

    For example, create an opaque type called BigType that has a member of type BLOB.

    2. Choose Edit Insert SQL File.

    The New SQL File wizard appears.

    3. In the Descriptive name for SQL text box, type a name for the SQL file. For example, type SbspaceTest.

    4. In the Custom SQL create text text box, type the following:

    5. Click Next.

    6. To specify which data types in your DataBlade module contain smart large objects, click the appropriate objects in the These objects require this SQL box. For example, click BigType.

    7. Click Finish.

When BladeManager prepares the DataBlade module for registration, the database server executes the SYSBldTstSBSpace() function before the SQL statement to create the BigType data type. If the sbspace specified in SYSBldTstSBSpace() exists, the database server creates the dependent data type (BigType). If the sbspace does not exist, the database server writes an error to a BladeManager log file.

For more information on BladeManager, see the DataBlade Module Installation and Registration Guide.




DataBlade Developers Kit User's Guide, version 3.6
Copyright © 1998, Informix Software, Inc. All rights reserved.