informix
DataBlade Developers Kit User's Guide
Creating DataBlade Objects Using BladeSmith

Adding SQL Files

BladeSmith allows you to add custom SQL commands to the scripts that describe a DataBlade module and its objects. You can include SQL commands to create tables, indexes, or SPL procedures your DataBlade module requires. For example, if your DataBlade module uses smart large objects, you can include a statement to test for the required sbspace when you register the DataBlade module. For information, see Appendix C, Testing for an Sbspace.

Use the three-character new object prefix assigned to your project in the name of every custom SQL object you create. The maximum size of an SQL file is 20 KB.

If you create any objects for your DataBlade module, add corresponding SQL DROP statements so that the objects are dropped when your DataBlade module is unregistered.

To add custom SQL, start the wizard by choosing Edit Insert SQL Files. Enter SQL commands directly into the BladeSmith edit window, or import a disk file into the BladeSmith project. When you import a file, copy the contents of the file at the time you import, or import the file by reference so that its contents are copied whenever you generate SQL scripts.

The following table lists the properties you specify when you include custom SQL statements.

Property Default Value Description
Descriptive name SQLfile A descriptive name for the custom SQL statements.
Read SQL text from file None Use to import SQL statements into the CREATE and DROP fields or to import by reference. See Importing SQL Text from a File for more information.
Custom SQL CREATE text None A text field in which to type SQL CREATE statements.
Custom SQL DROP text None A text field in which to type SQL DROP statements.
Depends on objects None A list of objects on which the custom SQL depends. See Object Dependencies for more information.
Which objects require SQL None A list of objects that depend on the custom SQL. See Object Dependencies for more information.

The following sections describe properties of custom SQL files.

Importing SQL Text from a File

If you import SQL statements from a text file, separate the CREATE and DROP statements with a line of 40 hyphens ( - ). To import a file by reference, click Browse and select a file from the Open dialog box. If you import by reference, BladeSmith stores the full path and filename.

Object Dependencies

You can specify whether an SQL command depends upon a DataBlade module object or upon your SQL. These dependencies determine the sequence of SQL commands in the generated objects.sql script. BladeSmith generates SQL in the following sequence:

  1. SQL commands to create objects upon which custom SQL commands depend
  2. Custom SQL commands
  3. SQL commands to create objects that depend upon custom SQL commands

The generated SQL scripts register dependencies when the DataBlade module is registered in a database.


DataBlade Developers Kit User's Guide, Version 4.0
Copyright © 1999, Informix Software, Inc. All rights reserved