Saturday, September 25, 2010

jBASE Query Language - Introduction

Y96ABU5MBK7E

The jBASE Query Language (jQL) is a powerful and easy to use facility, which allows you to retrieve data from the database in a structured order and to present the data in a flexible and easily understood format. You can enter jQL Commands from your terminal or embed jQL Commands in applications programs, procs and paragraphs to access data in jBASE files. The language is characterized by the use of intuitive Commands that resemble everyday English language Commands. You might for instance manage a retail department and need to review a particular set of figures, which requires the phrase: "Show me the sales figures for January sorted in date order."
The jQL Command would look like this:

LIST SALES WITH MONTH = "JANUARY" BY DATE
By using the jQL Command LIST with a file named SALES and your predefined data definition records such as MONTH and DATE, you can construct complex ad-hoc reports directly from the Command line interface (>). You can also choose how you want the information presented; displayed directly to your printer or to your screen; listed in date order, or in descending or ascending order. The choice is yours as jQL contains a rich range of commands for listing, sorting, selecting and controlling the presentation of your details and is a safe language for end users. With the exception of the "EDELETE" Command, jQL will not alter the contents of the source data files.
All jQL Command sentences begin with a verb-like Command such as LIST or SELECT, followed by a file name such as SALES or PERSONNEL, and then a series of qualifiers and modifiers with which you control elements such as eligible data, report formatting, any totals that you want to appear and so on.
Most data files on the system will have two assigned storage areas:
  1. For the data (the data section) and
  2. For the data definition records (the dictionary section)
Some files might be single level and others might have multiple data sections. Data definition records kept in the dictionary portion of the file defines all the data fields in a file. These data definition records do not have to exist (you can use defaults provided in the environment variables or even the dictionaries of other files). However, where you need to manipulate 'say' dates (which are held in internal format), or to join data held in different files, you will find that one or more definition records will be required for each data field. The data definition records are simple to create and maintain.
FOR EXAMPLE:
  • They allow you to specify the position of the data in a record (its field number)
  • A narrative to be used as a column heading any input or output conversions required (such as for dates) the data type (left or right justified, or text that will break on word boundaries)
  • A column width, used in the reports
  • Input and output conversion codes can also be used to manipulate the data by performing mathematical functions, concatenating fields, or by extracting specific data from the field.

Multivalued Files

JBASE uses a three-dimensional file structure called a non-first normal form data model to store multiple values for a field in a single record known as multivalued fields. A multivalued field holds data that would otherwise be scattered among several interrelated files. Two or more multivalued fields can be associated with each other when defined in the file dictionary. Such associations are useful in situations where a group of multivalued fields forms an array or are a nested table within a file. You can define multivalued fields as belonging to associations in which the first value in one multivalued field relates to the first value in each of the other multivalued fields in the association, the second value relates to all the other second values. Each multivalue field can be further divided into subvalues, again obeying any relationships between fields.

0 comments:

Post a Comment

 

Blog Info

A Pakistani Website by Originative Systems

Total Pageviews

Tutorial Jinni Copyright © 2015 WoodMag is Modified by Originative Systems