Editing change commands

You can edit your change commands from the Change Command Editor.
You can create a new change command in the Change Command Editor, or you can edit a change command that exists in your project.

To edit your change commands from the Change Command Editor, complete the following steps:

  1. Select your change command script from the Data Project Explorer.
  2. Right-click the script and click Open with > Change Command Editor to display your change commands in the Change Command Editor.

    You can also view your change commands in the Outline view. Use this view to decide which changes you want to make. You cannot make changes within the Outline view. The Outline view is read-only.

    Tip: If your change commands do not appear in the Outline view, there is a syntax error in the script. Check the Problems view to resolve the syntax error.
  3. Edit your change command by changing the SQL directly in the Change Command Editor. Start of change
    Tip: You can use Visual Explain functionality to view helpful information for SQL statements when you create stored procedures. To access Visual Explain, complete the following steps:
    1. In the Change Commands Editor, type a SELECT statement.
    2. Select that statement, right-click and select Visual Explain.
    The tables must already be created in the database and the connection to the database must already exist in order for you to be able to use Visual Explain. For more information about Visual Explain, see the Using Visual Explain for SQL statements topic in the DB2 Information Center.
    End of change
  4. Press Ctrl + S to save your changes. Your project is automatically refreshed when you issue the save command.
Example: You can add SQL statements to your change command:
CREATE INDEX I1 ON CMETEST.CMETEST10 (Col1, Col2, Col3, Col4,)!
CREATE FUNCTION F1 (F CHAR)
	RETURNS ROW (P1 INTEGER, P2 DOUBLE)
	LANGUAGE SQL
	CONTAINS SQL
	NO EXTERNAL ACTION
	DETERMINISTIC
	RETURN VALUES (1,0.1)!
You can also add comments such as:
--Definition of CMETEST1 database
--CMETEST schema
Tip: You can use the following comment to change the statement terminator:
--<scriptOptions statementTerminator = "!" />
Your change commands are now updated and reflect your changes.

An alternative method is to select DDL > Editfrom the Data Model Editor to bring up a dialog with the DDL statements for all of the database objects contained in the model.


Feedback

Copyright IBM Corporation 2006, 2007. All Rights Reserved.