home *** CD-ROM | disk | FTP | other *** search
/ Complete Linux / Complete Linux.iso / docs / apps / database / ingres04.lzh / doc / quel / monitor.doc < prev    next >
Encoding:
Text File  |  1992-11-19  |  10.8 KB  |  254 lines

  1.  
  2.  
  3.  
  4.  
  5.      MONITOR(QUEL)                2/23/79                MONITOR(QUEL)
  6.  
  7.  
  8.  
  9.      NAME
  10.           monitor - interactive terminal monitor
  11.  
  12.      DESCRIPTION
  13.           The interactive terminal monitor is the primary front end to
  14.           INGRES.   It  provides  the ability to formulate a query and
  15.           review it before issuing it to INGRES.  If changes  must  be
  16.           made, one of the UNIX text editors may be called to edit the
  17.           _q_u_e_r_y _b_u_f_f_e_r.
  18.  
  19.           _M_e_s_s_a_g_e_s _a_n_d _P_r_o_m_p_t_s.
  20.  
  21.           The terminal monitor gives a variety of messages to keep the
  22.           user  informed  of  the  status of the monitor and the query
  23.           buffer.
  24.  
  25.           As the user logs in, a login message is printed.  This typi-
  26.           cally  tells  the  version number and the login time.  It is
  27.           followed by the dayfile, which gives  information  pertinant
  28.           to users.
  29.  
  30.           When INGRES is ready to accept input, the message ``go''  is
  31.           printed.   This  means  that the query buffer is empty.  The
  32.           message ``continue'' means that there is information in  the
  33.           query  buffer.   After a \go command the query buffer is au-
  34.           tomatically cleared if another query is typed in,  unless  a
  35.           command  which  affects  the  query  buffer  is typed first.
  36.           These commands are \append, \edit, \print, \list, \eval, and
  37.           \go.  For example, typing
  38.                   help parts
  39.                   \go
  40.                   print parts
  41.           results in the query buffer containing
  42.           print parts
  43.           whereas
  44.                   help parts
  45.                   \go
  46.                   \print
  47.                   print parts
  48.           results in the query buffer containing
  49.                   help parts
  50.                   print parts
  51.           An asterisk is printed at the beginning of  each  line  when
  52.           the monitor is waiting for the user to type input.
  53.  
  54.           _C_o_m_m_a_n_d_s
  55.  
  56.           There are a number of commands which may be entered  by  the
  57.           user  to  affect the query buffer or the user's environment.
  58.           They are all preceeded by a backslash (`\'), and all are ex-
  59.           ecuted  immediately  (rather  than  at  execution  time like
  60.           queries).
  61.  
  62.           Some commands may take a filename, which is defined  as  the
  63.           first significant character after the end of the command un-
  64.           til the end of the line.  These commands may have  no  other
  65.           commands  on the line with them.  Commands which do not take
  66.           a filename may be stacked on the line; for example
  67.                   \date\go\date
  68.           will give the time before and after execution of the current
  69.           query buffer.
  70.  
  71.           \r
  72.           \reset    Erase the entire query (reset the  query  buffer).
  73.                     The  former contents of the buffer are irretrieve-
  74.                     ably lost.
  75.  
  76.           \p
  77.           \print    Print the current  query.   The  contents  of  the
  78.                     buffer are printed on the user's terminal.
  79.  
  80.           \l
  81.           \list     Print the current query as it  will  appear  after
  82.                     macro  processing.  Any side effects of macro pro-
  83.                     cessing, such as macro definition, will occur.
  84.  
  85.           \eval     Macro process the query  buffer  and  replace  the
  86.                     query  buffer  with the result.  This is just like
  87.                     \list except that the output is put into the query
  88.                     buffer instead of to the terminal.
  89.  
  90.           \e
  91.           \ed
  92.           \edit
  93.           \editor   Enter the UNIX text editor (see  ED  in  the  UNIX
  94.                     Programmer's  Manual); use the ED command 'w' fol-
  95.                     lowed by 'q' to return to the INGRES monitor.   If
  96.                     a  filename  is  given,  the editor is called with
  97.                     that file instead of the  query  buffer.   If  the
  98.                     macro  ``{editor}'' is defined, that macro is used
  99.                     as  the   pathname   of   an   editor,   otherwise
  100.                     ``/bin/ed''  is used.  It is important that you do
  101.                     not use the ``e'' command inside  the  editor;  if
  102.                     you do the (obscure) name of the query buffer will
  103.                     be forgotten.
  104.  
  105.           \g
  106.           \go       Process the current query.  The  contents  of  the
  107.                     buffer are macro processed, transmitted to INGRES,
  108.                     and run.
  109.  
  110.           \a
  111.           \append   Append to the query buffer.  Typing \a after  com-
  112.                     pletion  of  a  query will override the auto-clear
  113.                     feature and guarantees that the query buffer  will
  114.                     not be reset.
  115.  
  116.           \time
  117.           \date     Print out the current time of day.
  118.  
  119.           \s
  120.           \sh
  121.           \shell    Escape to the UNIX shell.  Typing a control-d will
  122.                     cause  you  to  exit  the  shell and return to the
  123.                     INGRES monitor.  If there is a filename specified,
  124.                     that  filename  is  taken as a shell file which is
  125.                     run with the query buffer as the parameter ``$1''.
  126.                     If  no  filename is given, an interactive shell is
  127.                     forked.  If the macro ``{shell}'' is  defined,  it
  128.                     is  used  as  the  pathname of a shell; otherwise,
  129.                     ``/bin/sh'' is used.
  130.  
  131.           \q
  132.           \quit     Exit from INGRES.
  133.  
  134.           \cd
  135.           \chdir    Change the working directory of the monitor to the
  136.                     named directory.
  137.  
  138.           \i
  139.           \include
  140.           \read     Switch input to the named file.  Backslash charac-
  141.                     ters in the file will be processed as read.
  142.  
  143.           \w
  144.           \write    Write the contents of  the  query  buffer  to  the
  145.                     named file.
  146.  
  147.           \branch   Transfer control within a \include file.  See  the
  148.                     section on branching below.
  149.  
  150.           \mark     Set a label for \branch.
  151.  
  152.           \<any other character>
  153.                     Ignore any possible special meaning  of  character
  154.                     following '\'.  This allows the '\' to be input as
  155.                     a  literal  character.   (See  also  quel(quel)  -
  156.                     strings).   It is important to note that backslash
  157.                     escapes are sometimes eaten up by the  macro  pro-
  158.                     cessor  also;  in general, send two backslashes if
  159.                     you want  a  backslash  sent  (even  this  is  too
  160.                     simplistic [sigh] - try to avoid using backslashes
  161.                     at all).
  162.  
  163.           _M_a_c_r_o_s
  164.  
  165.           For simplicity, the macros  are  described  in  the  section
  166.           macros(quel).
  167.  
  168.           _B_r_a_n_c_h_i_n_g
  169.  
  170.           The \branch and \mark commands  permit  arbitrary  branching
  171.           within  a  \include  file (similar to the ``goto'' and ``:''
  172.           commands in the shell).  \mark should be followed with a la-
  173.           bel.   \branch should be followed with either a label, indi-
  174.           cating unconditional branch, or an expression preceeded by a
  175.           question mark, followed by a label, indicating a conditional
  176.           branch.  The branch is taken if the  expression  is  greater
  177.           than zero.  For example,
  178.                     \branch ?{tuplecount}<=0 notups
  179.           branches to label ``notups'' if the  ``{tuplecount}''  macro
  180.           is less than or equal to zero.
  181.  
  182.           The expressions usable in \branch  statements  are  somewhat
  183.           restricted.   The operators +, -, *, /, <=, >=, <, >, =, and
  184.           != are all defined in the  expected  way.   The  left  unary
  185.           operator  ``!'' can be used as to indicate logical negation.
  186.           There may be no spaces in the expression, since a space ter-
  187.           minates the expression.
  188.  
  189.           _I_n_i_t_i_a_l_i_z_a_t_i_o_n
  190.  
  191.           At initialization (login) time a number  of  initializations
  192.           take place.  First, a macro called ``{pathname}'' is defined
  193.           which expands to the pathname of the INGRES subtree (normal-
  194.           ly  ``/mnt/ingres'');  it is used by system routines such as
  195.           demodb.  Second, the initialization  file  .../files/startup
  196.           is  read.   This file is intended to define system-dependent
  197.           parameters, such as the default editor and shell.  Third,  a
  198.           user  dependent initialization file, specified by a field in
  199.           the users file, is read and executed.  This is normally  set
  200.           to  the  file ``.ingres'' in the user's home directory.  The
  201.           startup file might be used to define certain macros, execute
  202.           common  range  statements, and soforth.  Finally, control is
  203.           turned over to the user's terminal.
  204.  
  205.           An interrupt while executing either  of  the  initialization
  206.           files restarts execution of that step.
  207.  
  208.           _F_l_a_g_s
  209.  
  210.           Certain flags may be included on the command line to  INGRES
  211.           which  affect the operation of the terminal monitor.  The -a
  212.           flag disables the autoclear function.  This means  that  the
  213.           query   buffer   will   never   be   automatically  cleared;
  214.           equivalently, it is as though a \append command were insert-
  215.           ed after every \go.  Note that this means that the user must
  216.           explicitly clear the query buffer using \reset  after  every
  217.           query.   The  -d flag turns off the printing of the dayfile.
  218.           The -s flag turns off printing of all messages  (except  er-
  219.           rors)  from the monitor, including the login and logout mes-
  220.           sages, the dayfile, and prompts.  It is used  for  executing
  221.           ``canned queries'', that is, queries redirected from files.
  222.  
  223.      SEE ALSO
  224.           ingres(unix), quel(quel), macros(quel)
  225.  
  226.      DIAGNOSTICS
  227.           go                  You may begin a fresh query.
  228.  
  229.           continue            The previous query is finished  and  you
  230.                               are back in the monitor.
  231.  
  232.           Executing . . .     The query is being processed by INGRES.
  233.  
  234.           >>ed                You have entered the UNIX text editor.
  235.  
  236.           >>sh                You have escaped to the UNIX shell.
  237.  
  238.           Funny character nnn converted to blank
  239.                               INGRES maps non-printing  ASCII  charac-
  240.                               ters into blanks; this message indicates
  241.                               that one such conversion has  just  been
  242.                               made.
  243.  
  244.      INCOMPATIBILITIES
  245.           Note that the construct
  246.                               \rprint parts
  247.           (intended to reset the query buffer and then  enter  ``print
  248.           parts'') no longer works, since ``rprint'' appears to be one
  249.           word.
  250.  
  251.      BUGS
  252.  
  253.  
  254.