Matrix query language

Mar 3, 2015   Allumez   Technologies , Web Technologies

MQL is the Matrix Query Language. Similar to SQL  MQL consists of a set of statements that help the administrator set up and test a Matrix database quickly and efficiently.

MQL is primarily a tool for building the Matrix database. One can also use MQL to add information to the existing database, and extract information. MQL acts an interpreter for Matrix and can be used in one of three modes:

• Interactive Mode

• Script Mode

• Tool Command Language (Tcl) Mode

Interactive Mode: When you are using MQL in the interactive mode, you type in one MQL statement at a time. As each statement is entered, Matrix processes it. This is similar to entering system

commands at your terminal.

The interactive mode is useful if you have only a few commands to enter or want extensive freedom and flexibility when entering commands. However, interactive mode is very inefficient if you are building large databases or want to input large amounts of

information. For this reason, Matrix enables you to use MQL in a script mode.


Script Mode: When working in the script (or batch) mode, you use a text editor to build a set of MQL

statements. These statements are contained in an external file, called a script, that can be sent to the Matrix command interface. A script passes a batch of MQL statements to the Matrix command interface for processing. The interface then reads the script, line by line, and processes the statements just as it would in the interactive mode.

Working in script mode has many advantages, particularly when you are first building a database. Some examples of advantages are:

  • You have a record written of all your definitions and assignments. This enables you to review what you have done and make changes easily while you are testing the database. When you are first building the database, you may experiment with different definitions to see which one works best for your application. A written record saves time and aggravation since you do not have to print definitions when

         there is a question.

  • You can use text editor features to duplicate and modify similar definitions and assignments. Rather than entering every statement, you can copy and modify only the values that must change. This enables you to build large and complicated databases quickly.


TCL Mode: Tcl is a universal scripting language that offers a component approach to application development.  Interpreter of this mode is a library of C procedures that have been incorporated into MQL. MQL-TCL offers the following benefits to Matrix users:

Rapid development—Compared with toolkits where you program in C (such as the Motif toolkit), there is less to learn in order to use Tcl and less code to write. Tcl is an interpreted language with which you can generate and execute new

scripts on the fly without recompiling or restarting the application. This enables you to test and fix problems rapidly.

Platform independence—Tcl was designed to work in a heterogeneous environment. Which means that a Tcl script that was developed under Windows can be executed on a UNIX platform. When a developer has completed design and testing , a program object can be created using the code providing Matrix users with immediate access to the new application. This also solves the problem of a need to distribute newapplications.

Integration support—Because a Tcl application can include many different library packages, each of which provides a set of Tcl commands, an MQL/Tcl script can be used as a communication mechanism to allow different applications to work with Matrix.

Share this post

We are always here to help. If you have a query Send Now