SQL Command Utility

The SQL Command Utility is a powerful export and global update utility that enables you to run SQL commands and scripts against Cobra tables.

SQL is an ANSI standard computer language for accessing and manipulating databases.

For example, this SQL command returns all of the data in the CAWP table:

SELECT * FROM CAWP

This statement would return all of the data found in the CAWP table.

In addition, once a select script has been run, you can choose to save the selection criteria to one of the following file formats:
  • CSV
  • XLS
Note: The SQL Command Utility can perform all of the tasks associated with exporting ancillary data. In addition, this utility enables you to restrict the data exported. For example, you could choose to export all rates from a specific date onwards.

There are several sample scripts shipped with Cobra, for example, BDNLeg.SQL. These scripts can be found in the Cobra\Samples\Scripts folder. Most of the scripts found in this folder must be modified to work with your data. For example, many scripts contain the following:

WHERE PROGRAM = 'DEMOADV'

DEMOADV must be changed to your program name in order for the script to work properly. The following list describes a few of the scripts found in this folder:
  • DeleteActuals.sql: Use this script to delete the actual costs in the current period.
  • DropTables.sql: Use this script to drop the tables in an Oracle implementation.
  • Display Orphaned Tphase Records.sql: Use this script to select orphaned T-phase records in the T-phase table. This is useful in determining the magnitude of the data error.
Note: For a description of what a script in the Cobra\Samples\Scripts folder does, open it in a text editor such as Windows Notepad.

You can also use the SQL Command Utility as a global update command. It is very important, however, that you make a backup of your project before executing any update or delete statements in the utility. Most standard SQL commands work using this utility.

Note: Since SQL is a standard language, there are many places you can learn more about SQL. W3 Schools provides a free SQL tutorial where you will learn how to use SQL to access, define, and manipulate data. You can take this tutorial at: http://www.w3schools.com/sql/default.asp.

The SQL Command Utility provides direct access to the database. Only subject matter experts should be granted access to this menu item.