Presentation is loading. Please wait.

Presentation is loading. Please wait.

QUERY LANGUAGE.

Similar presentations


Presentation on theme: "QUERY LANGUAGE."— Presentation transcript:

1 QUERY LANGUAGE

2 Locate File Names Option A Select A - for Amend in desired process
Enter a fictitious code Press <enter> File name associated with this file will be displayed at the bottom of the screen SUPMNT Rev/x.x Company Time Date Screen : Supplier File Maintenance x User Name Please Select : CRE/AME/REV/DEL/END A *1) Supplier Code [XXXX ] ) Date Opened Last Changed 3) Supplier Name 5) Address line ) Alpha Key 6) Address line 2 7) Address line 3 8) Post Code ) Pay to Supplier 10) Our Debtor ID 11) Telephone No ) Fax No 12) Contact 13) Title ) Mobile No 16) A.B.N 17) Postal line 1 18) Postal line ) Post Code 19) Postal line 3 record not on file SUPPLIER The file name displayed at the bottom of the screen is the file that stores the data in this particular case. This would be the file name you would use to base your Query Language report on if you wanted to extract information from the SUPMNT process for example. You can follow this same procedure to locate file names in a number of other processes.

3 Locate File Names Option B Select A to Amend - in desired process
Press Enter In the first field of the process Press F1 HELP function key ARDOCTXT Rev/x.x Company Time Date Screen : Maintain Document Text x User Name Please Select : CRE/AME/REV/DEL/END A Text Code [ ] Text Transfer P1 This is another way of locating the file name. In the Help text of each process, the file name will be listed that stores the data.

4 Locate File Names Option B (continued)
You will then view the Help text associated with that field. This will display the file that stores the information from this process. ARDOCTXT Rev/x.x Company Time Date HELP Processor Maintain Document Text x User Name Text Code This is an alphanumeric field of up to 5 characters A minimum entry of 1 character is required The FND function key can be used with this field Lowercase entries are converted to uppercase The BCK key can be used from this field, but FWD is not allowed. The entry must already exist on the DOC.TEXT file which is maintained by the ARDOCTXT process This text will act as a default description for this billing code when it is referenced in "ARDOCENT", and of course acts as a description for thebilling code itself. The file name that is displayed in the Help text for particular processes is the file name that you would base your Query Language report on if you wanted to extract information from this process. You can also locate file names for your Query Language report by using the Find Function key in the File Name field of your QLMNT process, and then selecting the appropriate Menu eg. AP, AR, IN. You will then see a list of all available files in each menu displayed. It is then up to you to choose the appropriate file to extract the desired information.

5 Types of Files Master Files Transaction Files Index Files
Balance Files Master Files Each of these types of files are often associated with maintenance processes on the menu. Eg. PRODUCTS file - maintained via PRODMNT GLCHART file - maintained via CHART CUSTOMERS file - maintained via CUSTMNT Transaction Files These files are usually broken down into 2 sub-categories. Unposted transactions and posted Transaction files. Unposted transaction files can be listed using the appropriate EDIT process. An example of unposted transactions would be VOUCHER.ENTRIES. When the Vouchers are posted the details are copied to ACTIVE.VOUCHERS file. Further examples of transaction files are GENERAL.JOURNAL, PRODUCTS.TRX.DETAIL, CUSTOMERS.TRANSACTIONS, JOB.TRANSACTIONS. Index Files An index is a quick way of referencing a group of related records in a transaction file. The CUSTOMERS.INDEX file has a separate record for each active customer on the system, this record contains a list of pointers to the relevant records in the CUSTOMERS.TRANSACTIONS file. Examples are CUSTOMERS.INDEX, PRODUCTS.TRX.INDEX Balance Files These files are built by posting programs and ‘end of period’ processes. Balance type files contain summarised information and monthly information that is accumulated over a period of time. Examples are CUSTOMERS.BALANCES, PRODUCTS.BALANCES.

6 File Structure What is a dictionary? Data Portion FILE
Dictionary Portion Each file is separated into 2 parts - Data portion and a Dictionary Portion Each dictionary item tells the system where to access the information in the file, how the information will be formatted when printed, what heading should be placed at the top of the column. A dictionary is a description of the fields which may be accessed in a data file. With each file there is always a file dictionary. The dictionary describes what information is contained in the file, and allows a number of ways of accessing that information. You can print a file dictionary from the process DICTLIST - List a File dictionary. What is a dictionary?

7 File and Dictionary Terms
ID/Key Attributes Values ID/Key The ID or Key to a file is a direct way of accessing ONE RECORD within that file. The ID of Key must ALWAYS be unique, so that only one record can be selected at a time. The ID or Key to the Product file is the product code. The ID to the CUSTOMERS, CUSTOMERS.BALANCES and CUSTOMERS.INDEX files is the customer code. Attributes Attributes are often referred to as ‘fields’ and relate to individual lines of data within a record. Each attribute in a file may have several dictionary items pointing to it and each dictionary item may output the data in a different way. Values Multi values are a number of values contained under the one attribute/field. Multi-valued attributes usually correspond with fields contained within a window in a process.

8 Sorting Information Reports Verbs - LIST and SORT
Lists Verbs - SELECT, QSELECT SSELECT Reports A report may be printed to screen or a printer The LIST verb produces a report which is NOT sorted. The output will be in the order that each item is stored in the file. The SORT verb allows you to specify what order you want your report to be sorted by. BY is used to produce output sorted in ASCENDING order. BY-DSND is used to produce output sorted from highest/largest to lowest/smallest. You can also use BY-EXP to sort on multi-valued fields. This in effect explodes the values within the nominated field and sorts them as if they were individual values. Lists A select list is a lost of items stored under a single list name which may be activated and used in a number of ways. You can activate a list and use this as a pre-select list to generate a report. You cannot print a list as you can print a report. A select list can be generated by the following verbs: SELECT, SSELECT or QSELECT. SELECT produces a select list in a non sorted order SSELECT produces a select list in sorted order QSELECT produces a Quick select list and is used as a quick way of accessing items in a large file.

9 QLMNT 1. A code that you give to this procedure
QLMNT Rev/x.x Company Time Date Screen : 1 Maintain Stored Procedures x User Name Please Select : CRE/AME/REV/DEL/END [ ] *1) Procedure Name 2) Description 3) Verb Name 4) List Name 5) File Name Query Language Commands P1 P2 P3 A code that you give to this procedure A descriptive name that help describe this procedure. A valid Pick Verb as maintained by PICKVERB. Only asked if verb is SELECT or SSELECT The file name you wish to extract information from. P1…etc.. Will contain a list of query commands. You must first set up a Query procedure in the QLMNT process. The procedure name is the name you give the report. The description should be a meaningful description that helps describe this procedure. This will help you in the future if you need to locate this report again. The Verb will depend on the output you require. Do you want a report/list? If you require a list, the List Name will be asked for. You can have the list name the same name as your QL procedure if you wish. The file Name is the file that you are extracting the information from.. Eg PRODUCTS, CUSTOMERS etc.et. The Panes of the Window P1…P2…P3 etc.. Will contain a list of query commands that you will specify to show the desired information in your report/list The list of query commands will of course depend on what you wish to see in your report or list.

10 XQL 1. The procedure code as entered in QLMNT
Only asked for select lists in ‘change’ mode Enter a list name if you want to use an existing select list, as a pre-list to this procedure. ‘N’ or a number between 1 and 9 ‘S’ to send report to Screen ‘P’ to send report to printer XQL Rev/x.x Company Time Date Screen : 1 Execute a User Defined Procedure x User Name 1) Procedure Name [ ] Purpose Verb Name File Name 2) Save List Name 3) Pre-Start List 4) Via Batch 5) Screen/Printer To run the query process you have created in QLMNT, you must use this process. You enter the process name from QLMNT in Field 1 of XQL. If your process is a report (eg you have used the verb SORT or LIST) Enter past the field pre-start list. You only need enter something into this field if you are running a list (eg. your verb was SELECT, SSELECT or QSELECT in QLMNT) If you are running a List, enter a list name into this field. If you want to see your report now, enter ‘N’ for Batch. If you want to send the report to the Batch processor enter a number between 1 and 9. The numbers signify to the Batch process the degree of priority you wish to generate this report. We would suggest that you send your reports to screen, initially. This may save a lot of trees, if you find that the report is not giving you exactly what you want and you need to make some minor modifications in QLMNT. However you are free to send the print job to the printer at any time.

11 Selection Criteria Selection criteria is necessary in order to limit the items that are being processed. If no selection criteria is entered all items in the file will be processed WITH is used in conjunction with a dictionary item, a relational operator and a value. Multiple selections can be joined together with AND and OR Selection criteria is necessary in order to limit the items that are to be processed. If no selection criteria is entered, all items in the file will be processed. To form a selection clause, you use the word WITH in conjunction with a dictionary item, an operator and a value.

12 Relational Operators Symbol = or EQ # or NE,NO, NOT > or GT,AFTER < or LT,BEFORE >= or GE <= or LE Meaning Equal to Not Equal to Greater than Less than Greater than or equal to Less than or equal to The WITH modifier is most often used with a relational modifier and a specific value as well as a dictionary item. This gives the WITH clause the power to not just check whether data is present in a field or not, but to compare the data with a value. Sample extract QL report based on CUSTOMERS file P1 BY CUSTOMER.CODE P2 WITH CUSTOMER.CODE >= "AA]" P3 AND WITH CUSTOMER.CODE <= "Z]" P4 AND WITH DISCOUNT.TERMS = "COD" P5 CUSTOMER.CODE P6 TELEPHONE This report will be sorted by customer.code order, it will select out of the file, those customers with a customer.code starting with ‘AA...’ and ending with ‘Z...’ and show us those customers with discount.terms of ‘COD’. It will then show us the customer code and telephone number of those customer codes that meet our selection criteria.

13 Wildcard characters [ Left Square bracket ] Right Square bracket
^ Carat Wildcard characters may be used to give your selection criteria a wide amount of flexibility. Rather than have an exact match in your selection criteria, using wildcard characters allows for a less-exact match. The ‘[‘ left square bracket allows the value to be matched on the remaining characters even though the item might start with different characters. Eg. with customer.code = “[SMITH with display all customer codes that end in SMITH, Customers with names such as John Smith, JoeSmith, A.B. Smith will be included in this report. The ‘]’ right square bracket may be used as the very last character in a string. Eg. with customer.code = “Alan]” will display all customer codes that commence with Alan and end in any character combination Customers with names such as Alan Brown, Alan Williams, Alan Smith will be included in this report. The ‘^’ may be used anywhere in the string to represent a SINGLE character. Any number of single carat characters may be used within a string to represent exactly that number of characters. Eg: with customer.code = “^^^^son” will display all customer codes that commence with 3 characters only and end in son - Johnson, Jackson

14 QUERY LANGUAGE How to turn your QL procedure into a Menu item.

15 How to turn a QL procedure into a Menu item
1. QLMNT Create your procedure in QLMNT Screen : Maintain Stored Procedures X User Name Please Select : CRE/AME/REV/DEL/END A *1) Procedure Name CUSDISC 2) Description Listing of customers and discount amounts 3) Verb Name SORT Generate a sorted report 4) List Name 5) File Name CUSTOMERS Customer Master file Query Language Commands P1 BY CUSTOMER.CODE P2 WITH CUSTOMER.CODE >= "AA]” P3 AND WITH CUSTOMER.CODE <=“Z]” P3 AND WITH DISCOUNT.TERMS = “COD” P4 CUSTOMER.CODE P5 TELEPHONE P6 CONTACT P7 DISCOUNT.TERMS This sample report will list all customers within a range - all customer code beginning with ‘AA’ and ending in any number/letter characters, and all customer codes beginning with ‘Z’ and ending in any number/letter characters. Ie. All of our customers. It will only list those customers that have discount terms of ‘COD’. The report will be sorted by customer code and will show the Customer Code, Telephone Number, any contact details and the Discount Terms for each of those Customers. The lines in our QL report WITH CUSTOMER.CODE = “AA]” AND WITH CUSTOMER.CODE <= “Z]” AND WITH DISCOUNT.TERMS = “COD” are selection lines. This means that we are only selecting specific details from this file. We wish to see All customers with a customer code commencing with ‘AA’ and with a customer code commencing with ‘Z’ and with discount terms of ‘COD’. The Discount terms are set up in CUSTMNT.

16 How to turn a QL procedure into a Menu item
2. XQL Run the report in XQL Cust.... Telephone Contact Discount Terms Code AA STEPHEN COOMBES COD AA Bill Brown COD AA Joe Smith COD AA RON & PETER COD AA Smith’s Hardware COD AA Jack Brown COD AAMI Steve Connor COD AATK Gary King COD [4051] 8 items listed. Run the report in XQL. Correct any formatting/typing errors in your report if necessary. Check to make sure your report is showing exactly what you want to see. If you do not get what you want from here, when you proceed on to the next step of turning this report into a menu item, you will still not get what you want in your report. Make sure your report is showing you what you want to see before you proceed to the next step. If you need to make changes in your report, make those changes in QLMNT. Re-run the report again in XQL.

17 How to turn a QL procedure into a Menu item
3. DEFQLPRC The process code will be the name assigned to your report when it has been copied to the menu. The name will commence with a Z….. The QL procedure is the name of the report you developed in QLMNT. (Step 1) Is the description that will be associated with your process when it is copied to the menu. If your report uses a pre-select list, enter the name here. If not leave this field blank. DEFQLPRC Rev/x.x Testing Company Time Date Screen : Define QL user interface process x User Name Please Select : CRE/AME/REV/DEL/END [C] *1) Process Code 2) QL Procedure 3) Process Name 4) Pre-Select Procedure Constant Tag When the report extracted from XQL shows you exactly what you want, you are ready to proceed to the next step of turning that report into a menu item. When a report is turned into a menu item, you will no longer need to go to XQL and enter the report name etc.. You only need to enter the name of the report as created by you in DEFQLPRC - add a Z to the front of the report, from within the menu screens, the same as you run any other process. Eg. in the example here our report name will be ZCUSDISC All user defined reports will commence with a Z. This is to distinguish user defined reports from normal menu items.

18 How to turn a QL procedure into a Menu item
EXAMPLE How to turn a QL procedure into a Menu item DEFQLPRC - Screen 1 DEFQLPRC Rev/x.x Company Time Date Screen : Define QL user interface process x User Name Please Select : CRE/AME/REV/DEL/END C *1) Process Code CUSDISC 2) QL Procedure CUSDISC Listing of customers 3) Process Name Customers/Discounts Report 4) Pre-Select Procedure Constant Tag P1 AA] [FIRST CUSTOMER ] 1. When turned into a menu item our report code will be ZCUSDISC 2. Is the existing QL report we created in QLMNT 3. Is the description of the report name to display on the Menu. Is the prompt/tag that will appear on the Menu after the report has been created. You are now ready to turn your QLMNT report into a menu item. We would suggest you name your report the same name as your existing Query Language report. You are free to choose any name you wish, but for future reference of locating the report again, it is much easier to have them named the same. The QL procedure must already exist. Your user defined report is based on this template. If you make any changes in the QL procedure after you have defined a QL report, you should redefine your QL procedure in this process. How do I do that you ask? - You simply choose A to amend your procedure in DEFQLPRC. Enter the process name. Press <enter> Your procedure will be redefined based on any changes you have made to your template in QLMNT. The details you enter in the Tag field are prompts that will ask the user for input. In our example we are looking for customers, so a suitable prompt would be First Customer - End Customer.The details from the selection line in your QL report will display, you should delete this and enter your field tag. Eg in our example we deleted WITH CUSTOMER.CODE>= and entered the tag we wanted - First Customer.

19 How to turn a QL procedure into a Menu item
DEFQLPRC - Screen 2 1. What is the minimum length of characters that you want the user to enter? If you want the user to always enter something set this field to 1 at least. 2. What is the maximum length of characters that you want the user to enter? The maximum length of Customers Codes is 8. If you only have customer codes of 4 characters, enter 4 here. 3. Is this field type letters or letters and numbers or only numbers. Enter A if your customer codes are alpha characters only, Enter N if your customer codes are alpha and numbers. DEFQLPRC Rev/x.x Company Time Date Screen : Define QL user interface process x User Name Field Definition for First Customer 1) Minimum Length [ ] 2) Maximum Length 3) Field Type 4) Validation Min Max Filename Optional 5) Help Code 6) Find Code 7) Default 8) Include in Heading Screen 2 of the DEFQLPRC procedure is where you set up the details, of Minimum length of input, Maximum length of input, Field type etc.etc that you want the user to be able to enter on this particular field. The Field is the Tag name from Screen 1 of DEFQLPRC - in our example the field name is First Customer. You also set up the details of the find screen to be used on this particular field. You can also have the details of the Customer Code in our example included in the report heading if you wish. If you want your report heading to show the customer code, you should respond with Y to Include in Heading. If not respond with N in this field.

20 How to turn a QL procedure into a Menu item
EXAMPLE How to turn a QL procedure into a Menu item DEFQLPRC - Screen 2 4. Do you want the input to be checked against a valid file to make sure the customer code does exist? If your answer is Yes. Enter F in this field. If your answer is No leave this field blank. Enter a valid file name to validate the input against. Is input optional? Yes or No 5. Can be used to specify your own help text for this field. Leave blank if not required. 6. Is the name of the file that will be used if the user hits the Find Function key. 7. You can specify a default that will always display in this field. If not, leave this field blank. 8. Allows automatic insertion of the Customer Code (in this example) in the heading. Yes or No response is required. DEFQLPRC Rev/x.x Company Time Date Screen : Define QL user interface process x User Name Field Definition for First Customer 1) Minimum Length 1 2) Maximum Length 8 3) Field Type N 4) Validation F Min Max Filename CUSTOMERS Customers Master File Optional N 5) Help Code 6) Find Code FIND.CUSTOMERS 7) Default 8) Include in Heading N Using our existing QL report, this is a sample of how we might set up the data input details for Customer Code. The Minimum field length is set to 1, the maximum field length set to 8, the field type is numbers and letters, we want to check to make sure that any data input by the user will be checked against the Customers file. We always want the user to enter something so we have responded with N to Optional. If the user does choose to use the Find screen, the file FIND.CUSTOMERS will be called on. We do not want anything to default on screen when entering this process. If we always wanted the same information on a particular customer we could enter that customer code in the default option. We have chosen not to include the Customer Code in the report heading.

21 How to turn a QL procedure into a Menu item
EXAMPLE How to turn a QL procedure into a Menu item DEFQLPRC - Screen 1 You will then be returned to Screen 1 of DEFQLPRC if you have other lines in your QLMNT procedure that asks for input Eg.Last Customer, Discount Terms Follow the same steps from above to define this extra input data validation. DEFQLPRC Rev/x.x Company Time Date Screen : Define QL user interface process x User Name Please Select : CRE/AME/REV/DEL/END C *1) Process Code CUSDISC 2) QL Procedure CUSDISC Listing of customers 3) Process Name Customers/Discounts Report 4) Pre-Select Procedure Constant Tag P1 AA] FIRST CUSTOMER P2 Z] LAST CUSTOMER P2 COD DISCOUNT TERMS After you have set up all the details for the first Field - in our example First Customer - you will be returned to Screen 1 of DEFQLPRC again to set up additional details for the remaining lines from your QL report that have any selection criteria entered. Eg. Last Customer, Discounts Terms Selection criteria, are lines in your QL report that are selecting specific information only. Eg. selecting certain customers, selecting certain dates, selecting specific discount terms etc..etc..

22 How to turn a QL procedure into a Menu item
EXAMPLE How to turn a QL procedure into a Menu item DEFQLPRC - Screen 2 Set up valid lengths for the Field Discount Terms now - data input, Field types, validation details if required as you did for Customer Code. For each line in your QLMNT procedure where you have a selection line eg customer.code = “AA]”, discount.terms = “COD]” etc..etc. you will be prompted to set up the details. When you have set up all your selection criteria and pressed <enter> the procedure will be generated and inserted into the appropriate user menu. DEFQLPRC Rev/x.x Company Time Date Screen : 2 Define QL user interface process x User Name Field Definition for Discount Terms 1) Minimum Length 1 2) Maximum Length 4 3) Field Type N 4) Validation F Min Max Filename TERMS.CODE Maintain Payment Terms Optional N 5) Help Code 6) Find Code FIND.TERMS 7) Default 8) Include in Heading In your QL report if you have a number of selection lines eg.. Where you are selecting specific details only, or selecting something greater than or less than certain details, you will be prompted to set up details for those lines also. Eg. you will set up the user prompt/tag on Screen 1, and also set up the details on Screen 2 as you did in the first instance with First Customer. In our example we have 3 selection lines - WITH CUSTOMER.CODE >= “AA]” AND WITH CUSTOMER.CODE <= “Z]” AND WITH DISCOUNT.TERMS = “COD” We will need to set up 3 field for Tags on Screen 1 of DEFQLPRC and set up field data on Screen 2 of DEFQLPRC. When you have completed defining your QL procedure, press <enter> and it will be generated and ready for you to use via the menu.

23 QUERY LANGUAGE Using your DEFQLPRC procedure from the Menu.

24 Using your DEFQLPRC procedure from the Menu.
Access your report by typing ZCUSDISC. You may need to change security profiles that are in place before you are able to access the generated process. ZCUSDISC Rev/x.x Company Time Date Screen : 1 Customers/Discounts Report x User Name First Customer [ ] Last Customer Discount Terms Via Batch Screen/Printer In our example we used the file CUSTOMERS to extract the information for our report. The file CUSTOMERS exists in the Accounts Receivable Module. When our report is generated from DEFQLPRC - ZCUSDISC will be available in the ARUSER Menu. When you generate reports via DEFQLPRC, depending on the file you are using from QLMNT, the report will be generated in the appropriate user menu. Eg ARUSER, INUSER, APUSER, JCUSER etc. The report will have the tags you defined in DEFQLPRC Screen 1. The information you will be allowed to enter in each of these fields has been defined by you on Screen 2 of DEFQLPRC. Eg. Our report has tags/prompts of First Customer, Last Customer, Discount Terms. If you are not able to access the generated process from within the menu, you will need to change the security profiles you have in place. You will do this from either COMPROF Entity Security Profiles or USERPROF User Security Profiles or LINEPROF Line Security Profiles in the SYSTEM System Parameters Menu.


Download ppt "QUERY LANGUAGE."

Similar presentations


Ads by Google