SQL/MX 3.2 Management Manual (H06.25+, J06.14+)

Table Of Contents
Steps for Adding a Trigger
1. Start an MXCI session. Enter a LOG command to initiate a log file for statements and commands
entered in this session. Keep the log for your records.
2. Determine the name of the table to which you want to add the trigger.
3. Query the system metadata to ensure the new trigger name is unique among existing trigger
names defined in the schema.
4. Use the DISPLAY USE OF command to identify which user modules are associated with this
object. See the similarity check criteria in the SQL/MX Programming Manual for C and COBOL
to determine if your changes are likely to cause similarly check to fail and force automatic
recompilation. If they will, you should SQL compile these modules after making the changes
to avoid expensive automatic recompilations at run time. SQL applications that are running
while you make these changes will still undergo automatic recompilation.
For more information about explicit and automatic recompilation, see the SQL/MX Programming
Manual for C and COBOL. For more information about using DISPLAY USE OF, see “Checking
Module Dependencies with DISPLAY USE OF” (page 223)and the SQL/MX Reference Manual.
5. Enter the CREATE TRIGGER statement.
6. Revise the application source code as needed to reflect your changes to the database. Process
and compile the updated source file. For more information, see the SQL/MX Programming
Manual for C and COBOL.
For more information, see “Creating Triggers” (page 101).
Adding Views
To add a view, use the CREATE VIEW statement.
Steps for Adding a View
1. Start an MXCI session. Enter a LOG command to initiate a log file for statements and commands
entered in this session. Keep the log for your records.
2. Determine the names of any tables whose columns you want to include in the view., and a
name for the view you want to add.
3. Query the system metadata to ensure the new view name is unique among existing view,
table, SQL/MP alias and SPJ names in the schema.
4. Determine the column names of the view and the column names of the underlying table or
tables of the view. To display the columns of the underlying table or tables, you can use MXCI
as described in “Displaying the Attributes of a Column” (page 142).
5. Enter the CREATE VIEW statement.
6. Use the GRANT statement to set access privileges for the new view, if necessary.
7. Make a new TMF online dump containing the view.
For more information, see “Creating Views of SQL/MX Tables” (page 100) and the SQL/MX
Reference Manual.
Altering Objects in an SQL/MX Database
Table 10 (page 160) summarizes the database objects that you can alter and identifies the statements,
commands, or utilities to use.
Table 10 Altering Objects in an SQL/MX Database
Statement, Command or UtilityOperationObject
ALTER INDEX statement FIXUP utilityChange attributesIndex
MODIFY utility
nl
Add partition
nl
Partition
MODIFY utility
nl
Drop partition
nl
160 Adding, Altering, and Dropping SQL/MX Database Objects