Creating Custom Scripts

The custom scripts can be created in a text editor, such as Notepad, Textpad, or Oracle SQL Developer. The script may be as short as a single SQL statement, but if it is longer, a delimiter is required between statements. The required delimiter is the forward slash character ("/") on a separate line by itself. Note that stored procedures may be executed in these scripts.

The script is pasted or otherwise loaded into the SCRIPT column of the HPM_SQL_SCRIPT table, as shown in HPM_SQL_SCRIPT. Do not type the script directly into the HPM_SQL_SCRIPT table.

Caution:

Only the system administrator who has the password to the HPM Product schema can create pre- and post-scripts.

To create and load a custom script:

  1. Create the custom script within a text editor, such as Notepad, Textpad, or Oracle SQL Developer.
  2. Using Oracle SQL Developer, open the HPM_SQL_SCRIPT table. The table should be in the HPM Product Schema, in the same location as the product tables.
  3. Insert a new row.
  4. Enter the required values in the table, including the script type. See HPM_SQL_SCRIPT.
  5. Copy the script into the SCRIPT column, as follows:
    • For Oracle using SQL Developer, copy and paste the script from a text editor, or use an update statement to populate the SCRIPT column. Here is an example of a SQL script for Oracle:

      update my_table set my_column =5
      /
      update your_table set your_column =6
      /
      begin myproc; end;
      /
    • For Microsoft SQL Server using SQL Studio, use an Update statement to populate the SCRIPT column. Here is an example of a SQL script for SQL Server:

      update my_table set my_column =5
      /
      update your_table set your_column =6
      /
      begin execute my_proc end
      /

      Caution:

      You must include the delimiter "/" between multiple SQL statements in the same script. The "/"character must be on a line by itself at the end of each statement. Be sure the final "/" is followed by a newline character.