Simplicty and flexibility!


Support::

The Basic DQL Vocabulary


Parameters


Returns/Result


Examples


Reference

The Basic DQL Vocabulary

The Basic DQL Vocabulary

DQL keywords and symbols are organized into nine categories:

· Commands

· Operators

· Functions

· Database Objects

· Relationships

· Symbols

· Values

· Variables and Constants

· Comments

 

Commands

Commands let you list, enter, modify, or delete records, execute another procedure or external program, and direct output to the screen, disk, or printer. DQL contains four types of commands:

 

image\dqli-6.gif

 

Operators

Operators are used to manipulate variables and tell DataEase how to carry out certain Processing and Control Commands (such as the order in which to process records, what statistics to generate, etc.). DQL includes seven types of Operators:

 

 

image\dqli-7.gif

Functions

A function is a routine that performs a particular calculation, text manipulation, or other data processing task. DQL provides 58 functions grouped into nine categories: Date, Time, Spell, Text, if, Math, Financial, Scientific, and Trigonometric.

A function is usually followed by one or more parameters (also called arguments) enclosed within parentheses. A parameter is information you supply to specify the operation of the function.

For example, the firstc function lets you extract a number of characters from the beginning of a text value. To use the firstc function, you must supply information telling DataEase: (1 ) from what text value to extract characters, and (2) how many characters to extract. The statement below shows the firstc function and the two parameters needed to extract the first four characters in a LAST NAME field:

 

 firstc (LAST NAME,4)

 

When processing a MEMBERS record for a member named Williams, the above statement returns the value, "Will".

DataEase lets you use functions in field Derivation Formulas as well as in a DQL Procedure.

The Functions pick list in the Script Editor is illustrated below:

 

image\dqli-8.gif

Database Objects

Database objects are the entities you create in an application to store and access data. Tables, columns, fields, relationships, and documents are all examples of database objects that can be specified in a DQL script.

For example, the script below specifies two table names and three column names that tell DataEase what data to print in a report:

 

 for MEMBERS ;

  list records

  FIRST NAME ;

  LAST NAME ;

  all FAMILY MEMBERS FIRST NAME .

 end

 

Relationships

Relationships link records stored in different database tables. In a DQL Procedure, you can access data in a related table using predefined relationships (stored in the Relationships form) and adhoc relationships that are defined within the procedure.

The figure below shows the Relationships form.

image\dqli-9.gif

Symbols

image\Dql_0003.gif

See DQL 8 for more information on specific DQL language elements.

 

A symbol is a character used to punctuate a DQL script. Examples include a period, comma, semicolon, and parenthesis.

Additionally, special symbols called wild card symbols are used to represent unknown characters. Wild card symbols include the asterisk (*), tilde (#), and question mark (?). The example below shows a question mark used to take the place of an unknown character:

 

for MEMBERS with LAST NAME = "Anders?n " ;

list records

 LAST NAME;

 FIRST NAME.

end

 

Variables

A variable is a value that can change while a script is being processed. A variable may contain a number, numeric string, text string, time, or date value.

When you define a variable, you specify a word or letter to represent the variable in the script. You also specify what type of data is to be stored in the variable. The following line defines a variable named DISCOUNT, used to store a number value:

 

define temp "DISCOUNT" Number.

 

Once a variable is defined, you can use the assign command to set its value. The following line sets the value of the DISCOUNT variable to fifteen percent of a member's TOTAL DUE:

 

assign temp DISCOUNT := 0.15 * TOTAL DUE.

 

Although a variable can hold only one value at a time, that value can change any number of times during processing. In the example above, the value of DISCOUNT might change with each MEMBERS record processed.

DataEase lets you define a temporary variable to store a value during a single DQL Procedure, or a global variable used to pass a value from one DQL Procedure to another.

 

Values

Values are the data processed by a procedure. A value can be any number or text string stored as a constant or variable, or the contents of a data field (the current value in the CLUB NAME field, for example).

 

Comments

Comments are notes and explanations you can include in a DQL script to make it easy for you or another programmer to understand. Indicate the beginning of a comment with a double hyphen (-). When executing the script, DataEase ignores all text between the double hyphen and the end of the line.

 

 -- This script lists MEMBERS from Texas.

 

 for MEMBERS with STATE = "TX" ; -- select Texas members.

 list records    -- Print the members'
  FIRST NAME;    -- first and last names.
  LAST NAME.
 end      -- end of script.

See Also


On the forum about The Basic DQL Vocabulary

[@EOF@]...

Product: . Written by alembagheri tahmas 07/12/13 at 13:37:32

Hi there,I am trying to use an external MySQL DB in dataease. I have successfully create the ODBC link and added the DB to dataease. I can also access the DB from dataease. Now, just for testing purposes, I am trying to create a simple report b...

Product: DataEase for Windows 7.x. Written by George Washington 11/04/14 at 08:26:17

no se pude exportar ahora archivos a pdf, ni a excel o otros cosa mala. en verdad creo que hace faltaen las versiones anteriores me funcionaba mas o menos bien. le hace falta a los aplicativos que se desarrollan en Dataeasegr...

Product: DataEase 8 Reporter. Written by eduardo paez 02/05/14 at 14:40:11

Thanks. Anyway I'm trying to use this fuction but it seems to me that it doesn't work on 8.2. I tried also in a DQL.There's something wrong?<img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAA9IAAAJ3CAYAAAB4NWk3AAAAAXNSR0IArs4...

Product: . Written by Marco Marchesi 15/02/16 at 14:50:46

[@EOF@]...

Product: Dataease [{8}]FIVE. Written by Chamil Rajindra 21/02/19 at 10:17:46

Thanks for the very good explanation!AS...

Product: . Written by afonso santos 28/10/19 at 00:50:14

I am pleased to see that the migration from Dos 4.53 is then sa 5.5 works. A really useful thing would be a compiler of SQL languages. Will you get there?Original Text:Mi compiaccio a vedere che la migrazione da Dos 4.53 è poi sa 5.5 funzio...

Product: . Written by Grossi Gioacchino 18/11/19 at 14:33:44

How can i delete a Style sheet?...

Product: Dataease [{8}]FIVE. Written by Rainer 22/03/21 at 11:13:10

I run W7 and since a few days&nbsp;Dataease 8.5 is not starting any more, do you have an idea? i installed it again but that did not help....

Product: Dataease [{8}]FIVE. Written by Rainer 08/06/21 at 14:12:40

[@EOF@]...

Product: . Written by Hiralal Rampul 01/12/21 at 17:47:10

On the blog about The Basic DQL Vocabulary


dg3_HelpView