help.gdbTue Jul 10 17:09:02 2001 N help.gdbTOPIC   PARENT   FACILITY    SYSTEM_FLAG   TEXT    PQLI$PROCEDURE_NAME    QLI$PROCEDURE    PTOPICS SQL$TOPICS SYSDBATEXTTEXT    "FACILITYFACILITY    "TOPICTOPIC    "PARENTPARENT    " SYSTEM_FLAG SYSTEM_FLAG    " QLI$PROCEDURES SYSDBAQLI$PROCEDURE_NAMEQLI$PROCEDURE_NAME    " QLI$PROCEDURE QLI$PROCEDURE    " QLI$PROCEDURESQLI$PROCEDURE_INDEXQLI$PROCEDURE_NAME,0P >begin #declare parent_string varying [30] parent_string = *.parent_string repeat 50 % for topics with topic eq *.topic > print topic, parent then modify using parent = parent_string end 00TEXT 00 LIST_TOPICS W.report topics sorted by topic on 'topics.dat' Wprint skip 2, topic | ' (parent: ' | parent | ') ' (-), skip, col 10, text (-), skip 2 end_report TOPICSIDX1FACILITYPARENTTOPICXhQLI QLI QLI  /F DQli (Query Language Interpreter) is the interactive data retrieval >and manipulation interface to databases managed by InterBase. ?Qli supports significant subsets of GDML, SQL, and GDEF's data definition language (DDL).  DYou can mix both the GDML and SQL variants during your qli session. FHowever, you cannot use statements and commands from the GDML variant Fas substatements of a SQL statement. Similarly, you cannot use a SQL 1statement as a substatement of a GDML statement. hh:QLI BEGIN QLI  /==The begin-end statement groups QLI statements into a single 1compound statement called a begin-end block.  =------------------------------------------------------------  BEGIN  qli-statement... END  =------------------------------------------------------------  QLI> store cities using CON> begin CON> city = 'Shadkill' CON> state = 'NY' CON> population = 20000 CON> altitude = 17 CON> end hhtQLI BOOLEAN_EXPRESSION QLI  /A?A boolean-expression evaluates to true, false, or missing. It Adescribes the characteristics of a single value expression (for Aexample, a missing value) or the relationship between two value ?expressions (for example, x is greater than y). The order of @precedence for evaluating compound Boolean expressions is NOT, AND, and OR.  ?------------------------------------------------------------   boolean-expression ::= ( { [ NOT ] conditional-expression | ; conditional-expression AND conditional-expression | ; conditional-expression OR conditional-expression }    conditional-expression ::= 5 { COMPARISON-CONDITION | BETWEEN-CONDITION | 5 STARTING-CONDITION | CONTAINING-CONDITION | / MATCHING-CONDITION | not-condition | ) ANY-CONDITION UNIQUE-CONDITION }  =------------------------------------------------------------ hhQLI DEFINE_PROCEDURE QLI  /GBThe DEFINE PROCEDURE command stores a sequence of QLI operations Gin the database. QLI stores the procedure in the most recently opened ;database, unless you qualify the procedure with a database handle.  ?------------------------------------------------------------  7 DEFINE PROCEDURE [database-handle.]procedure-name  operation...  END_PROCEDURE  5 operation ::= { qli-command | qli-procedure | @ qli-statement | qli-clause | qli-keyword }  >------------------------------------------------------------  %QLI> define procedure capitol_info )CON> /* saves typing a common query */ :CON> for s in states cross c in cities over state with %CON> s.state = *.'state code' and CON> s.capitol = c.city @CON> print s.capitol | ' has a population of ' | c.population CON> end_procedure hhQLI MATCHING_USING CONDITION QLI BOOLEAN_EXPRESSION  /O.?The MATCHING USING condition lets you define your own wildcard search characters.  @--------------------------------------------------------------- 2 MATCHING value-expression USING 'control-string'  / control-string ::= [prequalifier][definition-  commalist][postqualifier]   prequalifier ::= [-S(|+S(]  . definition ::= wildcard=definition-character " [definition-character...]   postqualifier ::= [)]  @---------------------------------------------------------------  OThe prequalifier string -S( disables case sensitivity of the value-expression Nin the matching clause. The prequalifier string +S( enables case sensitivity  ! Definition Character Operation  / ? Matches any single character  # [] Defines a class of character  , * Modifies previous definition or class: ' indicates zero or more occurrences  * @ Treats the next character as literal  ) ~ Excludes the following character or  class of characters  OThe prequalifier string -S( disables case sensitivity of the value-expression Mof the value-expression in the matching clause. The prequalifier string +S( enables case sensitivity.  @The following example searches for cities that have "ton" some- >where in their name. The MATCHING USING clause defines "+" as 2zero or more occurrences of any single character:  4 QLI> for c in cities with c.city matching '+ton+'  CON> using '+=?*' print city  hhQLI EXIT QLI  /MKThe EXIT command ends a QLI session and commits the current transaction. MEXIT and your system's end-of-file () character are exactly equivalent. EThe end-of-file characters are system-dependent (and sometimes user- dependent):  4 - Control-Z for VAX/VMS, MicroVMS, and APOLLO $ - Control-D for ULTRIX and SUN  =------------------------------------------------------------   EXIT  >------------------------------------------------------------  QLI> EXIT hh"QLI FINISH QLI  />1The FINISH command explicitly closes a database.  =------------------------------------------------------------  ' FINISH [ database-handle-commalist ]  >------------------------------------------------------------  1The following command closes all open databases:  QLI> finish  <The following example readies two databases, performs some 4data manipulation, and closes one of the databases:  4QLI> ready /usr/igor/datafiles/atlas.gdb as atlas QLI> ready maps.gdb as map  .  .  . QLI> finish atlas hh\QLI ERASE QLI  /EEThe ERASE statement removes from the database the records specified &by the record selection expression.  =------------------------------------------------------------   ERASE [ ALL OF rse ]  >------------------------------------------------------------  7QLI> erase all of cities with population < 100000 or CON> population missing  AQLI> for cities with population < 100000 or population missing CON> print then -CON> if *.'keep it?' containing 'n' erase hh^QLI FOR QLI  /C#?The FOR statement evaluates a record selection expression and Cexecutes a substatement FOR each qualifying record. You can nest BFOR loops to display a hierarchy of records or to join relations across databases.  ?------------------------------------------------------------   FOR rse qli-statement  >------------------------------------------------------------  "QLI> for states sorted by state 'CON> print capitol, state, statehood  9QLI> for states cross cities over state sorted by city /CON> print city, state, altitude, population  'QLI> for ski_areas with state = 'FL' CON> erase  6QLI> for pc in part_component sorted by pc.assembly CON> begin CON> print pc.assembly 9CON> for p in parts with p.item_number = pc.component 2CON> print pc.component, p.item_name, p.price CON> end  3QLI> ready apollo:/usr/data/mapper.gdb as mapper QLI> ready atlas.gdb as atlas /QLI> for s in atlas.states sorted by s.state CON> begin #CON> for c in mapper.cities with CON> s.state = c.state 1CON> print s.state_name, c.city, c.population CON> end hhQLI MODIFY QLI  /??The MODIFY statement updates a field or fields in a record or records.  =------------------------------------------------------------  / MODIFY { dbfield-expression-commalist | 8 USING assignment-statement } [ OF rse ]  > dbfield-expression ::= [ context-variable. ] field-name  ?------------------------------------------------------------  %QLI> /* rse in modify statement */ (QLI> modify population of cities with CON> city = 'New York' Enter POPULATION: 10000000   "QLI> /* rse in for statement */ )QLI> for cities with city = 'New York' *CON> modify using population = 10000000   (QLI> modify population of cities with CON> city = 'New York' Enter POPULATION: 10000000 hhQLI PRINT QLI  /I*EThe PRINT statement displays fields from records in a record stream. ?You can create the record stream in the PRINT statement itself or in an outer for statement.  ?------------------------------------------------------------  Standalone format:  2 PRINT [ format-option-commalist ] [ DISTINCT ] G { rse | value-expression-commalist [ USING edit-string ] & [( query-header )] OF rse  3 [ ON 'filespec' | TO shell-command ]  C format-option :== { COL n | SKIP n | SPACE n | TAB n }  = query-header :== { quoted-string-expression | - }  FOR loop format:  FOR rse * PRINT value-expression-commalist  >------------------------------------------------------------  )QLI> print states sorted by state_name  )QLI> print "This is an utter outrage."  -QLI> print *."whatever your heart desires"  4QLI> print state_name, name, city of states cross 0CON> ski_areas over state on 'shush_boom.dat'  -QLI> for states cross ski_areas over state $CON> print state_name, name, city  @QLI> print altitude using hhhh of cities with city = 'Albany'  IQLI> print "today" using w(8)" the "dd"th of "m(12)" in the year "y(4)  8QLI> print city, population using z,zzz,zz9 of cities hhQLI QUIT QLI  /A AThe QUIT command ends a QLI session and asks if you want to roll back the current transaction.  =------------------------------------------------------------   QUIT  >------------------------------------------------------------  QLI> QUIT (Do you want to rollback your changes? Y $ hhQLI READY QLI  /G!EThe READY command attaches a database and opens it for access. This Fcommand must precede other database access in QLI. The READY command Eautomatically starts a transaction that is not terminated until you Gcommit it or roll it back. QLI automatically starts a new transaction Fwith the next data manipulation statement that follows the COMMIT or ROLLBACK command.  =------------------------------------------------------------  + READY filespec [ as database-handle ]  ?------------------------------------------------------------   BFile specifications for remote databases have the following form:  ?------------------------------------------------------------  / VMS to VMS (via DECnet): node-name::filespec 2 VMS to ULTRIX (via DECnet): node-name::filespec 0 VMS to non-VMS, non-ULTRIX: node-name^filespec 1 ULTRIX to VMS (via DECnet): node_name::filespec ( Apollo to Apollo: //node-name/filspec All else: node-name:filespec  ?------------------------------------------------------------  QLI> ready atlas.gdb ,QLI> ready pariah:[public.data]phones.gdb 4QLI> ready /usr/igor/datafiles/atlas.gdb as atlas )QLI> ready mailing_list.gdb as mailing 2QLI> ready pariah:[doncikov.datafiles]atlas.gdb QLI> ready mailing_list.gdb hh QLI REPEAT QLI  /LDThe REPEAT command lets you execute a qli statement multiple times. IIf you want to include a procedure in a REPEAT command, enclose it in a LBEGIN-END statement. Otherwise, only the first statement in the procedure repeats.  >------------------------------------------------------------  - REPEAT integer-expression qli-statement  >------------------------------------------------------------  QLI> repeat 5 store ski_areas  "QLI> repeat *.'number of items' CON> store ski_areas  %QLI> repeat 5 begin :procedure end hhDQLI RESTRUCTURE QLI  /L KThe RESTRUCTURE statement lets you copy data from one relation to another Land/or from one database to another. QLI automatically matches fields and ,copies values from one relation to another.  ?------------------------------------------------------------  * [ database-handle.]relation-name = rse  ?------------------------------------------------------------  9QLI> city_states = cities cross states over state with CON> population > 500000 hh~QLI ROLLBACK QLI  /EEThe ROLLBACK command ends a transaction and undoes all changes made ;to the database since the most recent transaction started.  =------------------------------------------------------------  ) ROLLBACK [ database-handle-commalist ]  =------------------------------------------------------------  CThe following example performs some unspecified data manipulation Bactivities and then undoes the changes, thus not writing them to the database:  QLI> ready atlas.gdb  .  .  . QLI> rollback hhQLI RSE QLI  /=;The rse (record selection expression) clause specifies the 5search and delivery conditions for record retrieval.  =------------------------------------------------------------  . [FIRST-CLAUSE] RECORD-SOURCE [WITH-CLAUSE] $ [REDUCED-CLAUSE] [SORTED-CLAUSE]  - record-source ::= { relation-clause | } - { cross-source }  = relation-clause ::= [context-variable IN] relation-name  : cross-source ::= relation-clause CROSS record-source  =------------------------------------------------------------ hhQLI SET QLI  /GGThe SET command lets you change various environmental features of QLI.  >------------------------------------------------------------   SET [ no ] set-option  ?------------------------------------------------------------ hhQLI SHOW QLI  /DDThe SHOW command displays information about a readied database and its entities.  =------------------------------------------------------------   SHOW show-option  >------------------------------------------------------------ hhQLI STORE QLI  /?:The STORE statement inserts a new record into a relation.  ?------------------------------------------------------------  7 STORE relation-name [ USING assignment-statement ]  >------------------------------------------------------------  QLI> store ski_areas Enter NAME: Reedy Run Enter TYPE: N Enter CITY: Groton Enter STATE: MA QLI>  QLI> store ski_areas CON> begin CON> name = 'Moose Pond' CON> type = 'N' CON> city = 'Dixville Notch CON> state = 'NH' CON> end QLI> hh,QLI THEN QLI  /> 5The THEN statement lets you sequence QLI statements.  =------------------------------------------------------------  ( qli-statement THEN qli-statement  >------------------------------------------------------------  'QLI> for ski_areas with state = 'VT' CON> print then modify type hhfQLI VALUE_EXPRESSION QLI  /EBThe value-expression is a symbol or string of symbols from which EQLI calculates a value. QLI uses the result of the expression when 9executing the statement in which the expression appears.  =------------------------------------------------------------  < value-expression ::= { ARITHMETIC-EXPRESSION | } < { DBFIELD-EXPRESSION | } < { FIRST-EXPRESSION | } < { NUMERIC-LITERAL-EXPRESSION | } < { QUOTED-STRING-EXPRESSION | } < { STATISTICAL-EXPRESSION | } < { (value-expression) | } < { - value-expression }  =------------------------------------------------------------ hhhQLI COMMIT QLI  /A-;COMMIT can be a command or a statement. It makes changes a permanent part of the database.  >When typed to the qli prompt, COMMIT is a command. It changes Athe transaction environment, letting others see your changes and ?letting you see changes that others have made to the database.  =When you type COMMIT inside another statement (e.g. for, if- =else,or begin-end) qli executes a COMMIT statement. A COMMIT =statement makes your changes permanent and available to oth- Aers. It does not change your transaction environment. You cannot =see changes that others have made to the database since your transaction began.  =You can use COMMIT in conjunction with the prepare statement @to execute a two-phase commit. InterBase automatically executes @such a commit when necessary, but, if required, you can control ?the two-phase commit explicitly. See the entry for PREPARE in the Qli Reference Guide.  <-----------------------------------------------------------  ( COMMIT [ database-handle-commalist ]  >------------------------------------------------------------   >The following example readies a database and, stores a record @which starts a transaction. The final line commits the transac- tion:  QLI> ready atlas.gdb QLI> store ski_areas  .  .  . QLI> commit  @The following example stores records in a loop, committing each one:  QLI> repeat 10 begin CON> store river_states CON> commit CON> end hhQLI ASSIGNMENT QLI  /A;The assignment statement assigns values to fields in the 5MODIFY and STORE statements, or values to variables.  =------------------------------------------------------------  Field Assignment:  6 dbfield-expression-1 ::= { value-expression | A edit [ dbfield-expression-2 ] }  : dbfield-expression ::= [ context-variable .] field-name  Variable Assignment:  * variable-name = value-expression  =------------------------------------------------------------  QLI> store ski_areas using CON> begin CON> city = "Andover" CON> state = "MA" %CON> name = "Parker State Forest" CON> type = "N" CON> end QLI>  .QLI> for c in cities with c.city = "Boston" 7CON> modify using c.population = c.population * 1.10 QLI> hhQLI DELETE QLI  /? ?The DELETE statement erases one or more records in a relation.  >------------------------------------------------------------  ; DELETE FROM relation-name [ alias ] [ WHERE predicate ]  >------------------------------------------------------------  QLI> delete from cities- "CON> where population < 100000;  QLI> delete from ski_areas- (CON> where name = 'Birchwood Slopes'; hhQLI HELP QLI  /FEThe HELP command provides assistance on QLI commands and statements. @The help message that QLI provides is a subset of the reference Dmaterial in the "InterBase Qli User's Guide." See the user's guide Cfor a complete syntactic and semantic description of QLI commands, &statements, clauses, and expressions.  DIf you do not ask for HELP on a command or statement, QLI displays @a listing of what HELP is available. If you ask for HELP on a Fsubject for which there is no assistance, QLI tells you that no help is available for that subject.  =------------------------------------------------------------  ) HELP [ qli-command | qli-statement ]  >------------------------------------------------------------  QLI> help  QLI> help store hhNQLI SPAWN QLI  /@ @The SPAWN command lets you execute shell commands from the QLI environment on VMS systems.  >------------------------------------------------------------   SPAWN 'dcl-command'  >------------------------------------------------------------  QLI> spawn 'show sys' hhQLI PREDICATE QLI  /DDThe predicate clause is used in the where-clause of the DELETE and AUPDATE statements and of the select-expression to specify which -records are to be affected by the statement.  =------------------------------------------------------------  : predicate ::= { condition | } : { condition AND predicate | } : { condition OR predicate | } : { NOT predicate }  6 condition ::= { COMPARE-CONDITION | } 6 { BETWEEN-CONDITION | } 6 { LIKE-CONDITION | } 6 { IN-CONDITION | } 6 { EXISTS-CONDITION | } 6 { (predicate) }  =------------------------------------------------------------ hhQLI PREPARE QLI  /EDThe PREPARE statement signals your intention to commit the default Etransaction. This statement executes the first phase of a two-phase commit.  =------------------------------------------------------------  * PREPARE [ database-handle-commalist ]  =------------------------------------------------------------  #QLI> ready remote_database_1.gdb QLI> ready local_database.gdb #QLI> ready remote_database_2.gdb  .  .  . QLI> prepare QLI> commit QLI> hhQLI SCALAR_EXPRESSION QLI  /==The scalar expression is a symbol or string of symbols used <in predicates to calculate a value. QLI uses the result of :the expression when executing the statement in which the expression appears.  =------------------------------------------------------------  : [ + | - ] scalar-value [arith-oper scalar-expression]  2 scalar-value ::= { FIELD-EXPRESSION | } 2 { CONSTANT-EXPRESSION | } 2 { (scalar-expression) }   arith-oper ::= { + | }  { - | }  { * | }  { / | }  { | }  =------------------------------------------------------------ hh6QLI SELECT QLI  /EEThe SELECT statement finds the record(s) of the relations specified <in the from clause that satisfy the given search condition.  =------------------------------------------------------------  ? select-statement ::= select-expression [ ordering-clause ]  6 ordering-clause ::= ORDER BY sort-key-commalist  E sort-key ::= { ASC | DESC } { database-field | integer }  =------------------------------------------------------------  &QLI> select city, state, population 'CON> from cities where state = 'MA';  (QLI> select city, state, population - 1CON> from cities where state = 'MA' order by - CON> city, state;  4QLI> select c.city, c.population, s.state_name, - 'CON> from cities c, states s where - *CON> c.state = s.state order by s.state hhpQLI SELECT_EXPRESSION QLI  /=8The select-expression specifies the search and delivery !conditions for record retrieval.  =------------------------------------------------------------  & { SELECT-CLAUSE | WHERE-CLAUSE }  =------------------------------------------------------------ hhrQLI SHELL QLI  /@ @The SHELL command lets you execute shell commands from the QLI 0environment on APOLLO, ULTRIX, and SUN systems.  >------------------------------------------------------------   SHELL 'shell-command'  >------------------------------------------------------------  QLI> shell 'date' hhQLI UPDATE QLI  /??The UPDATE statement changes the values of one or more fields in a record in a relation.  >------------------------------------------------------------   UPDATE relation-name SET assignment-commalist  [ WHERE predicate ]  9 assignment ::= database-field = scalar-expression  >------------------------------------------------------------  2QLI> update cities set altitude = altitude - 10   QLI> update cities - 'CON> set altitude = altitude - 100 - %CON> where state in ("CA", "WA");   QLI> update cities - 5CON> set altitude = altitude * 1.1, state = 'NA' - CON> where state = 'NY' hhQLI GDML QLI  /CAGDML is a data manipulation language for accessing InterBase and CDSRI-compatible databases. Qli supports a subset of GDML, so you @can test your algorithms interactively before coding a program.  9Qli supports the following data manipulation statements:  0 - PRINT display records from a record stream. - FOR create a record stream. . - STORE insert new records into a relation. $ - MODIFY update fields in records.  - ERASE delete records.  ?It also supports the following expressions used in statements:   - RSE record selection. 2 - VALUE_EXPRESSION calculate and express values. 7 - BOOLEAN_EXPRESSION establish relationships between  value expressions.  5It also supports the following transaction commands, Bbut generally with somewhat different meaning than embedded GDML:  & - READY open a database for access. : - PREPARE execute the first phase of a two-phase commit. ; - COMMIT save database changes made during a transaction. 4 - ROLLBACK undo changes made during a transaction.  CFor a detailed introduction to the use of the GDML variant of qli, see the "Qli Guide." hhQLI CONTINUATION QLI  /I&EThere are several ways to to continue a command across lines in QLI:  =1) Put a hyphen at the end of the line you want to continue:   QLI> print cities-  CON> with population > 100000  C If you do not use a hyphen, and there is enough of a command to C execute, QLI will execute it. For example, the preceding query D limited the displayed records to only those with a price of less I than 100. However, if the query did not include the hyphen after the @ relation name "cities", QLI would have displayed all records  in the cities relation.  ;2) Break the command in the midst of a logical unit. For example:   QLI> print cities with  CON> population > 100000  B In this case, QLI couldn't do anything without the rest of the E search condition, so it prompted for more. However, breaking the B command at an appropriate point, although an exact science, is ! vulnerable to operator error.  "3) Use the SET SEMICOLON command:   QLI> set semicolon  E QLI does not execute any command or statement until it encounters  a semicolon:  QLI> print CON> cities CON> with  CON> population  CON> > CON> 10000; hhQLI SQL QLI  /M&FSQL is a data manipulation language for relational database access. MQli supports a subset of SQL, so you can test your algorithms interactively before coding a program.  +Qli supports the following SQL statements:  0 - SELECT display records from a record stream. . - INSERT insert new records into a relation. $ - UPDATE update fields in records.  - DELETE delete records.  9It also supports the following data definition commands:  ; - ALTER TABLE drops fields from or adds fields to tables < - CREATE DATABASE creates a database and its system tables . - CREATE INDEX creates an index for a table 0 - CREATE TABLE creates a table and its fields - - DROP DATABASE deletes an entire database - DROP INDEX deletes an index  - DROP TABLE deletes a table  - DROP VIEW deletes a view  ?It also supports the following expressions used in statements:  ' - SELECT_EXPRESSION record selection. 3 - SCALAR_EXPRESSION calculate and express values. / - PREDICATE establish relationship between  value expressions.  5It also supports the following transaction commands:  & - READY open a database for access. : - PREPARE execute the first phase of a two-phase commit. ; - COMMIT save database changes made during a transaction. 4 - ROLLBACK undo changes made during a transaction.  BFor a detailed introduction to the use of the SQL variant of qli, see the "Qli Guide." hhQLI COMPARE_CONDITION QLI PREDICATE  /GAThe compare-condition describes the characteristics of a single Ascalar expression (for example, a missing or null value) or the @relationship between two scalar expressions (for example, x is greater than y ).  ?------------------------------------------------------------  >{ scalar-expression comparison-operator scalar-expression | G scalar-expression comparison-operator (column-select-expression) | + scalar-expression IS [ NOT ] NULL }  C comparison-operator ::= { = | ^= | < | ^< | <= | > | ^> | >= }   column-select-expression ::= F SELECT [ DISTINCT ] scalar-expression from-clause [ where-clause ]  ?------------------------------------------------------------  9QLI> select * from cities where population is not null;  hhQLI BETWEEN_CONDITION QLI PREDICATE  /G GThe between-condition specifies an inclusive range of values to match.  >------------------------------------------------------------  6 database-field [ NOT ] BETWEEN scalar-expression-1  AND scalar-expression-2  =------------------------------------------------------------  9QLI> select city, state, population from cities where - .CON> population between 100000 and 250000 hh QLI LIKE_CONDITION QLI PREDICATE  /? <The like-condition matches a string with the whole or part /of a field value. The test is case-sensitive.  ?------------------------------------------------------------  1 database-field [ NOT ] LIKE scalar-expression  >------------------------------------------------------------  9QLI> select * from states where capitol like '%ville%'; hhYQLI IN_CONDITION QLI PREDICATE  /GGThe in-condition lists a set of scalar expressions as possible values.  ?------------------------------------------------------------  1 scalar-expression [ NOT ] IN ( set-of-scalars )   set-of-scalars ::= 8 { constant-commalist | column-select-expression }   column-select-expression ::= + SELECT [ DISTINCT ] scalar-expression & from-clause [ where-clause ]  ?------------------------------------------------------------  GQLI> select city, state from cities where state in ('NY', 'NJ', 'CT'); hhQLI EXISTS_CONDITION QLI PREDICATE  /J>The exists-condition tests for the existence of at least one 5qualifying record identified by the select subquery. 4Because the exists-condition uses the parenthesized DSELECT statement only to retrieve a record for comparison purposes, /it requires only wildcard (*) field selection.  BA predicate containing an exists-condition is true if the set of Jrecords specified by the select-expression includes at least one record. DIf you add NOT, the predicate is true if there are no records that satisfy the subquery.  ?------------------------------------------------------------  / [ NOT ] EXISTS ( SELECT * where-clause )  =------------------------------------------------------------  hhQLI FIELD_EXPRESSION QLI SCALAR_EXPRESSION  />2The field-expression references a database field.  =------------------------------------------------------------  9 [ relation-name. | view-name. | alias.]database-field  >------------------------------------------------------------  2QLI> select * from cities where city = 'Boston'  :QLI> select population, altitude, latitude, longitude - )CON> from cities where city = 'Boston'  4QLI> select city, state, population from cities - "CON> where population > 1000000  =QLI> select c.city, s.state_name from cities c, states s - CON> where s.state = c.state hhQLI CONSTANT_EXPRESSION QLI SCALAR_EXPRESSION  /D AThe constant-expression is a string of ASCII digits interpreted 0as a number or as a string of ASCII characters.  ?------------------------------------------------------------  D { integer-string | decimal-string | float-string | ascii-string }  >------------------------------------------------------------  2QLI> select * from cities where city = 'Boston'  4QLI> select city, state, population from cities - "CON> where population > 1000000 hh@QLI SELECT_CLAUSE QLI SCALAR_EXPRESSION  /BBThe select-clause lists the fields to be returned and the source relation or view.  =------------------------------------------------------------  4 SELECT [ DISTINCT ] scalar-expression-commalist ! FROM from-item-commalist  , from-item ::= relation-name [ alias ]  ?------------------------------------------------------------   -QLI> select distinct state from ski_areas;  4QLI> select city, state, population from cities - $CON> where population is not null  =QLI> select c.city, s.state_name from cities c, states s - <CON> where c.state = s.state and c.population not missing  hhzQLI WHERE_CLAUSE QLI SCALAR_EXPRESSION  /AAThe where-clause specifies search conditions or combinations of search conditions.  =------------------------------------------------------------   WHERE predicate  =------------------------------------------------------------  4QLI> select city, state, population from cities - $CON> where population is not null  =QLI> select c.city, s.state_name from cities c, states s - <CON> where c.state = s.state and c.population not missing hhQLI FIRST_CLAUSE QLI RSE  /??The first-clause limits the records in a stream to the number ;you specify with an integer. QLI truncates any fractional <portion of the integer. Unless you sort the record stream :when you use this clause, QLI returns "n" random records.  =------------------------------------------------------------   FIRST integer  =------------------------------------------------------------  9QLI> for first 2 states sorted by descending statehood ?CON> print state_name | ' was admitted to the Union on ' | - CON> statehood  hhQLI RELATION_CLAUSE QLI RSE  /I&AThe relation-clause identifies the target relation and declares context variables.  =------------------------------------------------------------  ; [ context-variable IN] [ database-handle.]relation-name  =------------------------------------------------------------  9QLI> for first 2 states sorted by descending statehood ICON> print state_name | ' was admitted to the Union on ' | statehood  9QLI> for s in states cross ski in ski_areas over state .CON> print ski.name, ski.city, s.state_name  3QLI> for s in states cross ski in ski_areas with CON> s.state = ski.state .CON> print ski.name, ski.city, s.state_name  (QLI> print ski_areas reduced to state  ?QLI> for cities with state = 'TX' and population not missing (CON> print city, population, altitude  :QLI> for s in states cross c in cities over state cross 0CON> cs in cities with cs.state = c.state and CON> cs.city = s.capitol and $CON> cs.population < c.population !CON> sorted by s.state, c.city ACON> print c.city, s.state_name, ' is larger than ', s.capitol  :QLI> for s in states cross c in cities over state cross 0CON> cs in cities with cs.state = c.state and CON> cs.city = s.capitol and $CON> cs.population < c.population CON> sorted by s.state %CON> reduced to s.state, s.capitol FCON> print s.state_name, ' contains cities larger than ', s.capitol hhQLI CROSS_CLAUSE QLI RSE  /F%,The cross-clause performs a join operation.  ?------------------------------------------------------------  6 CROSS relation-clause [ OVER field-name-commalist ]  < dbfield-expression ::= [ context-variable. ] field-name  >------------------------------------------------------------  =The OVER clause is semantically equivalent to a WITH-CLAUSE >that equates a field in one relation with a field in another. ;The field-name must be exactly the same in both relations. >Otherwise, you must use the WITH-CLAUSE, even if both fields are based on the same field.  9QLI> for s in states cross ski in ski_areas over state .CON> print ski.name, ski.city, s.state_name  3QLI> for s in states cross ski in ski_areas with CON> s.state = ski.state .CON> print ski.name, ski.city, s.state_name  :QLI> for s in states cross c in cities over state cross 0CON> cs in cities with cs.state = c.state and CON> cs.city = s.capitol and $CON> cs.population < c.population !CON> sorted by s.state, c.city ACON> print c.city, s.state_name, ' is larger than ', s.capitol  :QLI> for s in states cross c in cities over state cross 0CON> cs in cities with cs.state = c.state and CON> cs.city = s.capitol and $CON> cs.population < c.population CON> sorted by s.state %CON> reduced to s.state, s.capitol FCON> print s.state_name, ' contains cities larger than ', s.capitol hhQLI REDUCED_CLAUSE QLI RSE  /B BThe reduced-clause performs a project operation, retrieving only the unique values for a field.  ?------------------------------------------------------------  . REDUCED [ TO ] dbfield-expression-commalist  9 dbfield-expression ::= [ context-variable.]field-name  ?------------------------------------------------------------  (QLI> print ski_areas reduced to state hhQLI SORTED_CLAUSE QLI RSE  /I BThe sorted-clause orders the output, returning the record stream /sorted by the values of one or more sort keys.  >------------------------------------------------------------  # SORTED [ BY ] sort-key-commalist  A sort-key ::= [ ASCENDING | DESCENDING ] [ANYCASE | EXACTCASE ]  dbfield-expression  9 dbfield-expression ::= [ context-variable.]field-name  >------------------------------------------------------------   9QLI> for first 2 states sorted by descending statehood ICON> print state_name | ' was admitted to the Union on ' | statehood  :QLI> for s in states cross c in cities over state cross 0CON> cs in cities with cs.state = c.state and CON> cs.city = s.capital and %CON> cs.population < c.population - !CON> sorted by s.state, c.city ACON> print c.city, s.state_name, ' is larger than ', s.capital  :QLI> for s in states cross c in cities over state cross 0CON> cs in cities with cs.state = c.state and CON> cs.city = s.capital and %CON> cs.population < c.population - CON> sorted by s.state - %CON> reduced to s.state, s.capital FCON> print s.state_name, ' contains cities larger than ', s.capital hhQLI WITH_CLAUSE QLI RSE  /F@The with-clause specifies a search condition or combination of search conditions.  >------------------------------------------------------------   WITH boolean-expression  =------------------------------------------------------------  3QLI> for s in states cross ski in ski_areas with CON> s.state = ski.state .CON> print ski.name, ski.city, s.state_name  ?QLI> for cities with state = 'TX' and population not missing (CON> print city, population, altitude  :QLI> for s in states cross c in cities over state cross 0CON> cs in cities with cs.state = c.state and CON> cs.city = s.capitol and $CON> cs.population < c.population !CON> sorted by s.state, c.city ACON> print c.city, s.state_name, ' is larger than ', s.capitol  :QLI> for s in states cross c in cities over state cross 0CON> cs in cities with cs.state = c.state and CON> cs.city = s.capitol and $CON> cs.population < c.population CON> sorted by s.state %CON> reduced to s.state, s.capitol FCON> print s.state_name, ' contains cities larger than ', s.capitol hh(QLI ARITHMETIC_EXPRESSION QLI VALUE_EXPRESSION  /? :The arithmetic expression combines value expressions and arithmetic operators.  ?------------------------------------------------------------  > value-expression-1 { + | - | * | / | | } value-expression-2  >------------------------------------------------------------  4QLI> for c in cities cross s in states over state 9CON> print c.city, s.state_name | ' is situated at ' | 8CON> c.altitude * 0.3048 | ' meters above sea level.'  hhbQLI DBFIELD_EXPRESSION QLI VALUE_EXPRESSION  /= :The database field expression references database fields.  =------------------------------------------------------------  # [ context-variable.]field-name  =------------------------------------------------------------  4QLI> for c in cities cross s in states over state 9CON> print c.city, s.state_name | ' is situated at ' | 8CON> c.altitude * 0.3048 | ' meters above sea level.'   hhQLI FIRST_EXPRESSION QLI VALUE_EXPRESSION  /L=The first-expression forms a record stream and evaluates an expression.  ?------------------------------------------------------------  ) FIRST value-expression-1 FROM rse $ [ ELSE value-expression-2 ]  ?------------------------------------------------------------  FThe database software finds the first qualifying record in the record Lstream. If the stream is empty, it returns an error unless you supply an <ELSE clause. Otherwise, the database software evaluates :value-expression-2 in the context of the record it found. 6The result of the evaluation is returned as the value Bof first-expression or the value specified in the ELSE clause. hhQLI NUMERIC_LITERAL_EXPRESSION QLI BOOLEAN_EXPRESSION  /> <The numeric-literal-expression represents a decimal number 6as a string of digits with an optional decimal point.  =------------------------------------------------------------   [+ | -] string[.string ]  >------------------------------------------------------------  4QLI> for c in cities cross s in states over state 9CON> print c.city, s.state_name | ' is situated at ' | 8CON> c.altitude * 0.3048 | ' meters above sea level.'  hh QLI QUOTED_STRING_EXPRESSION QLI VALUE_EXPRESSION  /B3The quoted-string-expression is a string of ASCII Bcharacters enclosed in single (') or double (") quotation marks. ASCII printing characters are: # - Uppercase alphabetic: A--Z # - Lowercase alphabetic: a--z  - Numerals: 0--9 ; - Special characters: ! @ # $ % ^ & * ( ) _ - + = ` ~ : [ ] { } < > ; : ' " | / ? . ,  ?------------------------------------------------------------  "string"  ?------------------------------------------------------------    4QLI> for c in cities cross s in states over state 9CON> print c.city, s.state_name | ' is situated at ' | 8CON> c.altitude * 0.3048 | ' meters above sea level.'  hh JQLI STATISTICAL_EXPRESSION QLI VALUE_EXPRESSION  /H:The statistical-expression ralculates a value based on a value expression.  ?------------------------------------------------------------  6 { statistical-operation value-expression OF rse |  COUNT OF rse }  ; statistical-operation ::= { AVERAGE | MAX | MIN | TOTAL }  ?------------------------------------------------------------  HIf a field value included in value-expression is missing for a record, 0that record is not included in the calculation. ?For AVERAGE , MAX , and MIN , if the record stream created by Fthe rse is empty, the value of the statistical expression is missing. DFor TOTAL and COUNT, if the record stream is empty, the total is 0.  -QLI> print count of states with state = 'NY' hh LQLI COMMAND QLI  /KBA command deals with the qli environment or its transactions. QLI Kenvironmental commands are EXIT, FINISH, QUIT, READY, SET, SHELL and SHOW. ATransaction control commands are COMMIT, PREPARE, and ROLLBACK.  EA statement reads, writes, or reports on records. QLI statements are HASSIGNMENT, BEGIN/END, DELETE, ERASE, FOR, LIST, MODIFY, PRINT, REPEAT, IREPORT, RESTRUCTURE, SELECT, STORE, and UPDATE. Procedures that contain Gstatements are also considered to be statements. The REPEAT statement Callows you to repeat a single statement or a block of statements.  GThe distinction between command and statement is important in some QLI Ccontexts, such as in blocks structured with a BEGIN/END statement; Hgenerally speaking, you cannot include a command in a begin-end block.  HQLI also provides the DECLARE VARIABLE declaration for local and global Kvariables, and a number of PROCEDURE commands for dealing with procedures, Gand METADATA update commands to change the structure of the database.  hh QLI EDIT_PROCEDURE QLI  /G DThe EDIT procedure command opens or creates the specified procedure Gin the most recently opened database, unless you qualify the procedure name with a database handle.  >------------------------------------------------------------  * EDIT [database-handle.]procedure-name  >------------------------------------------------------------  QLI> edit new_procedure hh QLI STATEMENT QLI  /KBA command deals with the qli environment or its transactions. QLI Kenvironmental commands are EXIT, FINISH, QUIT, READY, SET, SHELL and SHOW. ATransaction control commands are COMMIT, PREPARE, and ROLLBACK.  EA statement reads, writes, or reports on records. QLI statements are HASSIGNMENT, BEGIN/END, DELETE, ERASE, FOR, LIST, MODIFY, PRINT, REPORT, KRESTRUCTURE, SELECT, STORE, and UPDATE. Procedures that contain statements Kare also considered to be statements. You can also repeat statements using the REPEAT command.  GThe distinction between command and statement is important in some QLI Ccontexts, such as in blocks structured with a BEGIN/END statement; Hgenerally speaking, you cannot include a command in a begin-end block.  HQLI also provides the DECLARE VARIABLE declaration for local and global Gvariables, and several PROCEDURE commands for dealing with procedures. hh QLI REPORT QLI  /A2The REPORT command invokes QLI's report writer.  ?------------------------------------------------------------  1REPORT rse [ ON 'filespec' | TO shell-command ]  , [ SET report_name = value-expression ]  [ SET columns = n ]  [ SET lines = n ] 1 [ AT TOP OF REPORT [ PRINT ] print-list ] 4 [ AT BOTTOM OF REPORT [ PRINT ] print-list ] / [ AT TOP OF page [ PRINT ] print-list ] 9 [ AT TOP OF database-field PRINT print-list ]... ; [ AT BOTTOM OF database-field PRINT print-list ]...  print-statement 2END_REPORT [ ON 'filespec' | TO shell-command ]  =------------------------------------------------------------  AQLI> report cities with population not missing sorted by state CON> set columns = 75 CON> set lines = 55 9CON> set report_name = 'C I T I E S B Y S T A T E' #CON> at top of state print state =CON> print city, population, altitude, latitude, longitude CON> end_report hh QLI LIST QLI  /FDThe LIST statement displays fields from records in a record stream. FUnlike the PRINT statement, LIST displays field values in a vertical format.  =------------------------------------------------------------  )LIST value-expression-commalist of rse * [ ON 'filespec' | TO shell-command ]  ?------------------------------------------------------------  QLI> list states  ?QLI> list state, capitol, area of states on 'state_data.dat' hh 2QLI IF_ELSE QLI  /AAThe IF-ELSE statement provides an if-then-else structure in QLI.  >------------------------------------------------------------  ! IF boolean-expression [ THEN ]  qli-statement  ELSE  qli-statement  >------------------------------------------------------------  9Qli requires a hyphen after the first END. For example:   if expression  begin  qli-statement  qli-statement  end - else  begin  qli-statement  qli-statement  end   /QLI> if full_name = " " or full_name missing CON> print ... CON> else print ... hh lQLI DECLARE_VARIABLE QLI  /C@The DECLARE command lets you declare local and global variables Cfor use in QLI. You can use variables in statements, reports, and Aprocedures. To assign a value to a variable, use the ASSIGNMENT statement.  >------------------------------------------------------------  % DECLARE variable-name datatype  1 datatype ::= { SHORT [ scale-clause ] | 3 LONG [ scale-clause ] | 1 FLOAT | DOUBLE | 6 CHAR [n] | VARYING [n] | ; DATE }  ) scale-clause ::= SCALE [-] n  >------------------------------------------------------------  QLI> declare glarp long QLI> glarp = 617  QLI> declare glarp long #QLI> glarp = *.'value for glarp' Enter value for glarp: 412 hh QLI RENAME_PROCEDURE QLI  /HHThe RENAME PROCEDURE command changes the name of an existing procedure. HQLI looks for the procedure in the most recently opened database unless Eyou qualify the procedure name with a database handle. Both the old 0and new procedure must be in the same database.   =------------------------------------------------------------  : RENAME PROCEDURE [database_handle.]old-name [ TO ]  [database_handle.]new-name  ?------------------------------------------------------------  4QLI> rename procedure capitol_info to capital_info hh QLI COMPARISON_CONDITION QLI BOOLEAN_EXPRESSION  /D DThe comparison-condition describes the characteristics of a single expression.  ?------------------------------------------------------------  > value-expression-1 relational-operator value-expression-2  >------------------------------------------------------------  %QLI> print cities with state = 'NY' hh QLI STARTING_CONDITION QLI BOOLEAN_EXPRESSION  /J JThe starting-condition tests for the presence of string (case-sensitive) Dat the beginning of value-expression. It evaluates to true if the =first characters of value-expression match the given string.  >------------------------------------------------------------  > value-expression-1 [ NOT ] STARTING WITH value-expression-2  >------------------------------------------------------------  8QLI> print states with state_name starting with 'New' hh QLI MATCHING_CONDITION QLI BOOLEAN_EXPRESSION  /JDThe matching-condition tests for the presence of wildcarded-string, Ja string that can contain the wildcard characters * and ?. The asterisk Cmatches an unspecified run of characters, while the question mark <matches a single character. This test is case-insensitive.  >------------------------------------------------------------  : value-expression-1 [ NOT ] MATCHING value-expression-2  >------------------------------------------------------------  /QLI> print cities with city matching '*ton*'  -QLI> print states with state matching 'N?' hh TQLI CONTAINING_CONDITION QLI BOOLEAN_EXPRESSION  /B ;The containing-condition tests for the presence of string B(case-insensitive) anywhere in a value expression. It evaluates Ato true if string is contained in the value expression. If the <value of the expression is missing, the result is missing.  =------------------------------------------------------------  ; value-expression-1 [ NOT ] CONTAINING value-expression-2  >------------------------------------------------------------  1QLI> print cities with city containing 'ville' hh QLI ANY_CONDITION QLI BOOLEAN_EXPRESSION  /FFThe any-condition tests for the existence of at least one qualifying Drecord in a relation or relations. This expression is true if the Frecord stream specified by the RSE includes at least one record. If Dyou add NOT, the expression is true if there are no records in the record stream.  >------------------------------------------------------------   [ NOT ] ANY rse  >------------------------------------------------------------  7QLI> for s in states with any c in cities over state CON> print s.state_name hh QLI UNIQUE_CONDITION QLI BOOLEAN_EXPRESSION  /IHThe unique-condition tests for the existence of exactly one qualifying Grecord. This expression is true if the record stream specified by the IRSE consists of only one record. If you add NOT, the condition is true Hif there is more than one record in the record stream or if the record stream is empty.  >------------------------------------------------------------   [ NOT ] UNIQUE rse  >------------------------------------------------------------  ?QLI> for s in states with unique ski in ski_areas over state CON> print s.state_name hh QLI BETWEEN_CONDITION QLI BOOLEAN_EXPRESSION  /I GThe between-condition tests whether value-expression-1 occurs between Itwo other value expressions, value-expression-2 and value-expression-3. /This test is inclusive of the boundary values.  >------------------------------------------------------------  % value-expression-1 [ NOT ] BETWEEN / value-expression-2 AND value-expression-3  >------------------------------------------------------------  <QLI> for cities with population between 100000 and 250000 %CON> print city, state, population hh QLI PROCEDURES QLI  /ICQLI procedures are more like macros than subroutines in a program. FA procedure can be a whole statement, several or many statements, or Ieven a single token. Invoking a procedure causes it to be expanded and 2executed as if it had been typed directly to QLI.  ATo make a multiple statement procedure behave like a subroutine, Henclose it in a BEGIN-END block. This will keep variable declarations Ewithin the block from affecting variables with the same name in the Hregular session and will cause the whole procedure to be executed as a single statement.  BWhen a procedure is invoked, its text is copied into the current <command, so a procedure that consists of several statements Dis parsed and executed as several separate statements, even though Git is invoked in a single word. When you want a procedure to execute Eas a single unit, either include a BEGIN-END block in the procedure Gdefinition, put the procedure invocation itself in a BEGIN-END block, Dor both. Because BEGIN-END blocks can be nested arbitrarily deep, ,the extra BEGIN-END will cause no problems. hh ------------------------------------------------------------  . SHOW TRIGGERS [FOR DATABASE database-handle] 5 SHOW TRIGGERS FOR [RELATION] relation-name  >------------------------------------------------------------  QLI> show triggers (QLI> show triggers for database qli_0 #QLI> show triggers for state_view hh vQLI PROCEDURE QLI SHOW  /> <The SHOW PROCEDURE command displays the contents of a named procedure.  >------------------------------------------------------------  9 SHOW [PROCEDURE] [.]  >------------------------------------------------------------  QLI> show procedure big_cities hh xQLI SECURITY_CLASSES QLI SHOW  /> =The SHOW SECURITY_CLASSES command displays security classes >defined for the database and the objects with which they are associated.  >------------------------------------------------------------   SHOW SECURITY_CLASSES  >------------------------------------------------------------  QLI> show security_classes  hh QLI DELETE_PROCEDURE QLI  /G GThe DELETE PROCEDURE command deletes the named procedure from the most recently opened database.  >------------------------------------------------------------  6 DELETE PROCEDURE [database-handle.]procedure-name  >------------------------------------------------------------  QLI> delete procedure proc_1 hh QLI COPY_PROCEDURE QLI  /GGThe COPY PROCEDURE command copies a procedure within the most recently Eopened database, and reports an error if the old name does not exist Cor the new name already exists. You can qualify old, new, or both databases.  >------------------------------------------------------------  6 COPY PROCEDURE [database-handle.]procedure-name TO " [database-handle.]procedure-name   >------------------------------------------------------------  4QLI> copy procedure qli_0.proc_1 to qli_1.new_proc hh QLI BLR QLI SET  /C CThe SET BLR command displays the Binary Language Representation of 6the query before displaying the results of the query.  >------------------------------------------------------------   SET [NO] BLR  >------------------------------------------------------------  QLI> set blr hh QLI CONTINUATION QLI SET  /C CThe SET CONTINUATION command replaces the CON> continuation prompt with one of your own choosing.  >------------------------------------------------------------   SET CONTINUATION "string"  >------------------------------------------------------------  QLI> set continuation "MORE>" QLI> for states with "MORE> state_name containing "New" hh $QLI ECHO QLI SET  /C CThe SET ECHO command displays procedure commands and statements as a procedure is ececuted.  >------------------------------------------------------------   SET [NO] ECHO  >------------------------------------------------------------  QLI> set echo hh &QLI PROMPT QLI SET  /B BThe SET PROMPT command replaces the QLI> prompt with one of your own choosing.  >------------------------------------------------------------   SET PROMPT "string"  >------------------------------------------------------------  QLI> set prompt "Huh?" Huh? for states with !CON> state_name containing "New" hh ^QLI SEMICOLON QLI SET  /DDThe SET SEMICOLON command changes QLI's line continuation behavior.  >------------------------------------------------------------   SET [NO] SEMICOLON  >------------------------------------------------------------  QLI> set semicolon "QLI> for states with state_name ?CON> containing "New" and capitol not containing "ville" print CON> state_name, area;  .  .  . QLI> set no semicolon; hh `QLI STATISTICS QLI SET  /F FThe SET STATISTICS command displays system statistics after executing a query.  >------------------------------------------------------------   SET [NO] STATISTICS  >------------------------------------------------------------  QLI> set statistics hh QLI ALL QLI SHOW  /A AThe SHOW ALL command displays the file specification and handle =for all readied databases, the relation names, and the field 'names and datatypes for each relation.  >------------------------------------------------------------  SHOW ALL  >------------------------------------------------------------  QLI> show all hh QLI FIELDS QLI SHOW  /D CThe SHOW FIELDS command displays all fields and datatypes for each Drelation in a readied database, or only for the specified relation.  >------------------------------------------------------------  ! SHOW FIELDS [FOR relation-name]  >------------------------------------------------------------  QLI> show fields QLI> show fields for states hh QLI DATABASES QLI SHOW  /J JThe SHOW DATABASES command displays the file specification and handle for for all readied databases.  >------------------------------------------------------------   SHOW DATABASES  >------------------------------------------------------------  QLI> show databases hh QLI DATABASE QLI SHOW  /I IThe SHOW DATABASE command displays the file specification and handle for &the database specified by the handle.  >------------------------------------------------------------   SHOW DATABASE database-handle  >------------------------------------------------------------  QLI> show database QLI_0 hh QLI INDEXES QLI SHOW  /D DThe SHOW INDEXES command displays for each relation the name of any Aindex that has been defined, the fields that comprise the index, )and whether or not it is a unique index.  >------------------------------------------------------------   SHOW { INDEXES | INDICES }  >------------------------------------------------------------  QLI> show indexes hhQLI INDICES QLI SHOW  /D DThe SHOW INDICES command displays for each relation the name of any Aindex that has been defined, the fields that comprise the index, )and whether or not it is a unique index.  >------------------------------------------------------------   SHOW { INDEXES | INDICES }  >------------------------------------------------------------  QLI> show indices hhFQLI PROCEDURE_NAME QLI SHOW  /G GThe SHOW PROCEDURE-NAME command displays the file specification of the Gdatabase where the procedure is stored, and the text of the procedure.  >------------------------------------------------------------   SHOW procedure-name  >------------------------------------------------------------  QLI> show procedure_1 hhHQLI PROCEDURES QLI SHOW  /D DThe SHOW PROCEDURE command displays the names of procedures for all readied databases.  >------------------------------------------------------------   SHOW PROCEDURES  >------------------------------------------------------------  QLI> show procedures hhQLI RELATION_NAME QLI SHOW  /G GThe SHOW RELATION-NAME command displays the field names and datatypes for the specified relation.  >------------------------------------------------------------   SHOW relation-name  >------------------------------------------------------------  QLI> show cities hhQLI READY QLI SHOW  /F FThe SHOW READY command displays the file specification and handle for all readied databases.  >------------------------------------------------------------  SHOW READY  >------------------------------------------------------------  QLI> show ready hhQLI SYSTEM_RELATIONS QLI SHOW  /C CThe SHOW SYSTEM RELATIONS command displays the names of the system %relations for each readied database.  >------------------------------------------------------------   SHOW SYSTEM [RELATIONS]  >------------------------------------------------------------  QLI> show system hhQLI VARIABLES QLI SHOW  /E EThe SHOW VARIABLES command displays the names of declared variables.  >------------------------------------------------------------   SHOW VARIABLES  >------------------------------------------------------------  QLI> show variables hhQLI VERSION QLI SHOW  /@ @The SHOW VERSION command displays release information about QLI "and the access method being used.  >------------------------------------------------------------   SHOW VERSION  >------------------------------------------------------------  QLI> show version hhQLI DDL QLI  /L!CQLI supports a significant subset of the data definition language. Using QLI, you can:  1 - Define a database, field, relation, and index 1 - Delete a database, field, relation, and index 6 - Modify a database by changing a field or relation  DHowever, you cannot use QLI to perform any operation on a security Hclass, trigger, or view. For example, the following statements define a database and a relation:  # QLI> define database "phones.gdb"  QLI> define relation numbers  CON> first_name varying [10],  CON> last_name varying [15],  CON> area_code char [3],  CON> phone char [8];  QLI>  FMake sure you follow QLI's line continuation conventions, or set the Csemicolon switch for totally predictable behavior. The semicolon Kswitch tells QLI not to process a command until it encounters a semicolon.  QLI> set semicolon  HOnce you have defined a database and a relation, you can begin storing Gdata. If you encounter an error while defining or modifying metadata, =you can use QLI's EDIT command to edit preceding statements.  LQLI commits metadata changes as soon you make them, so a COMMIT or ROLLBACK Acommand affects only user data. Therefore, be very careful about Ideleting relations for which there are records stored or dropping fields that have values. hhQLI DEFINE_METADATA QLI  /H BQLI supports a significant subset of the DEFINE commands used by HGDEF, InterBase's data definition language (DDL) compiler. Using QLI, Fyou can define a database and relations, fields, and indexes for the database.  >------------------------------------------------------------  . DEFINE database-entity entity-name [options]  >------------------------------------------------------------ hh/QLI DELETE_METADATA QLI  />:The DELETE command removes the specified database object.  >------------------------------------------------------------   DELETE object-option  >------------------------------------------------------------ hh1QLI MODIFY_METADATA QLI  /H BQLI supports a significant subset of the MODIFY commands used by HGDEF, InterBase's data definition language (DDL) compiler. Using QLI, @you can modify relations, fields, and indexes for the database.  >------------------------------------------------------------  . MODIFY database-entity entity-name [options]  >------------------------------------------------------------ hhhQLI DATABASE QLI DEFINE_METADATA  /? ?The DEFINE DATABASE command creates a database and readies the #newly created database for access.  >------------------------------------------------------------  # DEFINE DATABASE quoted-filespec  >------------------------------------------------------------  !QLI> define database "boats.gdb"  3QLI> define database "/usr/gds/examples/atlas.gdb" hhQLI FIELD QLI DEFINE_METADATA  /IGThe DEFINE FIELD command describes the characteristics of a new field #for later inclusion in a relation.  ITo disallow duplicate values for a field, define an index for the field Iin the relation using the unique option. See the help for DEFINE INDEX -for more information about defining indexes.   >------------------------------------------------------------  = DEFINE FIELD field-name datatype [query-name] [edit-string]  >------------------------------------------------------------  +QLI> define field tolerance short scale -2  QLI> define field blurb blob  ;QLI> define field manufacturer char[10] query_name 'manuf'  QLI> define field price float  &QLI> define field part_number char[5] hhQLI RELATION QLI DEFINE_METADATA  /I)AThe DEFINE RELATION command creates a relation. A relation can Iconsist of included fields, new fields that are defined in the relation, ;and fields defined elsewhere and renamed for the relation.  >------------------------------------------------------------  ;DEFINE RELATION relation-name field-description-commalist;   field-description::= 1 { included-field | new-field | renamed-field }  >------------------------------------------------------------  QLI> define field state char[2] *QLI> define field state_name varying [25] #QLI> define field city varying[25]  QLI> define relation states CON> state, CON> state_name, CON> area long, CON> statehood char[4], CON> capitol based on city  QLI> define relation cities CON> city, CON> state, CON> population long, CON> altitude long, !CON> latitude_degrees varying[3] CON> query_name latd, CON> latitude_minutes char[2] CON> query_name latm, CON> latitude_compass char[1] CON> query_name latc, "CON> longitude_degrees varying[3] CON> query_name longd, CON> longitude_minutes char[2] CON> query_name longm, CON> longitude_compass char[1] CON> query_name longc hhQLI INDEX QLI DEFINE_METADATA  /E"EThe DEFINE INDEX command defines an index for a relation. You must Edefine a relation before you can create an index for it. InterBase 'automatically maintains all indexes.  >------------------------------------------------------------  - DEFINE INDEX index-name [FOR] relation-name  [ {UNIQUE | DUPLICATE[S]} ]  [ {ACTIVE | INACTIVE} ]  [ {ASCENDING | DESCENDING} ]  field-name-commalist  >------------------------------------------------------------  QLI> define relation states  .  .  . QLI> define relation cities  .  .  .  (QLI> define index state_idx1 for states  unique state  *QLI> define index state_idx2 for states - 'CON> inactive unique state, state_name  (QLI> define index river_idx1 for rivers CON> descending river  0QLI> define index rivstat_idx1 for river_states CON> duplicate river, state hhQLI FIELD QLI MODIFY_METADATA  /C CThe MODIFY FIELD command changes the attributes of a global field.  >------------------------------------------------------------  > MODIFY FIELD field-name datatype [edit-string] [query-name]  >------------------------------------------------------------  6QLI> modify field capitalist_moose query_name "moose" hhQLI INDEX QLI MODIFY_METADATA  /DDThe MODIFY INDEX command changes the "uniqueness" and "activeness" Dof an index. If you want to add or drop fields from an index, you ,must delete the index and then redefine it.  >------------------------------------------------------------   MODIFY INDEX index-name  [ UNIQUE | DUPLICATE ]  [ ACTIVE | INACTIVE ]  >------------------------------------------------------------  )QLI> modify index idx_1 duplicate active QLI> modify index idx_2 unique hhQQLI COLUMNS QLI SET  /? ?The SET COLUMN command sets the maximum width of a print line.  >------------------------------------------------------------   SET COLUMN integer  >------------------------------------------------------------  QLI> set column 20 hhSQLI LINES QLI SET  /> ;The SET LINES command sets the number of lines QLI assumes "will appear on the output device.  >------------------------------------------------------------   SET LINES integer  >------------------------------------------------------------  QLI> set lines 60 hhUQLI RELATION QLI DELETE_METADATA  /K HThe DELETE RELATION command removes a relation or view from a database.  >------------------------------------------------------------   DELETE RELATION relation-name  >------------------------------------------------------------  DYou can delete any relation you want, but if you delete a relation Bthat someone else is using, the other user's program will get an Funrecoverable error. Because the DELETE RELATION command immediately Eremoves a relation and all its records, you should use this command 8with caution. The following commands delete relations:  QLI> delete relation gudgeons ,QLI> delete relation non_eeoc_approved_data  FInterBase treats views much like relations. In fact, the syntax for Fdeleting view uses the keyword RELATION. However, because a view is Fonly a virtual relation, the effect of deleting a view that is being Iused by someone else is less catastrophic than deleting a relation that His being used. In general, when you delete a view, other users should Gnot encounter any problems if they are already running their programs. GHowever, if they start up a program that references the deleted view, Kthe program fails when it tries to compile the request that mentions that view.  %The following commands delete views:  (QLI> delete relation population_density QLI> delete relation geo_cities QLI> delete relation riv_vu hhWQLI VIEW QLI DELETE_METADATA  /K HThe DELETE RELATION command removes a relation or view from a database.  >------------------------------------------------------------   DELETE RELATION relation-name  >------------------------------------------------------------  DYou can delete any relation you want, but if you delete a relation Bthat someone else is using, the other user's program will get an Funrecoverable error. Because the DELETE RELATION command immediately Eremoves a relation and all its records, you should use this command 8with caution. The following commands delete relations:  QLI> delete relation gudgeons ,QLI> delete relation non_eeoc_approved_data  FInterBase treats views much like relations. In fact, the syntax for Fdeleting view uses the keyword RELATION. However, because a view is Fonly a virtual relation, the effect of deleting a view that is being Iused by someone else is less catastrophic than deleting a relation that His being used. In general, when you delete a view, other users should Gnot encounter any problems if they are already running their programs. GHowever, if they start up a program that references the deleted view, Kthe program fails when it tries to compile the request that mentions that view.  %The following commands delete views:  (QLI> delete relation population_density QLI> delete relation geo_cities QLI> delete relation riv_vu hhQLI INDEX QLI DELETE_METADATA  /K;The DELETE INDEX command removes an index from a database.  >------------------------------------------------------------   DELETE INDEX index-name  >------------------------------------------------------------  DYou can delete any index you want, but if you delete an index that Ksomeone else is using, the other user's program will get an unrecoverable error.  (The following command deletes an index:  QLI> delete index idx4 hhQLI FIELD QLI DELETE_METADATA  /L#CThe DELETE FIELD command removes a global field from the database.  >------------------------------------------------------------   DELETE FIELD field-name  >------------------------------------------------------------  DYou can delete a field that was defined in a DEFINE FIELD or DEFINE FRELATION command. However, because fields are included in a relation, Lyou must first delete the field from each relation in which it is included. IThe following commands delete a field from a relation and then from the database:  QLI> modify relation states CON> drop statehood QLI> delete field statehood  @You must explicitly delete a field defined in a DEFINE RELATION >command after dropping it from relations in which it is used. =For example, suppose you defined the field BIRTH_DATE in an BEMPLOYEES relation, subsequently included it in another relation, Fand then decided not to keep it. The following sequence deletes the Hfield from all its instances and then finally from the database itself:  QLI> modify relation employees CON> drop birth_date "QLI> modify relation demographics CON> drop birth_date QLI> delete field birth_date  IDo not drop fields from relations unless you are sure that nothing else Hdepends on their data. Dropping fields causes programs that depend on Ithem to fail. Therefore, before deleting a field, make sure that it is ;not used in a computed field, trigger, or view definition. hhQLI RELATION QLI MODIFY_METADATA  /@@The MODIFY RELATION command can change a relation's complement ,of fields, and local field characteristics.  >------------------------------------------------------------  2MODIFY RELATION relation-name operation-commalist  8operation ::= { ADD FIELD field-name field-attributes |  DROP FIELD field-name | - MODIFY FIELD field-name field attributes }    >------------------------------------------------------------  QLI> ready test_atlas.gdb QLI> modify relation cities 9CON> add field year_incorporated char[4] query_name inc, :CON> add field type_of_government char[1] query_name gov, CON> drop field population hhQLI FORMS QLI SHOW  /> ;The SHOW FORMS command displays which forms are available.  >------------------------------------------------------------  " SHOW FORMS [FOR database-handle]  >------------------------------------------------------------  QLI> show forms hhQLI FORM QLI SET  /? ?The SET FORM command causes QLI to display a form for a PRINT, >STORE, or MODIFY statement. If a form does not exist for the (relation, QLI creates a temporary form.  >------------------------------------------------------------  SET FORM  >------------------------------------------------------------  QLI> set form hhQLI INDEX QLI CREATE_METADATA  /F<The CREATE INDEX statement defines an index for a relation.  B-----------------------------------------------------------------  = CREATE [UNIQUE] [ASCENDING|DESCENDING] INDEX index-name - ON relation-name (field-name commalist)  B-----------------------------------------------------------------  <The UNIQUE option disallows duplicate values in the index. >The values for the indexed fields must be unique. If you try Fto store a value that already exists, the assignment operation fails.  AThe ASCENDING and DESCENDING options specify the order in which Ban index is built. If neither qualifier is specified, the default @order is ascending. Using the qualifier does not replace using -the order by clause in the select statement. EThe index name must be unique among all index names in the database.  ?The following statements create a non-unique and unique index, respectively:  , QLI> create index xxx on states (capital); 1 QLI> create unique index xyz on states (state);  8The following example creates a descending index on the %LENGTH field in the RIVERS relation:  : QLI> create descending index longriv on rivers (length); hh8QLI ALTER TABLE QLI MODIFY_METADATA  /C?The ALTER TABLE statement drops a field from a table or adds a field to a table.  B-----------------------------------------------------------------  +ALTER TABLE table-name operation-commalist Boperation::={ADD field-name datatype [NOT NULL]| DROP field-name}  C-----------------------------------------------------------------  =The following statements alter tables by adding and dropping fields:   QLI> alter table states add " CON> type_of_govt char(3), add  CON> capital varchar(25);  QLI> alter table cities  CON> drop population;  hh:QLI DATABASE QLI CREATE_METADATA  /HHThe CREATE DATABASE statement creates a database and its system tables.  G----------------------------------------------------------------------  ,CREATE DATABASE filespec [PAGESIZE=integer]  G----------------------------------------------------------------------  @The file specification can contain the full pathname to another >node in the network. File specifications for remote databases have the following form.  5VMS to VMS via DECnet: node-name::filespec 5VMS to ULTRIX via DECnet: node-name::filespec 4VMS to non-VMS, non-ULTRIX node-name^filespec 6ULTRIX to VMS via DECnet //node-name/filespec 4All else node-name:filespec 8You can create databases with page sizes of 1024, 2048, =4096, and 8192 bytes. The advantage of a larger page size is Dthat it allows a more shallow ``tree'' structure in the index. Each ;index bucket is one page long, so longer pages mean larger Bbuckets and fewer levels in the index hierarchy. If you will have <more than 50,000 records in any one table, you should use a +page size of 2048 rather than the default.  EThe following statement creates a database in the current directory:  ' QLI> create database 'personnel.gdb'; hhrQLI FUNCTION QLI SHOW  /9 9The SHOW FUNCTION command lists all information about a particular function.  9--------------------------------------------------------   SHOW FUNCTION function-name  9--------------------------------------------------------   QLI> show function abs  hhtQLI MATCHING_USING_CONDITION QLI BOOLEAN_EXPRESSION  /B5?The MATCHING USING condition lets you define your own wildcard search characters.  ?--------------------------------------------------------------  2 MATCHING value-expression USING 'control-string'  / control-string ::= [prequalifier][definition-  commalist][postqualifier]   prequalifier ::= [-S(|+S(]  . definition ::= wildcard=definition-character " [definition-character...]   postqualifier ::= [)]  ?--------------------------------------------------------------  BThe prequalifier string -S( disables case sensitivity of the val- >ue-expression in the matching clause. The prequalifier string <+S( enables case sensitivity of the value-expression in the 2matching clause. The postqualifier ) is optional.   DEFINITION CHARACTER OPERATION  " ? Matches any single character  # [] Defines a class of character  , * Modifies previous definition or class: ' indicates zero or more occurrences  * @ Treats the next character as literal  ) ~ Excludes the following character or  class of characters  @A class of characters can be a list or range of characters that ?you specify inside the square brackets. For example, the range A[0-9] or list [0123456789] represents any digit. If you define a >class with &=[0-9A-Za-z], the ampersand represents all alpha- =numeric characters. The class definition of [~0-9] means any non-numerals.  @The following example searches for cities that have "ton" some- >where in their name. The MATCHING USING clause defines "+" as 2zero or more occurrences of any single character:  9 QLI> for c in cities with c.city matching '+ton+' using  CON> '+=?*' print city  hhvQLI TABLE QLI CREATE_METADATA  /D2BThe CREATE TABLE statement defines a relation and its constituent fields.  B-----------------------------------------------------------------  9 CREATE TABLE relation-name (field-definition-commalist)  4 field-definition::= field-name datatype[NOT NULL]  4 datatype ::= {SMALLINT|INTEGER|DATE|CHAR(integer)| 0 VARCHAR(integer)|DECIMAL[scale]|  FLOAT|LONG FLOAT} A----------------------------------------------------------------  AThe following table shows SQL datatypes and InterBase datatypes.  $ SQL DATATYPE INTERBASE DATATYPE  smallint short  integer long  date date  char char varchar varying  decimal long  float float  long float double  >A relation name can contain up to 31 alphanumeric characters, ?dollar signs ($), and underscores (_). However, it must start @with an alphabetic character and be unique among relation names Cin the database. A field name must be unique among all field names in the relation.  CThe NOT NULL option disallows the null or missing value as a valid value for this field.  ?Using the CREATE TABLE statement automatically invokes the SQL Dsecurity scheme for that table. If you create a table, you are that Btable's owner and accordingly have all privileges for that table. @You cannot assign an InterBase security class to relations cre- 9ated with the SQL create table command. Instead, you use SQL GRANT and REVOKE commands.  +The following statements define relations:   QLI> create table states ( ( state char(2) not null, ( state_name varchar(25),  area integer, statehood date, & capital varchar(25)); hhxQLI FUNCTIONS QLI SHOW  /? ?The SHOW FUNCTIONS command lists the function names in all the open databases.  >-------------------------------------------------------------   SHOW FUNCTIONS  >-------------------------------------------------------------   QLI> show functions hhQLI VIEW QLI CREATE_METADATA  /B&<The CREATE VIEW statement creates a temporary view of data. 8When you create a view by using embedded SQL, the view 8definition is not stored on the database. As a result, 7you cannot access this definition through qli or gdef.  @---------------------------------------------------------------  0 CREATE VIEW view-name [(field-name-commalist)]  AS select-statement  A----------------------------------------------------------------  ;Naming fields for a view is optional. If you choose not to Bsupply a field name, gpre uses the field name as specified in the ;select statement that follows. Because the field names map >chronologically to the list of selected fields in the select ;statement, you must specify all view field names or none. @If you supply the field name, it must be unique among all field names in the view.  :The SELECT statement specifies the selection criteria for ?records to be included in the view. Instead of the into clause ?used in queries, the list of selected fields maps to the list @of field names for the view. The order is based on the value of ?the RDB$FIELD_POSITION field in the RDB$RELATION_FIELDS system Arelation. The select statement cannot contain a group by clause or top-level aggregation.  'The following statements define views:  & QLI> create view half_mile_cities as / CON> select city, state, altitude from cities  CON> where altitude > 2500; $ QLI> create view capital_cities as . CON> select c.city, s.state_name, c.altitude $ CON> from cities c, states s where 0 CON> c.state = s.state and c.city = s.capital;  hhQLI DATABASE QLI DELETE_METADATA  /? 8The DROP DATABASE statement deletes an entire database.  ?______________________________________________________________   DROP DATABASE filespec  ?--------------------------------------------------------------  3The following example deletes the entire database:  QLI> drop database phones.gdb hhQLI DATABASE QLI DROP_METADATA  /8 8The DROP DATABASE statement deletes an entire database.  8-------------------------------------------------------   DROP DATABASE filespec  8-------------------------------------------------------  3The following example deletes the entire database:   QLI> drop database phones.gdb  hhQLI FILTER QLI SHOW  /@ 9The SHOW FILTER command lists all information about the named filter.  @---------------------------------------------------------------   SHOW FILTER filter-name  @---------------------------------------------------------------   QLI> show filter nroff hhQLI INDEX QLI DROP_METADATA  /75The DROP INDEX command deletes an index. You cannot 6delete an index in use in an active database. If you +do so, InterBase returns an error message. 7------------------------------------------------------   DROP INDEX index-name  7------------------------------------------------------  (The following example deletes an index:  QLI> drop index statesnames;  hh QLI TABLE QLI DROP_METADATA  /97The DROP TABLE command deletes a relation. You cannot 8delete a relation in use in an active database. If you 9do so, InterBase returns an error message. This command 9also deletes all indexes for the relation and any views that reference it.  8-------------------------------------------------------   DROP TABLE table-name  8-------------------------------------------------------  +The following examples deletes a relation:   QLI> drop table tourism; hh"QLI FILTERS QLI SHOW  /7 5The SHOW FILTERS command lists all blob filters for any open databases.  7------------------------------------------------------   SHOW FILTERS  7______________________________________________________   QLI> show filters hhZQLI VIEW QLI DROP_METADATA  /@9The DROP VIEW command deletes a view. This command also :deletes any other views that reference the deleted view. @However, the relations that comprise the view are not affected.  =------------------------------------------------------------   DROP VIEW view-name  =------------------------------------------------------------  &The following example deletes a view:  QLI> drop view colonies;  hh\QLI GRANT QLI SECURITY  /C&=The SQL GRANT command defines user privileges for designated ;tables and views. It can also grant a user the ability to <pass along privileges. A relation's owner is the only user >to have automatic grant authority for that relation. To pass >the ability to grant privileges to a user, the grant command +must contain the with grant option clause.  >-------------------------------------------------------------  . GRANT privilege-comma-list ON relation-name| ' view-name TO user [WITH GRANT OPTION]  / privilege::= {ALL [PRIVILEGES]|SELECT|DELETE|  INSERT|UPDATE (column-list)}  # user ::= PUBLIC|userid-comma-list  >-------------------------------------------------------------  BBecause a view is only a window into one or more base relations, @you can never grant a user more privileges on a view than that ,user has to the base relation or relations.  BOnce you have secured a table using SQL security, you should use Bonly SQL to further secure it. Do not use the InterBase security /class system in combination with SQL security.  ?The following example grants select and delete privileges to a Cuser and gives that user the authority to grant other users select and delete privileges:  3 QLI> grant select, delete on cities to julie with  CON> grant option;  BThe following example grants update privileges to a user for spe- cific fields in a relation:  : QLI> grant update state_name, capital on states to john; hh^QLI REVOKE QLI SECURITY  /U%=The SQL REVOKE command takes privileges away from a user for Aa designated table or view. Only the user who grants a privilege >can revoke that privilege. A revoke statement does not effect Aprivileges a user may have received from other grant statements. >The revoke statement has a cascading effect on any privileges @that were passed on through the with grant option clause in the grant statement.  :---------------------------------------------------------  / REVOKE privilege-comma-list ON relation-name| " view-name FROM userid-comma-list <---------------------------------------------------------  BThe following example takes the select privilege away from a user for the CITIES relation:  * QLI> revoke select on cities from julie;  DIn the following example, John grants Julie select and delete priv- Uileges on a relation that he created, and he gives her the ability to )pass the grant privilege to other users:  3 QLI> grant select, delete on rivers to julie with  CON> grant option;  CJulie can now pass the select privilege for the RIVERS relation on to Dana:  ) QLI> grant select on rivers to dana;  ;If John decides to revoke Julie's select privilege for the BRIVERS relation, the revoke cascades through Julie`s grant state- 2ment and also takes away Dana's select privilege:  * QLI> revoke select on rivers from julie;  hhQLI EXTRACT QLI  /EEThe EXTRACT statement creates a text file containing the definitions Dof some or all of the procedures in an opened database. The created Dfile contains QLI commands to delete the procedures and to recreate them.  =------------------------------------------------------------  4 EXTRACT [ ON ] { ALL | [,...] }  [ ON ]  ?------------------------------------------------------------  QLI> ready old_emp.gdb %QLI> extract all on "old_procs.com" QLI> finish QLI> ready new_emp.gdb QLI> @old_procs.com hhQLI INSERT QLI  /GGThe INSERT statement stores a new record into a relation. You cannot Ause the SQL variant of QLI to store blob fields. Use the STORE !statement to store such records.  =------------------------------------------------------------  B INSERT INTO relation-name ( database-field-commalist ) ? { VALUES ( constant-commalist ) | select-statement }  ?------------------------------------------------------------  7QLI> insert into ski_areas (name, type, city, state) 7CON> values ('Radar Acres', 'N', 'Dunstable', 'MA');  QLI> insert into cities :CON> (city, state, latitude_degrees, latitude_minutes, ?CON> latitude_compass, longitude_degrees, longitude_minutes - CON> longitude_compass) ECON> select 'St. Paul', state, latitude_degrees, latitude_minutes, ?CON> latitude_compass, longitude_degrees, longitude_minutes, CON> longitude_compass - -CON> from cities where city = 'Minneapolis'  QLI> insert into cities- CON> (city, state)- !CON> values ('Lowell', 'MA');  QLI> insert into tourism- CON> (state, zip, city)- ,CON> values ('NY', '10022', 'New York'); SYSDBASYSDBAS RDB$ROLESSYSDBASYSDBAI RDB$ROLESSYSDBASYSDBAU RDB$ROLESSYSDBASYSDBAD RDB$ROLESSYSDBASYSDBAR RDB$ROLESPUBLICSYSDBAS RDB$ROLESPUBLICSYSDBASTOPICS entire database.  ?______________________________________________________________   DROP DATABASE filespec  ?--------------------------------------------------------------  3The following example deletes the entire database:  QLI> drop database phones.gdb hhQLI DATABASE QLI DROP_METADATA  /8 8The DROP DATABASE statement deletes an entire database.  8-------------------