Adding Script Files

  To add a script file:

  1. In the Administration Workbench, go to Administration and select Script Editor.

  2. Click Add and enter script file details:

    • Name

    • Type—JACL Script or Java Script

      See Script Templates and JACL Scripts.

    • Filename—Any valid name containing alphanumeric characters (no spaces)

      When you create a new file, you must select a file type to use as the file extension. For example, a file named dbutil_1 with a file type of jacl will be saved on the Integrated Operational Planning server as dbutil_1.jacl. Script files are stored in /install/custom/scripting.

  3. Enter script contents.

    Script contents vary depending on the type of file. Sample JACL script:

    #
    # Common db utilities
    #
    # $Id: //interlace/projects/properties/base/main/resource/interlace/jacl/dbutils.jacl#1 $
    #
     
    proc getTableCount { connection tablename } {
     
       set sql "SELECT COUNT(*) AS CNT FROM $tablename"
       set cstmt [$connection createStatement]
       set rs [$cstmt executeQuery $sql]
       set count -1;
       if [$rs next] {
          set count [$rs getInt "CNT"]
       }
       $rs close
       $cstmt close
       return $count;
    }
     
    proc checkTableExists { connection tablename } {
     
       set sql "SELECT 1 FROM $tablename"
       set cstmt [$connection createStatement]
     
       set count 0
       java::try {
          set rs [$cstmt executeQuery $sql]
          $rs close
          set count 1
       } catch {SQLException e} {
          set count 0
       }
     
       $cstmt close
       return $count;
    }
     
    
  4. Click OK.