SQL Tool

Overview

SQL Tool can display the results of SELECT SQL queries and executes other query types such as UPDATE, INSERT and DELETE.

This Tool is potentially dangerous, be very careful when using it and make a backup for your database prior to running an update, delete or insert statement.

An explanation of the SQL language is beyond the scope of this manual. Please refer to the following web site for information on SQL: https://www.w3schools.com/sql/default.asp

Using the Tool

Select INPUT | Add-Ins > Datgel Administrator Tools > SQL Tool to launch the Datgel SQL Tool. The procedure is fairly straightforward and referring to the following screen shot:

  1. Choose the SQL statement type you want to write by clicking on the appropriate button. Note the lowercase syntax e.g. <fieldname> is included as a guide only and should be overwritten or deleted before execution of a command.
  2. Choose the database to run the query against – Project or Library
  3. Paste the desired table and field names from the list. Note, by only using table and field names taken from the drop down list, you drastically reduce the chance of getting SQL read errors.
  4. Optional. Use the In Library button to bring up the full path name for the current library file.
  5. Choose between Current Project Only, All Projects, and Selected Project(s).The Current Project Only option checks the current project, All Projects checks every project, and Selected Project(s) allows you to select multiple projects, by clicking Browse and then selecting the projects you wish to use.

    This option only works for gINT Enterprise databases, and the following error will appear if using an access-based gINT database.

  6. Click on Execute.
  7. Click on Reset Query to clear the SQL statement box, and Click on Reset Result to clear the results box.

Note that Execute displays the results in the white box below the query, whereas gINT Query will bring up a gINT window to display the results.

Exporting Data using the SQL Tool

If you want to export the result of an SQL statement to an Excel File, you can use the gINT Query option. If the command is properly executed, then this will bring up a window as below.

The window will contain the result of your query and give you the option to either send the result to the printer or to Export your result. Choose Export and then in the second window be careful to choose the type as Excel 2007 (*.xlsx).

Due to current program limitations, you are currently unable to Append or Overwrite existing files. Always create a new file when using the SQL Tool export option.