BQL version 1.0 Legal Status BQL is freeware. Copying is allowed, commercial use is not. Unlike many others, I do not demand that all file must be left together unchanged, on three conditions: 1. The same rules about use apply. 2. This declaration about the legal status must stay along with the files. 3. It must be made clear that something has been changed or left out. If it is a substantial improvement of the program, I wish to receive a copy. © 1992: Reinhard Pflüger Hermannstr. 3 D-60318 Frankfurt Germany What is BQL? BQL stands for "bBase Query Language". This is to say: 1. BQL is a database query language; it is not only its name that resembles to SQL. 2. The data format is compatible with bBaseII (from Fish #563). But BQL can also be used without bBaseII. Usage Start: from workbench or CLI without parameters. A window is opened, in which the query is entered, e. g.: from xy.bbase select column1 column2 where column3 < string sums to "My output file" create yz.bbase end Explication: from: file(s) to be read from. The first one must be a database in bBase format. All others are supposed to be in bBase format if their name ends in .bbase, otherwise humanly readable format (see "FurtherDoc"). Unlike SQL, BQL does not evaluate a cartesian product (join), but the files are treated like one big file. They must have the same number of columns, and the order of the columns must be the same too. select: names of the columns to be selected. If a column name contains spaces, only the part in front of them is to be written. Strings that are not names of columns are interpreted as constants. # numbers the lines that are written. By * all columns are selected. where: conditions of the form "column-name operator constant". The spaces in front of and after the operator are necessary. If several conditions are given, all of them must be true. If you use the keyword "unless" instead of "where", all conditions must be false. Valid operators are: > < = <= >= <> string comparison + Is the constant contained as a substring? - Is the constant not contained as a substring? l numerically less than g numerically greater than sums: At the end a sum line is written (for all columns only containing integers, their sum; for all others "SUM"). end: end of query. Entering CTRL-\ has the same effect. to: file to which the output is to be sent. Default is "T:tempA" if "create" is given (in further passes "T:tempB" etc. - see "FurtherDoc" under "go"). Otherwise a "CON:" window is the default. If "create" is not given, a title line containing the column names is generated. create: Create the named database of the output data. The keywords may be entered in any order. They must be written in small letters. Also apart from that BQL is always case sensitive. "to" and "create" can be followed by one parameter, "sums" (and "nosums", cf. "FurtherDoc") none, all other keywords up to 9. (in the case of "where": 9 complete compar- isons) Expressions can be divided (without difference in meaning) by any number of: - spaces - linefeeds - commas Combinations of them are allowed too. Expressions containing one of these characters must be enclosed in double quotes ("), equally such ones that are identical with keywords. After such an expression no division character is necessary (but it is allowed). Double quotes in expressions are not allowed. Single quotes (') are ok. For the keywords "go", "run" and "nosums" see "FurtherDoc". NB: The syntax check is not complete. The valid principle is: "garbage in, garbage out". In some circumstances the program will quit with an error messa- ge (e. g. when there are too many parameters); but thanks to the Modula2 run- time system this does not cause a guru. If it does, or if you do not get the desired output although the query is correct, let me know it!