home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 18 REXX / 18-REXX.zip / dbmplus.zip / USERMAN.TXT < prev    next >
Text File  |  1996-04-06  |  14KB  |  438 lines

  1. DBMPLUS Version 0.7
  2. ===================
  3.  
  4. USER MANUAL
  5. ===========
  6.  
  7.  
  8. Installation
  9. ------------
  10.  
  11. Once you have unzipped DBMPLUS.ZIP to a directory (preferably one that is specified in the PATH statement of your CONFIG.SYS), DBMPLUS is ready to run. But you may wish to perform some tuning measurements with the file DBMPLUS.INI and to create views on some system tables.
  12.  
  13.  
  14. This version of DBMPLUS allows you to specify the text-editor of your choice to be used for editing SQL statements, and the default name of a spool file.
  15.  
  16. The format of the DBMPLUS.INI specification is
  17.  
  18.    editor = '<editor>'
  19.    spoolfile = '<spoolfile>'
  20.  
  21. where <editor> and <spoolfile> are to be replaced with the corresponding filenames, which may be qualified by drive and path name if required.
  22.  
  23. DBMPLUS is shipped with an DBMPLUS.INI file containing
  24.  
  25.    editor = 'e,exe'
  26.    spoolfile = 'spool.txt'
  27.  
  28.  
  29. In the current version of DBMPLUS, the file DBMPLUS.INI must reside in the directory, from which DBMPLUS is activated.
  30.  
  31.  
  32. In order to use the DBMPLUS-commands 'Indexes' and 'Rels' you must run the commands 'usrindex.dbm' and 'usrrels.dbm' from within DBMPLUS once for each database and user (see descriptions of these commands below).
  33.  
  34.  
  35. Starting DBMPLUS
  36. ----------------
  37.  
  38. On an OS/2 command line enter
  39.  
  40.    DBMPLUS
  41.  
  42. You will be prompted for your userid, password and a database name. The password is not echoed on the screen. The database name is optional and refers to the database that DBMPLUS is initially connected to.
  43.  
  44. In order to shorten the initial DBMPLUS-dialog you may specify user-id, password and/or databasename with the DBMPLUS-command in one of the following ways:
  45.  
  46.    DBMPLUS <userid>
  47.  
  48.    DBMPLUS <userid>/<password>
  49.  
  50.    DBMPLUS <userid> <database>
  51.  
  52.    DBMPLUS <userid>/<password> <database>
  53.  
  54. Except for the last format, the missing parameters are prompted for. Remember that if the password is specified with the DBMPLUS command, it is naturally shown on the screen.
  55.  
  56. Within the initial dialog, you may abort the program by entering '.C' (without the surrounding apostrophes) as a response to any prompt.
  57.  
  58. DBMPLUS submits a STARTDBM command resulting in a message that STARTDBM was
  59. successfull or that DB2/2 is already active.
  60.  
  61. When the program has been successfully initialized, it outputs 
  62.  
  63.    DBM>
  64.  
  65. and is waiting for your input, which may be a DBMPLUS command or an SQL statement.
  66.  
  67.  
  68. DBMPLUS commands
  69. ----------------
  70.  
  71. DBMPLUS commands and its parameter may be entered in lower or upper case. They may be abbreviated, but must at least be specified with the characters that are represented in upper case letters in the following list.
  72.  
  73.  
  74. List of DBMPLUS commands:
  75.  
  76.    Help
  77.    ----
  78.  
  79.    Parameter:  <none>
  80.    Purpose:    Show help for DBMPLUS commands
  81.  
  82.  
  83.    EXit
  84.    ----
  85.  
  86.    Parameter:  <none>
  87.    Purpose:    Exit from DBMPLUS.
  88.                Prior to exiting from DBMPLUS, the databse connection is
  89.                reset, but the database is not stopped.
  90.  
  91.  
  92.    SPool
  93.    -----
  94.  
  95.    Parameter:  <spoolfile> or ON or OFF
  96.    Purpose:    Specify spoolfile and/or activate/deactivate
  97.                spooling of SQL commands.
  98.  
  99.                <spoolfile>:   Specify spoolfile and activate
  100.                               spooling.
  101.  
  102.                ON:            Activate spooling.
  103.                               If no spoolfile was specified,
  104.                               its name is prompted for.
  105.  
  106.                OFF:           Deactivate spooling
  107.                               The spoolfile specification is kept
  108.                               for subsquent activation.
  109.  
  110.            Spooling is deactivated by default.
  111.            If spooling is ON, the output of SQL statements
  112.            is written to the spoolfile. It is equivalent to
  113.            submitting SQL statement to dbm with the
  114.            -r(spoolfile) parameter.
  115.  
  116.  
  117.    ECho
  118.    ----
  119.  
  120.    Parameter:  ON or OFF
  121.    Purpose:    Activate/Deactivate the output of SQL statements
  122.                on the screen.
  123.  
  124.                ON:            Activate echoing (standard)
  125.  
  126.                OFF:           Deactivate echoing
  127.  
  128.                If echo is OFF, the output of SQL statements to the
  129.                screen is suppressed. It is equivalent to
  130.                submitting SQL statements to dbm with the
  131.                -o parameter.
  132.  
  133.  
  134.    Run
  135.    ---
  136.  
  137.    Parameter:  <none>
  138.    Purpose:    (Re)Execute the actual SQL statement
  139.  
  140.  
  141.    List
  142.    ----
  143.  
  144.    Parameter:  <none>
  145.    Purpose:    Show the actual SQL statement
  146.  
  147.  
  148.    Edit
  149.    ----
  150.  
  151.    Parameter:  <none> or <filename> or *
  152.    Purpose:    Invoke texteditor in order to edit an SQL statement
  153.  
  154.                <none>:        The actual SQL statement is copied
  155.                               to TEMP.DBM, before the texteditor
  156.                               is invoked for editing this file;
  157.                               on return from the texteditor
  158.                               the contents of TEMP.BAT becomes the
  159.                               actual SQL statement.
  160.  
  161.                <filename>:    The texteditor is invoked for the
  162.                               specified file.
  163.                               The actual SQL statement is not
  164.                               affected.
  165.  
  166.                *:             Like <filename>, but using the
  167.                               file which had been previously
  168.                               used in a DBMPLUS command. The user
  169.                               is prompted for confirmation. 
  170.  
  171.    Save
  172.    ----
  173.  
  174.    Parameter:  <filename> or *
  175.    Purpose:    Save actual SQL command in a file
  176.  
  177.                <filename>:    name of the file
  178.  
  179.                *:             Like <filename>, but using the
  180.                               file which had been previously
  181.                               used in a DBMPLUS command. The user
  182.                               is prompted for confirmation. 
  183.  
  184.  
  185.    LOad
  186.    ----
  187.  
  188.    Parameter:  <filename> or *
  189.    Purpose:    Load file into actual SQL buffer
  190.  
  191.                <filename>:    name of the file
  192.  
  193.                *:             Like <filename>, but using the
  194.                               file which had been previously
  195.                               used in a DBMPLUS command. The user
  196.                               is prompted for confirmation. 
  197.  
  198.  
  199.    Compile
  200.    -------
  201.  
  202.    Parameter:  <filename> or *
  203.    Purpose:    Compile actual SQL command into a Rexx program
  204.  
  205.                <filename>:    name of the file
  206.  
  207.                *:             Like <filename>, but using the
  208.                               file which had been previously
  209.                               used in a DBMPLUS command. The user
  210.                               is prompted for confirmation. 
  211.  
  212.                The resulting Rexx program has the format
  213.                   
  214.                   /* Generated by DBMPLUS */
  215.                   call dbm '<SQL statement line 1>',
  216.                            '<SQL statement line 2>',
  217.                            ...
  218.                            '<SQL statement line n>'
  219.  
  220.    STore
  221.    -----
  222.  
  223.    Parameter:  <refno>
  224.    Purpose:    Store SQL statement in internal buffer for future
  225.                use within the same DBMPLUS session..
  226.  
  227.                <refno>:       Any positive integer number.
  228.  
  229.  
  230.    REcall
  231.    ------
  232.  
  233.    Parameter:  <refno>
  234.    Purpose:    Load SQL statement from internal buffer, where
  235.                it had been store by a STore command.
  236.  
  237.                <refno>:       Positive integer number.
  238.  
  239.  
  240.    Describe
  241.    --------
  242.  
  243.    Parameter:  <tablename>
  244.    Purpose:    Show the column definitions for the specified
  245.                table.
  246.  
  247.                <tablename>:   name of the table optionally
  248.                               qualified by the creator name
  249.  
  250.  
  251.    Tables
  252.    ------
  253.  
  254.    Parameter:  <none> or <creator>
  255.    Purpose:    Show list of tables
  256.  
  257.                <none>:        tables created by the actual user
  258.  
  259.                <creator>:     tables created by <creator>
  260.  
  261.  
  262.    Indexes
  263.    -------
  264.  
  265.    Parameter:  <none> or <tablename>
  266.    Purpose:    Show information on indexes ...
  267.  
  268.                <none>:        ... for all tables
  269.  
  270.                <tablename>:   ... for specific table
  271.  
  272.                This command uses a special view on
  273.                sysibm.sysindexes; this view must be created by the
  274.                following DBM command sequence:
  275.  
  276.                   DBM> load usrindex.dbm
  277.                   DBM> run
  278.  
  279.                (It is assumed that the file usrindex.dbm,
  280.                which is shipped with DBMPLUS.ZIP, is located in
  281.                the current directory; otherwise the file must be
  282.                qualified accordingly)
  283.  
  284.    Foreign
  285.    -------
  286.  
  287.    Parameter:  <none> or <tablename>
  288.    Purpose:    Show information on foreign keys ...
  289.  
  290.                <none>:        ... for all tables
  291.  
  292.                <tablename>:   ... for specific table
  293.  
  294.                This command uses a special view on
  295.                sysibm.sysrels; this view must be created by the
  296.                following DBM command sequence:
  297.  
  298.                   DBM> load usrrels.dbm
  299.                   DBM> run
  300.  
  301.                (It is assumed that the file usrrels.dbm,
  302.                which is shipped with DBMPLUS.ZIP, is located in
  303.                the current directory; otherwise the file must be
  304.                qualified accordingly)
  305.  
  306.  
  307.    Undo
  308.    ----
  309.  
  310.    Parameter:  <none>
  311.    Purpose:    Replace the current SQL statement buffer by its
  312.                previous contents
  313.  
  314.  
  315.  
  316.    HOst
  317.    ----
  318.  
  319.    Parameter:  <none> or <OS/2 command>
  320.    Purpose:    Execute CMD.EXE or specified OS/2 command
  321.  
  322.                <none>         Execute CMD.EXE
  323.  
  324.                <OS/2 command> Execute OS/2 command
  325.  
  326.  
  327.    LOGon
  328.    -----
  329.  
  330.    Parameter:  <user> or <user>/<password>
  331.    Purpose:    Logon to another user
  332.  
  333.                <user>:        Logon to <user>; the password is
  334.                               prompted for, in which case it will
  335.                               not be echoed to the screen
  336.  
  337.                <user>/<password>: No prompt for anything, but
  338.                               password appears on screen
  339.  
  340.                DBMPLUS prompts for the database, that the user is
  341.                initially connected to. The previous connection is
  342.                reset.
  343.  
  344.    SHow
  345.    ----
  346.  
  347.    Parameter:  <none>
  348.    Purpose:    Show settings
  349.  
  350.  
  351. Any other input statements than those listed above are assumed to be SQL statements and therefore directed to dbm (see below), with the following exception: a statement consisting of up to two characters, which is not equal to '?' and cannot be interpreted as an abbreviation of a DBMPLUS command are considered invalid.
  352.  
  353. If a DBMPLUS command requires a parameter which is not supplied by the user, this parameter is prompted for.
  354.  
  355. Any incomplete DBMPLUS command may be aborted by entering '.C' as an answer to a prompt.
  356.  
  357.  
  358. SQL statements
  359. --------------
  360.  
  361. Any input that is not recognized as a DBMPLUS command or considered invalid is assumed to be a line of an SQL statement.
  362. The last lime of an SQL statement must be terminated by a ';'.
  363.  
  364. Continuation lines are prompted for by the line number.
  365.  
  366. If a prompt for a continuation line is answered by '.C' the input of the statement is aborted. 
  367.  
  368. Once there is a terminating ';' the whole SQL statement is directed to dbm.
  369.  
  370.  
  371. Example for a DBMPLUS session
  372. -----------------------------
  373.  
  374. [C:\DBMLIB]dbmplus                  Start DBMPLUS session
  375.        User: joachim
  376.    Password: 
  377.    Database: testdb
  378. DBM> t                              Show list of tables in testdb
  379. ...
  380. DBM> d persdat                      Show columns of table persdat
  381. ...
  382. DBM> select persnr, name            Execute an SQL statement
  383.    2 from persdat
  384.    3 where sex = 'M';
  385. ...
  386. DBM> e                              Edit actual SQL statement using the
  387.                                     texteditor currently assigned to
  388.                                     DBMPLUS
  389.  
  390.         *** Let line 3 be changed to 'where sex = 'F' ***
  391.  
  392. DBM> select persnr, name            List SQL statement after edit
  393.    2 from persdat
  394.    3 where sex = 'F'
  395. DBM> r                              Run SQL statement
  396. ...
  397. DBM> st 1                           Store SQL statement in buffer # 1
  398. DBM> e c:\mydir\mystmt.dbm          Edit file c:\mydir\mystmt.dbm
  399.  
  400.         *** Suppose that c:\mydir\mystmt.dbm after    ***
  401.         *** edit contains:                            ***
  402.         ***                                           ***
  403.         ***    select sex, count(*)                   ***
  404.         ***    from persdat                           ***
  405.         ***    group by sex                           ***
  406.  
  407. DBM> lo *                           Load previously used file
  408. File c:\mydir\mystmt.dbm? (y/n): y     and confirm
  409. DBM> select sex, count(*)           List loaded statement
  410.    2 from persdat
  411.    3 group by sex
  412. DBM> r                              Run SQL statement
  413. ...
  414. DBM> re 1                           Recall SQL statement from buffer # 1
  415. DBM> select persnr, name            List SQL statement after recall
  416.    2 from persdat
  417.    3 where sex = 'F'
  418. DBM> s c:\mydir\query1.dbm          Save actual statement in file
  419. DBM> log peter/avocado              Logon to user peter
  420. Database: testpt
  421. DBM> ho                             Execute a command processor
  422. [C:\DBMLIB]cmd.exe
  423. Operating System 2 Command interpreter version 3
  424.  
  425. [C:\DBMLIB]dir
  426. ...
  427. [C:\DBMLIB]exit                     Close command processor
  428.                                        and return to DBMPLUS
  429.  
  430. DBM> ho time                        Execute one command
  431. [C:\DBMLIB]cmd.exe /C time
  432. System time is: 11.52.42,22am
  433. Enter new time:
  434.  
  435. DBM> ex                             Exit from dbmplus
  436. ...
  437. >
  438.