home *** CD-ROM | disk | FTP | other *** search
/ IT.SOFT 22 / ITSOFTCD_22.iso / mac / linux22 / slackware3.6 / DOCS / POSTGRESQL-HOWTO.;1 < prev    next >
Encoding:
Text File  |  1998-10-03  |  240.3 KB  |  7,459 lines  |  [TEXT/hscd]

  1.   Database-SQL-RDBMS HOW-TO document for Linux (PostgreSQL
  2.   Object Relational Database System)
  3.   Al Dev (Alavoor Vasudevan)        aldev@hotmail.com
  4.   v9.0, 02 Oct 1998
  5.  
  6.   This document is a "practical guide" to very quickly setup a SQL
  7.   Database engine and front end tools on a Unix system. It also dis≠
  8.   cusses the International standard language ANSI/ISO SQL and reviews
  9.   about the merits/advantages of the SQL database engine developed by
  10.   the world-wide internet in an "open development" environment.  It is
  11.   about HOW-TO setup a next generation Object Relational SQL Database
  12.   "PostgreSQL" on Unix system which can be used as Application Database
  13.   Server or as Web Database Server. PostgreSQL implements subset of
  14.   International standard ISO and ANSI SQL 1998,92,89. This document also
  15.   gives information on the interface programs for the database like
  16.   Front End GUIs, RAD tools (Rapid Application Development), programming
  17.   languages interfaces ("C", "C++", Java, Perl), ODBC, JDBC drivers and
  18.   Web Database Tools and Interface programs. Information given here
  19.   applies to all Unix platforms and other databases and will be very
  20.   useful for people who are new to Databases, SQL language and Post≠
  21.   greSQL.  This document also has SQL tutorial, SQL syntax which would
  22.   be very helpful for beginners. Experienced people will find this docu≠
  23.   ment useful as a handy reference guide. For students, the information
  24.   given here will enable them to get the source code for PostgreSQL
  25.   relational database system, from which they can learn how a RDBMS SQL
  26.   database engine is written.
  27.   ______________________________________________________________________
  28.  
  29.   Table of Contents
  30.  
  31.  
  32.  
  33.  
  34.  
  35.  
  36.  
  37.  
  38.  
  39.  
  40.  
  41.  
  42.  
  43.  
  44.  
  45.  
  46.  
  47.  
  48.  
  49.  
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.  
  64.  
  65.  
  66.  
  67.   1. Introduction
  68.  
  69.   2. Other Formats of this Document
  70.  
  71.   3. Laws of Physics applies to Software!
  72.  
  73.   4. What is PostgreSQL ?
  74.  
  75.   5. Where to get it ?
  76.  
  77.   6. PostgreSQL Supports Extremely Large Databases greater than 200 Gig
  78.  
  79.   7. How can I trust PostgreSQL ? Regression Test Package builds customer confidence
  80.  
  81.   8. GUI FrontEnd Tool for PostgreSQL (Graphical User Interface)
  82.  
  83.   9. Integrated Development Environment Tools for PostgreSQL (GUI IDE)
  84.  
  85.   10. Interface Drivers for PostgreSQL
  86.  
  87.      10.1 ODBC Drivers for PostgreSQL
  88.      10.2 UDBC Drivers for PostgreSQL
  89.      10.3 JDBC Drivers for PostgreSQL
  90.      10.4 Java for PostgreSQL
  91.  
  92.   11. Perl Database Interface (DBI) Driver for PostgreSQL
  93.  
  94.      11.1 Perl 5 interface for PostgreSQL
  95.      11.2 Perl Database Interface DBI
  96.         11.2.1 WHAT IS DBI ?
  97.         11.2.2 DBI driver for PostgreSQL DBD-Pg-0.63
  98.         11.2.3 Technical support for DBI
  99.         11.2.4 What is DBI, DBperl, Oraperl and *perl?
  100.         11.2.5 DBI specifications
  101.         11.2.6 Compilation problems or "It fails the test"
  102.         11.2.7 Is DBI supported under Windows 95 / NT platforms?
  103.         11.2.8 What's DBM? And why use DBI instead ?
  104.         11.2.9 Is < insert feature here > supported in DBI?
  105.         11.2.10 Is DBI any use for CGI programming?
  106.         11.2.11 How do I get faster connection times with DBD Oracle and CGI?
  107.         11.2.12 How do I get persistent connections with DBI and CGI?
  108.         11.2.13 ``When I run a perl script from the command line, it works, but, when I run it under the httpd, it fails!'' Why?
  109.         11.2.14 Can I do multi-threading with DBI?
  110.         11.2.15 How can I invoke stored procedures with DBI?
  111.         11.2.16 How can I get return values from stored procedures with DBI?
  112.         11.2.17 How can I create or drop a database with DBI?
  113.         11.2.18 How are NULL values handled by DBI?
  114.         11.2.19 What are these func methods all about?
  115.         11.2.20 Commercial Support and Training
  116.  
  117.   12. PostgreSQL Management Tools
  118.  
  119.      12.1 PGACCESS - A GUI Tool for PostgreSQL Management
  120.      12.2 Windows Interactive Query Tool for PostgreSQL (WISQL or MPSQL)
  121.      12.3 Interactive Query Tool (ISQL) for PostgreSQL called PSQL
  122.      12.4 MPMGR - A Database Management Tool for PostgresSQL
  123.  
  124.   13. Setting up multi-boxes PostgreSQL with just one monitor
  125.  
  126.   14. Applications and Tools for PostgreSQL
  127.  
  128.      14.1 PostgreSQL 4GL for web database applications - AppGEN Development System
  129.      14.2 WWW Web interface for PostgresSQL - DBENGINE
  130.      14.3 Apache Webserver Module for PostgreSQL - NeoSoft NeoWebScript
  131.      14.4 HEITML server side extension of HTML and a 4GL language for PostgreSQL
  132.      14.5 America On-line AOL Web server for PostgreSQL
  133.      14.6 Problem/Project Tracking System Application Tool for PostgreSQL
  134.      14.7 Convert dbase dbf files to PostgreSQL
  135.  
  136.   15. Web Database Design/Implementation tool for PostgreSQL - EARP
  137.  
  138.      15.1 What is EARP ?
  139.      15.2 Implementation
  140.      15.3 What you need to run EARP
  141.      15.4 How does it work ?
  142.      15.5 Where to get EARP ?
  143.  
  144.   16. PHP 3 Server-side html-embedded scripting language for PostgreSQL
  145.  
  146.      16.1 Major Features
  147.      16.2 Credits
  148.      16.3 PHP 3 - Brief History
  149.      16.4 So, what can I do with PHP/FI ?
  150.      16.5 A simple example
  151.      16.6 CGI Redirection
  152.         16.6.1 Apache 1.0.x Notes
  153.         16.6.2 Netscape HTTPD
  154.         16.6.3 NCSA HTTPD
  155.      16.7 Running PHP/FI from the command line
  156.  
  157.   17. Python Interface for PostgreSQL
  158.  
  159.      17.1 Where to get PyGres ?
  160.      17.2 Information and support
  161.  
  162.   18. Gateway between PostgreSQL and the WWW - WDB-P95
  163.  
  164.      18.1 About wdb-p95
  165.      18.2 Does the PostgreSQL server, pgperl, and httpd have to be on the same host?
  166.  
  167.   19. "C", "C++", ESQL/C language Interfaces and Bitwise Operators for PostgreSQL
  168.  
  169.      19.1 "C" interface
  170.      19.2 "C++" interface
  171.      19.3 ESQL/C
  172.      19.4 BitWise Operators for PostgreSQL
  173.  
  174.   20. Japanese Kanji Code for PostgreSQL
  175.  
  176.   21. PostgreSQL Port to Windows 95/Windows NT
  177.  
  178.   22. Mailing Lists and Newsgroups
  179.  
  180.      22.1 Newsgroups
  181.      22.2 Get a Free e-mail account
  182.      22.3 English Mailing List
  183.      22.4 Archive of Mailing List
  184.      22.5 Spanish Mailing List
  185.  
  186.   23. Documentation and Reference Books
  187.  
  188.      23.1 User Guides and Manuals
  189.      23.2 Online Documentation
  190.      23.3 Useful Reference Textbooks
  191.      23.4 ANSI/ISO SQL Specifications documents  - SQL 1992, SQL 1998
  192.      23.5 Syntax of ANSI/ISO SQL 1992
  193.      23.6 Syntax of ANSI/ISO SQL 1998
  194.      23.7 SQL Tutorial for beginners
  195.      23.8 Temporal Extension to SQL92
  196.      23.9 Part 0 - Acquiring ISO/ANSI SQL Documents
  197.      23.10 Part 1 - ISO/ANSI SQL Current Status
  198.      23.11 Part 2 - ISO/ANSI SQL Foundation
  199.      23.12 Part 3 - ISO/ANSI SQL Call Level Interface
  200.      23.13 Part 4 - ISO/ANSI SQL Persistent Stored Modules
  201.      23.14 Part 5 - ISO/ANSI SQL/Bindings
  202.      23.15 Part 6 - ISO/ANSI SQL XA Interface Specialization (SQL/XA)
  203.      23.16 Part 7 - ISO/ANSI SQL Temporal
  204.         23.16.1 INTRODUCTION
  205.         23.16.2 A CASE STUDY - STORING CURRENT INFORMATION
  206.         23.16.3 A CASE STUDY - STORING HISTORY INFORMATION
  207.         23.16.4 A CASE STUDY - PROJECTION
  208.         23.16.5 A CASE STUDY - JOIN
  209.         23.16.6 A CASE STUDY - AGGREGATES
  210.         23.16.7 SUMMARY
  211.      23.17 Part 8 - ISO/ANSI SQL MULTIMEDIA (SQL/MM)
  212.  
  213.   24. Technical support for PostgreSQL
  214.  
  215.   25. Economic and Business Aspects
  216.  
  217.   26. List of Other Databases
  218.  
  219.   27. Internet World Wide Web Searching Tips
  220.  
  221.   28. Conclusion
  222.  
  223.   29. FAQ - Questions on PostgreSQL
  224.  
  225.   30. Copyright Notice
  226.  
  227.   31. Appendix A - Syntax of ANSI/ISO SQL 1992
  228.  
  229.   32. Appendix B - SQL Tutorial for beginners
  230.  
  231.      32.1 Tutorial for PostgreSQL
  232.      32.2 Internet URL pointers
  233.  
  234.  
  235.   ______________________________________________________________________
  236.  
  237.   1.  Introduction
  238.  
  239.   The purpose of this document is to provide comprehensive list of
  240.   pointers/URLs to quickly setup PostgreSQL and also to advocate the
  241.   benefits of Open Source Code system like PostgreSQL.
  242.  
  243.   Each and every computer system in the world needs a database to
  244.   store/retrieve the information.  The primary reason you use the
  245.   computer is to store, retrieve and process information and do all
  246.   these very quickly, thereby saving you time.  At the same time the
  247.   system must be simple, robust, fast, reliable, economical and very
  248.   easy to use.  Database is the most VITAL SYSTEM as it stores mission
  249.   critical information of every company in this world.  The most popular
  250.   database systems are based on the International Standard Organisation
  251.   (ISO) SQL specifications which are also based on ANSI SQL (American)
  252.   standards.  Current specifications generally used are ANSI SQL 92 and
  253.   ANSI SQL 89.  Upcoming standard is the SQL 1998/99 which is also
  254.   called SQL-3. Popular database like Oracle, Sybase and Informix
  255.   systems are based on these standards or are trying to implement these
  256.   standards.
  257.  
  258.   There are more than 20 varieties of commercial/internet database
  259.   systems which are being used in the world and many more will be coming
  260.   in the near future. Without a standard like ANSI/ISO SQL, it would be
  261.   very difficult for the customer to develop a application once and run
  262.   on all the database systems.  Today's customer wants to develop an
  263.   application once using ISO SQL, ODBC, JDBC and to be used on all
  264.   varieties of database systems in the world.
  265.   The world's most popular FREE Database which implements some of the
  266.   ISO SQL, ANSI SQL/98, SQL/92 and ANSI SQL/89 RDBMS is PostgreSQL.
  267.   PostgreSQL is next generation Object relational database and the
  268.   future ANSI SQL standards like SQL 1998 (SQL-3) and beyond will
  269.   increasingly deal with Object databases and Object data types.
  270.   PostgreSQL is the only free RDBMS in the world which supports Object
  271.   databases and SQL. This document will tell you how-to install the
  272.   database and also all the packages related to databases, how to set up
  273.   the Web database, application database, front end GUIs and interface
  274.   programs.  It is strongly advised that you MUST write your database
  275.   applications 100 % compliant to standards of ISO/ANSI SQL, ODBC, JDBC
  276.   so that your application is portable across multiple databases like
  277.   PostgreSQL, Oracle, Sybase, Informix etc.
  278.  
  279.   You get the highest quality, and lot many features with PostgreSQL as
  280.   it follows 'Open Source Code development model'. Open Source Code
  281.   model is the one where the complete source code is given to you and
  282.   the development takes place on the internet by a extremely vast
  283.   network of human brains.  Future trend foresees that most of the
  284.   software development will take place on the so called "Information
  285.   Super-Highway" which spans the whole globe.  In the coming years,
  286.   internet growth will be explosive which will further fuel rapid
  287.   adoption of PostgreSQL by customers.
  288.  
  289.   Applying the principles of statistics, mathematics and science to
  290.   software quality, you get the highest quality of software only in a
  291.   'Open Source Code System' like PostgreSQL by opening the source code
  292.   to a very vast number of human brains inter-connected by the
  293.   information super-highway.  Greater the number of human brains
  294.   working, the better will be the quality of software.  Open Source Code
  295.   model will also prevent RE-INVENTION OF WHEELS, eliminates DUPLICATION
  296.   OF WORK and will be very economical, saves time in distribution and
  297.   follows the modern economic laws of optimizing the national and global
  298.   resources.  Once a software work is done by others, than you DO NOT
  299.   need to re-do that again. You will not be wasting your valuable time
  300.   on something which had already been WELL DONE.  Your time is extremely
  301.   precious and it must be utilized efficiently, because you have only 8
  302.   hours per day for doing work!!  As we will be entering the 21st
  303.   century, there will be a change in the way that you get software for
  304.   your use.  Customers will give first preference for the open systems
  305.   software like PostgreSQL.
  306.  
  307.   Buying software may become a thing of the past. You only need to buy
  308.   good hardware, it is worth spending money on the hardware and get the
  309.   software from internet. Important point is that it is the computer
  310.   hardware which is doing bulk of the work.  Hardware is the real work
  311.   horse and software is just driving it.  Computer hardware is so much
  312.   more complex that only 6 out of 180 countries in the world so far have
  313.   demonstrated the capability of designing and manufacturing computer
  314.   chips/hardware.  Design and manufacturing of computer chips is a
  315.   advanced technology.  It is a very complex process, capital intensive,
  316.   requires large investments in plant and production machines which deal
  317.   with 0.18 micron technology. On a single small silicon chip millions
  318.   of transistors/circuits are densely packed.  Companies like Applied
  319.   Material, AMD, Intel, Cyrix, Hitachi, IBM and others spent significant
  320.   number of man-years to master the high-technology like Chip Design,
  321.   Micro-electronics and Nano-electronics.  Micro means (one-millionth of
  322.   meter 10^-6), Nano  means (one-billionth of meter 10^-9). Current
  323.   technology uses micro-electronics of about 0.35 micron using aluminum
  324.   as conductors, 0.25 micron sizes using copper as conductors of
  325.   electrons.  In near future the technology of 0.10 micron with copper
  326.   and even nano-electronics will be used to make computer chips.
  327.   Aluminum conductors will be phased out by copper on computer chips, as
  328.   copper is a better conductor of electrons.  In photolithography
  329.   process extreme ultraviolet, X-ray or electron-beam techniques will be
  330.   used to etch circuits for feature size less than 0.15 micron.  Table
  331.   below shows the progress and future advancement trends of computer
  332.   chips.
  333.  
  334.  
  335.                             Advancement of chip capabilities in future
  336.                            ********************************************
  337.        +--------------------------+---------+---------+---------+---------+--------+---------+
  338.        | Item/Year                | 1997    | 1999    | 2001    | 2003    | 2012   | 2020    |
  339.        +--------------------------+---------+---------+---------+---------+--------+---------+
  340.        | Feature size(micron)     | 0.25    | 0.18    | 0.15    | 0.13    | 0.05   | 0.005   |
  341.        +--------------------------+---------+---------+---------+---------+--------+---------+
  342.        | Wafer size(mm)           | 200     | 300     | 300     | 300     | 450    | 600     |
  343.        +--------------------------+---------+---------+---------+---------+--------+---------+
  344.        | Min Operating Voltage    | 1.8-2.5 | 1.5-1.8 | 1.2-1.5 | 1.2-1.5 | 0.5-0.6| 0.1-0.02|
  345.        +--------------------------+---------+---------+---------+---------+--------+---------+
  346.        | Max power dissipation    | 70      | 90      | 110     | 130     | 175    | 300     |
  347.        +--------------------------+---------+---------+---------+---------+--------+---------+
  348.        | On-chip frequencey (MHz) | 750     | 1,250   | 1,500   | 2,100   | 10,000 | 50,000  |
  349.        +--------------------------+---------+---------+---------+---------+--------+---------+
  350.        | DRAM capacity            | 256 MB  | 1 GB    | 2 GB    | 4 GB    | 256 GB | 1000GB  |
  351.        +--------------------------+---------+---------+---------+---------+--------+---------+
  352.  
  353.  
  354.  
  355.  
  356.   As you can see, it is hardware that is high technology and important
  357.   and software is a less difficult technology.  Hence, manufacturing
  358.   hardware/hard-goods is vital for national economy! Companies like Com≠
  359.   paq, Dell, Sun Microsystems, HP, IBM who manufacture computers are
  360.   major contributors to U.S economy today and in the future!!
  361.  
  362.   On other hand, each and every country in the world develops/makes
  363.   software.  In fact, any person in this world with a small low-cost PC
  364.   can create a Oracle database server system. But it would take him
  365.   about 10 years (Oracle database server is about 10 man-years of work).
  366.   One man-year is one person working full-time for one full year. If 10
  367.   people work for a year than it is 10 man-years spent.
  368.  
  369.   Databases like Oracle, Informix, Sybase, IBM DB2 (Unix) are written in
  370.   nothing but 100% "C" language and binaries are created by compiling
  371.   the source and than shipped out to customers.
  372.  
  373.  
  374.   Since a lot of work had been done on PostgreSQL for the past 12 years,
  375.   it does not make sense to re-create from scratch another database
  376.   which satisfies ANSI/ISO SQL.  It will be a great advantage to take
  377.   the existing code and add missing features or enhancements to
  378.   PostgreSQL and start using it immediately.
  379.  
  380.   PostgreSQL is not just a free database but it is a good quality
  381.   'Internet Product'.  Prediction is that demand for "Made By Internet"
  382.   products will grow exponentially as it is capable of maintaining a
  383.   high quality, low cost, extremely large user-base and developer-base.
  384.   Those nations who do not use the 'Made By Internet' products will be
  385.   seriously missing "World-wide Internet Revolution" and will be left
  386.   far behind other countries. The reason is "Internet" itself is the
  387.   world's LARGEST software company!
  388.  
  389.   2.  Other Formats of this Document
  390.  
  391.   This document is published in 10 different formats namely - DVI,
  392.   Postscript, Latex, LyX, GNU-info, HTML, RTF(Rich Text Format), Plain-
  393.   text, Unix man pages and SGML.
  394.  
  395.   ∑  You can get this HOWTO document as a single file tar ball in HTML,
  396.      DVI, Postscript or SGML formats from -
  397.      <ftp://sunsite.unc.edu/pub/Linux/docs/HOWTO/other-formats/>
  398.  
  399.   ∑  Plain text format is in:
  400.      <ftp://sunsite.unc.edu/pub/Linux/docs/HOWTO>
  401.  
  402.   ∑  Translations to other languages like French, German, Spanish,
  403.      Chinese, Japanese are in
  404.      <ftp://sunsite.unc.edu/pub/Linux/docs/HOWTO> Any help from you to
  405.      translate to other languages is welcome.
  406.  
  407.      The document is written using a tool called "SGML tool" which can
  408.      be got from - <http://www.xs4all.nl/~cg/sgmltools/> Compiling the
  409.      source you will get the following commands like
  410.  
  411.   ∑  sgml2html databasehowto.sgml     (to generate html file)
  412.  
  413.   ∑  sgml2rtf  databasehowto.sgml     (to generate RTF file)
  414.  
  415.   ∑  sgml2latex databasehowto.sgml    (to generate latex file)
  416.  
  417.   This document is located at -
  418.  
  419.   ∑  <http://sunsite.unc.edu/LDP/HOWTO/PostgreSQL-HOWTO.html>
  420.  
  421.   Also you can find this document at the following mirrors sites -
  422.  
  423.   ∑  <http://www.caldera.com/LDP/HOWTO/PostgreSQL-HOWTO.html>
  424.  
  425.   ∑  <http://www.WGS.com/LDP/HOWTO/PostgreSQL-HOWTO.html>
  426.  
  427.   ∑  <http://www.cc.gatech.edu/linux/LDP/HOWTO/PostgreSQL-HOWTO.html>
  428.  
  429.   ∑  <http://www.redhat.com/linux-info/ldp/HOWTO/PostgreSQL-HOWTO.html>
  430.  
  431.   ∑  Other mirror sites near you (network-address-wise) can be found at
  432.      <http://sunsite.unc.edu/LDP/hmirrors.html> select a site and go to
  433.      directory /LDP/HOWTO/PostgreSQL-HOWTO.html
  434.  
  435.  
  436.   In order to view the document in dvi format, use the xdvi program. The
  437.   xdvi program is located in tetex-xdvi*.rpm package in Redhat Linux
  438.   which can be located through ControlPanel | Applications | Publishing
  439.   | TeX menu buttons.
  440.  
  441.  
  442.                To read dvi document give the command -
  443.                        xdvi -geometry 80x90 howto.dvi
  444.                And resize the window with mouse. See man page on xdvi.
  445.                To navigate use Arrow keys, Page Up, Page Down keys, also
  446.                you can use 'f', 'd', 'u', 'c', 'l', 'r', 'p', 'n' letter
  447.                keys to move up, down, center, next page, previous page etc.
  448.                To turn off expert menu press 'x'.
  449.  
  450.  
  451.  
  452.  
  453.   You can read postscript file using the program 'gv' (ghostview) or The
  454.   ghostscript program is in ghostscript*.rpm package and gv program is
  455.   in gv*.rpm package in Redhat Linux which can be located through Con≠
  456.   trolPanel | Applications | Graphics menu buttons. The gv program is
  457.   much more user friendly than ghostscript.  Also ghostscript and gv are
  458.   available on other platforms like OS/2, Windows 95 and NT, you view
  459.   this document even on those platforms.
  460.  
  461.  
  462.  
  463.           To read postscript document give the command -
  464.                   gv howto.ps
  465.  
  466.           To use ghostscript give -
  467.                   ghostscript howto.ps
  468.  
  469.  
  470.  
  471.  
  472.   CAUTION: This document is large, total number of pages (postscript) if
  473.   printed will be approximately 113 pages.
  474.  
  475.   You can read HTML format document using Netscape Navigator, Microsoft
  476.   Internet explorer, Redhat Baron Web browser or any of the 10 other web
  477.   browsers.
  478.  
  479.   You can read the latex, LyX output using LyX a X-Windows front end to
  480.   latex.
  481.  
  482.   3.  Laws of Physics applies to Software!
  483.  
  484.   In this chapter, it will be shown how science plays a important role
  485.   in the creation of various objects like software, this universe, mass,
  486.   atoms, energies and even yourself!  This chapter also shows why
  487.   knowledge of science is very important BEFORE you start using the
  488.   products of science.  Objects include everything - for example
  489.   PostgreSQL, time, mass, energy, planets, sun, moon, stars, galaxies,
  490.   super-clusters, humans etc... are objects made by science.  This
  491.   chapter also shows how laws of science and statistics favour the Open-
  492.   Source code system like PostgreSQL and Linux.  As the internet speed
  493.   is increasing everyday, and internet is becoming more and MORE
  494.   reliable, the Open-Source code system will gain rapid momentum.  And,
  495.   if rules of statistics and laws of physics are correct than the closed
  496.   source-code systems will eventually VANISH from this planet.
  497.  
  498.   Below paragraphs will show - "how vast science is, how important it is
  499.   for man and how it impacts software projects like PostgreSQL".
  500.  
  501.   To develop a project like PostgreSQL requires resources like energy
  502.   and time, hence PostgreSQL is a product of energy and time.  Since
  503.   energy and time can only be explained by science, there is a direct
  504.   co-relation between physics and software projects like PostgreSQL.
  505.  
  506.   Laws of science (Physics) applies everywhere, all the time, to
  507.   anything that you do and even to software projects.  Physics is in
  508.   action even while you are talking (sound waves), walking (friction
  509.   between ground and your feet), reading a book or writing software.
  510.   Various branches of sciences like physics, chemistry etc all merge
  511.   into one grand region of Mathematics (which is also known as the Queen
  512.   of all Sciences).  And everything in this world has a deep root in
  513.   mathematics, including PostgreSQL.
  514.  
  515.   The software like PostgreSQL is existing today because of the energy
  516.   and time.  It is the energy which made this world, human brains and
  517.   many other things! And mass and energy are ONE and the SAME entity!
  518.  
  519.   Cells in the human brains consume energy while processing (creating
  520.   software), by converting the chemical energy from food into electrical
  521.   and heat energy.  Even while you are reading this paragraph, the cells
  522.   in your brain are burning out the fuel and using the energy. So STOP
  523.   READING NOW! Cells are consuming energy even though it is very minute
  524.   and small!  The energy activity of neurons (brain cells) can be
  525.   measured in the laboratory. For example, there are many instruments
  526.   like 'Lie Detectors' and other medical instruments which can measure
  527.   the energy activities of brain.  All of these implies that human brain
  528.   is a thermodynamic heat engine.  Because human brain is a
  529.   thermodynamic engine, the laws of thermodynamics applies to brain and
  530.   hence thermodynamics has indirect effects on software like PostgreSQL.
  531.  
  532.   As per science, it is impossible to build any system or theory
  533.   (including a database software system) which will be 100 % perfect and
  534.   bug free.  It is like chasing a mirage, we will NEVER reach the goal
  535.   of perfect system or theory.  Detailed mathematical
  536.   equations/discussions to prove that '100 percent perfect system or
  537.   theory' is impossible, is a advanced topic and is beyond the scope of
  538.   this document. And such a mathematical discussion deals with infinite
  539.   number of dimensions which are existing in nature. Unfortunately
  540.   humans can see or feel only 4 dimensions but mathematics can easily
  541.   see many other dimensions.  Other dimensions are 'infinitely smaller'
  542.   than the atoms and atoms themselves are very minute which human eyes
  543.   cannot see them!  Our universe is almost zero size if you look from
  544.   other universe and vice versa.  Theoretically, you can exit out of our
  545.   universe and travel vast distances (billions of light years) in zero
  546.   time and re-enter at a different point of space-time!
  547.  
  548.   Even though there are infinite number of dimensions, they all can be
  549.   derived/generated from a small number of PRIMARY dimensions. That is,
  550.   infinite number of dimensions can combine and collapse into primary
  551.   dimensions.  Primary dimensions simply absorb other dimensions without
  552.   themselves getting destroyed.  Mathematicians use these primary
  553.   dimensions to understand the birth and death of universes. The
  554.   universe where you are currently living started with a big bang
  555.   billions of years ago which was caused by the interactions of atomic
  556.   particles of other dimensions.  Just before the big bang there was a
  557.   tiny point where length, breadth, height and time was ZERO (that is,
  558.   our universe was NOT THERE!!) and other universes and primary
  559.   dimensions were existing. Time itself was NOT there and atoms, stars,
  560.   planets, galaxies were NOT there! The atoms inside your body were NOT
  561.   there!!  Big bang of our universe was generated by few atoms of
  562.   primary dimensions. SOMEONE, something caused the dashing of few tiny
  563.   atoms of other dimensions to create our universe, and new dimensions
  564.   time, length, breadth, height was born! That process is not very well
  565.   understood by man. Man is trying to generate another universe in the
  566.   lab by simulating the big bang event (Huge accelerator is under
  567.   construction in Europe, another construction in Dallas, USA was
  568.   stopped by US congress due to budget cuts). There are atoms of other
  569.   dimensions just as we have atoms in our universe. Theoretically, you
  570.   can create/generate infinite number of universes! This process is
  571.   reversible, that is our universe can completely close down and vanish
  572.   into few atoms of other dimensions! It is a similar anology to how YOU
  573.   were born from two tiny cells which DASHED against each other to
  574.   create one single cell. That single tiny cell divided and multiplied
  575.   into 6 trillion cells to become a 6 foot tall human (that is you!)
  576.  
  577.   Since PERFECT state is impossible, universes like ours are born and
  578.   later die down in a cyclic process. BUT there can NO PERFECT death,
  579.   only transformation is permitted by science!  Our universe is
  580.   currently expanding at a tremendous rate, it is not static but is very
  581.   dynamic.  This universe will keep expanding untill something
  582.   interferes to collapse this universe by applying pressures with
  583.   external dimensions to aborb and annihilate our universe!! There can
  584.   be millions of universes in existence but there can be very few
  585.   universes which are built from primary dimensions.  You are not only
  586.   made up of atoms of this universe but also by atoms of other
  587.   dimensions!  In black holes the atoms and particles from our universe
  588.   get sucked into and are completely liquidated and converted to
  589.   particles of other dimensions! In the center of black hole time is
  590.   zero and length, breadth, height is zero! And black hole is EXIT/ENTRY
  591.   door to and from other universes.
  592.  
  593.   There can be infinite number of colors, computer langauages, computer
  594.   chip designs and theories but there CANNOT be ONE SINGLE PERFECT
  595.   color, computer language, design or system!  What you can have is only
  596.   a  NEAR PERFECT color(wavelength), system, database, or theory!
  597.   Nature is like a Kaliedoscope.
  598.  
  599.   By combining the energies of millions of people around the world via
  600.   internet it is possible to achieve a NEAR PERFECT system (including a
  601.   database software system). Individually, the energy of each person
  602.   will be minute, but by networking a large number of people, the total
  603.   energy will be huge which can be focused on a project to generate a
  604.   near perfect system.  Human beings are creatures of finite energy and
  605.   resources, frequently guilty of errors ranging from the trivial to the
  606.   profound. Because of our propensity for error varies broadly with
  607.   particular skills, particular experience and the vagaries of the
  608.   moment, the discovery and elimination of software bugs produced by
  609.   ordinary human error can be greatly facilitated by bringing a great
  610.   many minds to bear on the problem. In addition, more individuals
  611.   represent extra person hours of code and its asocciated function.
  612.  
  613.   It is very clear that internet can network a vast number of people,
  614.   which implies internet has lot of energy and time which can produce
  615.   much higher quality software products in much shorter time as compared
  616.   to commercial companies. Even big companies like Microsoft, IBM cannot
  617.   overpower and overrule the laws of Physics but will eventually
  618.   SURRENDER UNTO laws of science!
  619.  
  620.   Today, there are too many SQL RDBMS databases in the world aiming at
  621.   only one specification ANSI/ISO SQL. Man must not waste his time
  622.   creating too many SIMILAR/IDENTICAL software packages and there are
  623.   many other topics in science which need good attention.
  624.  
  625.   Conclusion is - because of laws of science, 'open source code' system
  626.   like PostgreSQL, Linux will be always much better than 'closed source
  627.   code' system and it is possible to prove this statement
  628.   scientifically.
  629.  
  630.   4.  What is PostgreSQL ?
  631.  
  632.   PostgreSQL Version 6.3.2 patch level 2 is a free database, complete
  633.   source code is given to you and is a Object-Relational Database System
  634.   near compliant (getting closer) with ANSI SQL1998,92,89 and runs on
  635.   diverse hardware platforms and Operating systems.
  636.  
  637.  
  638.                Sometimes emergency bug fix patches are released after the
  639.                GA release of PostgreSQL. You can apply these optional patches
  640.                depending upon the needs of your application. Follow these
  641.                steps to apply the patches -
  642.                Change directory to postgresql source directory
  643.                        cd /usr/src/postgresql6.3.1
  644.                        patch -p0 < patchfile
  645.                        make clean
  646.                        make
  647.                See also manual page do 'man patch'
  648.  
  649.  
  650.  
  651.  
  652.   The patch files are located in
  653.  
  654.   ∑  PostgreSQL patches :  <ftp://ftp.postgresql.org/pub/patches>
  655.  
  656.   The ultimate objective and the final goal of PostgreSQL is to become
  657.   100 % compliant to ANSI/ISO SQL and also to become the number ONE open
  658.   generic Database in the world. PostgreSQL will also guide, steer,
  659.   control, monitor and dictate the future of ANSI/ISO SQL.  That is, the
  660.   implementation and ideas first take place in PostgreSQL and than later
  661.   be incorporated into the ANSI/ISO SQL.
  662.  
  663.   Informix Universal server (released 1997) is based on earlier version
  664.   of PostgreSQL because Informix bought Illustra Inc. and integrated
  665.   with Informix. Illustra database was completely based on Postgres
  666.   (earlier version of PostgreSQL).
  667.  
  668.   PostgreSQL is an enhancement of the POSTGRES database management
  669.   system, a next-generation DBMS research prototype.  While PostgreSQL
  670.   retains the powerful data model and rich data types of POSTGRES, it
  671.   replaces the PostQuel query language with an extended subset of SQL.
  672.  
  673.   PostgreSQL development is being performed by a team of Internet
  674.   developers who all subscribe to the PostgreSQL development mailing
  675.   list. The current coordinator is Marc G. Fournier
  676.  
  677.   ∑  scrappy@postgreSQL.org
  678.  
  679.      This team is now responsible for all current and future development
  680.      of PostgreSQL.  Ofcourse, the database customer himself is the
  681.      developer of PostgreSQL!  The development load is distributed among
  682.      a very large number of database end-users on internet.
  683.  
  684.   The authors of PostgreSQL 1.01 were Andrew Yu and Jolly Chen.  Many
  685.   others have contributed to the porting, testing, debugging and
  686.   enhancement of the code. The original Postgres code, from which
  687.   PostgreSQL is derived, was the effort of many graduate students,
  688.   undergraduate students, and staff programmers working under the
  689.   direction of Professor Michael Stonebraker at the University of
  690.   California, Berkeley.
  691.  
  692.   The original name of the software at Berkeley was Postgres. When SQL
  693.   functionality was added in 1995, its name was changed to Postgres95.
  694.   The name was changed at the end of 1996 to PostgreSQL.
  695.  
  696.   Millions of PostgreSQL is installed as Database servers, Web database
  697.   servers and Application data servers. It is much more advanced and is
  698.   a object oriented relational database (ORDBMS).
  699.  
  700.   PostgreSQL can store more data types than traditional datatypes like
  701.   integer, characters, etc. - you get to create user-defined types,
  702.   functions, inheritance etc.  PostgreSQL runs on Solaris, SunOS, HPUX,
  703.   AIX, Linux, Irix, Digital Unix, BSDi,NetBSD, FreeBSD, SCO unix,
  704.   NEXTSTEP, Unixware and all and every flavor of Unix. Port to Windows
  705.   95/NT is underway.
  706.  
  707.   ∑  Title:             PostgreSQL SQL RDBMS Database (Object Relational
  708.      Database Management System)
  709.  
  710.   ∑  Current Version:   6.3.1 patch level 1
  711.  
  712.   ∑  Age:               PostgreSQL is 12 years old. Developed since 1985
  713.  
  714.   ∑  Authors:           Developed by millions/universities/companies on
  715.      internet for the past 12 YEARS
  716.  
  717.      PostgreSQL and related items in this document are subject to the
  718.      following COPYRIGHT.
  719.  
  720.  
  721.  
  722.  
  723.  
  724.  
  725.  
  726.  
  727.   PostgreSQL Data Base Management System
  728.  
  729.   Copyright (c) 1994-6 Regents of the University of California
  730.  
  731.   Permission to use, copy, modify, and distribute this software and its
  732.   documentation for any purpose, without fee, and without a written agreement
  733.   is hereby granted, provided that the above copyright notice and this
  734.   paragraph and the following two paragraphs appear in all copies.
  735.  
  736.   IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR
  737.   DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING
  738.   LOST PROFITS, ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS
  739.   DOCUMENTATION, EVEN IF THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE
  740.   POSSIBILITY OF SUCH DAMAGE.
  741.  
  742.   THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES,
  743.   INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
  744.   AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS ON
  745.   AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATIONS TO
  746.   PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
  747.  
  748.  
  749.  
  750.  
  751.   5.  Where to get it ?
  752.  
  753.   You can buy Redhat Linux CDROM, Debian Linux CDROM or Slackware Linux
  754.   CDROM which already contains the Postgresql in package form (both
  755.   source code and binaries) from :
  756.  
  757.   ∑  Linux System Labs Web site:   <http://www.lsl.com/>  7 (U.S.
  758.      dollars)
  759.  
  760.   ∑  Cheap Bytes Inc Web site:   <http://www.cheapbytes.com/> 7 (U.S.
  761.      dollars)
  762.  
  763.   ∑  Debian Main Web site :  <http://www.debian.org/vendors.html>
  764.  
  765.   PostgreSQL organisation is also selling 'PostgreSQL CDROM' which
  766.   contains the complete source code and binaries for many Unix operating
  767.   systems as well as full documentation.
  768.  
  769.   ∑  PostgreSQL CDROM from main Web site at :
  770.      <http://www.postgresql.org> 29 (U.S. dollars)
  771.  
  772.   Binaries only distribution of PostgreSQL:
  773.  
  774.   ∑  You can run PostgreSQL without compiling the source. Get binaries
  775.      for Intel-Linux from  <ftp://www.redhat.com/pub/contrib/i386/> file
  776.      is postgresql-6.2-3.i386.rpm. This is in the redhat package 'rpm'
  777.      format and it contains both source and binaries for PostgreSQL.
  778.  
  779.   ∑  Binaries site for Solaris, HPUX, AIX, IRIX, Linux :
  780.      <ftp://ftp.postgresql.org/pub/bindist> If you compile on any
  781.      platform please upload to site, so that it will be useful for
  782.      others.
  783.  
  784.   ∑  ftp site : Get binaries for Intel-Linux from
  785.      <ftp://ftp.redhat.com/pub/contrib/i386/> file is
  786.      postgresql-6.2-3.i386.rpm. This is in the redhat package 'rpm'
  787.      format and it contains both source and binaries for PostgreSQL.
  788.  
  789.  
  790.   WWW Web sites:
  791.  
  792.  
  793.   ∑  Primary Web site:   <http://www.postgresql.org/>
  794.  
  795.   ∑  Secondary Web site:      <http://logical.thought.net/postgres95/>
  796.  
  797.   ∑  <http://www.itm.tu-clausthal.de/mirrors/postgres95/>
  798.  
  799.   ∑  <http://s2k-ftp.cs.berkeley.edu:8000/postgres95/>
  800.  
  801.   ∑  <http://xenium.pdi.net/PostgreSQL/>
  802.  
  803.   ∑  <http://s2k-ftp.cs.berkeley.edu:8000/postgres95/>
  804.  
  805.  
  806.   The ftp sites are listed below :-
  807.  
  808.   ∑  Primary FTP:        <ftp://ftp.postgresql.org/pub>
  809.  
  810.   ∑  Secondary FTP:      <ftp://ftp.chicks.net/pub/postgresql>
  811.  
  812.   ∑  <ftp://ftp.emsi.priv.at/pub/postgres/>
  813.  
  814.   ∑  <ftp://ftp.itm.tu-clausthal.de/pub/mirrors/postgres95>
  815.  
  816.   ∑  <ftp://rocker.sch.bme.hu/pub/mirrors/postgreSQL>
  817.  
  818.   ∑  <ftp://ftp.jaist.ac.jp/pub/dbms/postgres95>
  819.  
  820.   ∑  <ftp://ftp.luga.or.at/pub/postgres95>
  821.  
  822.   ∑  <ftp://postgres95.vnet.net:/pub/postgres95>
  823.  
  824.   ∑  <ftp://ftpza.co.za/mirrors/postgres>
  825.  
  826.   ∑  <ftp://sunsite.auc.dk/pub/databases/postgresql>
  827.  
  828.   ∑  <ftp://ftp.task.gda.pl/pub/software/postgresql>
  829.  
  830.   ∑  <ftp://xenium.pdi.net/pub/PostgreSQL>
  831.  
  832.  
  833.   PostgreSQL source code is also available at all the mirror sites of
  834.   sunsite unc (total of about 1000 sites around the globe). It is inside
  835.   the Red Hat Linux distribution in /pub/contrib/i386/postgresql.rpm
  836.   file.
  837.  
  838.   ∑  For list of mirror sites go to  <ftp://sunsite.unc.edu>
  839.  
  840.   6.  PostgreSQL Supports Extremely Large Databases greater than 200 Gig
  841.  
  842.   Performance of 32-bit cpu machines will rapidly decline when the
  843.   database size exceed 5 gig. You can run 30 gig database on 32-bit cpu
  844.   but performance will not be very effective. There is limitation
  845.   imposed on the amount of RAM (maximum of 2 gig only), limitation on
  846.   the file system sizes and also on the operating system.
  847.  
  848.   If you need to use extremely large databases (greater than 5
  849.   gigabytes), it is strongly advised that you use 64-bit machines like
  850.   Digital Alpha cpu, Sun Ultra-sparc 64-bit cpu, Silicon graphics 64-bit
  851.   cpu, upcoming Intel Merced IA-64 cpu, HPUX 64bit machines, IBM 64-bit
  852.   machines. Compile PostgreSQL under 64-bit cpu and it can support huge
  853.   databases and large queries. Performance of PostgreSQL for queries on
  854.   large tables and databases will be several times faster than
  855.   PostgreSQL on 32-bit cpu machines. Advantage of 64-bit machines are
  856.   that you get very large memory addressing space and the operating
  857.   system can support very large file-systems, provide better performance
  858.   with large databases, support much larger memory(RAM), have more
  859.   capabilities etc..
  860.  
  861.   7.  How can I trust PostgreSQL ? Regression Test Package builds cus≠
  862.   tomer confidence
  863.  
  864.   Regression test package (src/test/regress) is included in the
  865.   distribution and let your computer do the verification for standard
  866.   SQL operations as well as the extensibility capabilities of
  867.   PostgreSQL.  Advantage is that computer can rapidly run millions of
  868.   SQL tests in a very short time.  Computers can carry out software
  869.   regression tests millions or even billions of times faster than humans
  870.   can.  In near future the speed of computer will be several zillion
  871.   times faster than human brain!  Hence, it makes sense to use the power
  872.   of computer to validate the software instead of using the human brain
  873.   power.
  874.  
  875.   The test package already contains hundreds of SQL test programs.  You
  876.   can start the regression test and come back later to take a glance at
  877.   the output results and the verification is done.
  878.  
  879.   You can add more tests just in case you need to, and can upload to the
  880.   primary PostgreSQL web site if you feel that it will be useful to
  881.   others on internet.  Regression test package helps build customer
  882.   confidence and trust in PostgreSQL and facilitates rapid deployment of
  883.   PostgreSQL on production systems.
  884.  
  885.   Regression test package can be taken as a "VERY SOLID" technical
  886.   document mutually agreed upon between the developers and end-users.
  887.   PostgreSQL developers extensively use the regression test package
  888.   during development period and also before releasing the software to
  889.   public to ensure good quality.
  890.  
  891.   8.  GUI FrontEnd Tool for PostgreSQL (Graphical User Interface)
  892.  
  893.   PostgreSQL has Tcl/Tk interface library in the distribution called
  894.   'pgTcl'. Tcl/Tk is a Rapid Application Development tool and is a
  895.   scripting language.  You can develop once and run it everywhere on NT,
  896.   Win 95, Linux, OS/2 and all unixes.  Tcl stands for 'Tool Command
  897.   Language' and Tk is 'Tool Kit'. There is a IDE (integrated development
  898.   environment) for Tcl/Tk called SpecTcl. Check for this rpm package
  899.   under Redhat linux distribution or at the sunscript site given below.
  900.  
  901.   Perl is strongly recommended as a scripting language, since it is the
  902.   most widely used and very powerful and is available on every hardware
  903.   and OS platforms.  Perl-Tk or Perl-Qt or C++ QtEZ or C++ Lesstiff is
  904.   strongly recommended.  A combination of Perl, C and Tk will satisfy
  905.   the needs of most projects from viewpoint of time resources, speed of
  906.   executable and ease of programming. Note that Java programs run very
  907.   slow. Even C++ programs run slower than C programs. The C programs run
  908.   the fastest as compared to other languages.  Perl programs can be
  909.   converted to "C" program using Perl2C program and than compiled which
  910.   will be very fast.
  911.  
  912.   Perl is used for programming 90 % of internet scripts in the world.
  913.   So you will have only one language "Perl" for all your needs - in
  914.   applications as well as internet.  See Perl Database Interface of this
  915.   document at ``''
  916.  
  917.   You should ponder over the strong points of Perl vis-a-vis Tcl/Tk
  918.   before starting any project on Tcl.  Tcl/TK is usually shipped with
  919.   every linux cdrom. Also you can get it from these sites -
  920.  
  921.   ∑  Tcl/Tk  <http://www.scriptics.com>
  922.  
  923.   ∑  Object oriented extension of Tcl called INCR at
  924.      <http://www.tcltk.com>
  925.   ∑  Visual TCL site  <http://www.neuron.com>
  926.  
  927.   ∑  Visual TCL Redhat rpm at
  928.      <ftp://ftp.redhat.com/pub/contrib/i386/visualtcl*.rpm>
  929.  
  930.   ∑  <http://sunscript.sun.com/>
  931.  
  932.   ∑  <http://sunscript.sun.com/TclTkCore/>
  933.  
  934.   ∑  <ftp://ftp.sunlabs.com/pub/tcl/tcl8.0a2.tar.Z>
  935.  
  936.   ∑  Reference text book: Many textbooks on TCL/TK are available in the
  937.      market.
  938.  
  939.   9.  Integrated Development Environment Tools for PostgreSQL (GUI IDE)
  940.  
  941.   Check out the following development tools which you can use in
  942.   conjunction with ODBC/JDBC drivers. These are similar to Borland C++
  943.   Builder, Borland JBuilder.
  944.  
  945.   Vibe is a Java and C++ IDE (Integrated Development Environment) that
  946.   won Unix Review's IDE of the year.
  947.  
  948.   ∑  More information on Vibe at
  949.      <http://www.LinuxMall.com/products/00487.html>
  950.  
  951.   ∑   You can also use Borland C++ Builder, Delphi, Borland JBuilder,
  952.      PowerBuilder on Windows95 connecting to PostgreSQL on unix box
  953.      through ODBC/JDBC drivers.
  954.  
  955.   See also PERL Database Interface of this document at ``'' Perl and
  956.   C/C++ is strongly recommended as the choice of langauge for IDE.
  957.  
  958.   Free of cost IDE Tools -
  959.  
  960.   Check the CDROM of redhat linux distribution.
  961.  
  962.   ∑  Lesstiff Motif tool
  963.      <ftp://ftp.redhat.com/pub/contrib/i386/lesstiff*.rpm>
  964.  
  965.   ∑  FreeBuilder  <ftp://ftp.redhat.com/pub/contrib/i386/free*.rpm>
  966.  
  967.   ∑  SpecTCL  <ftp://ftp.redhat.com/pub/contrib/i386/spec*.rpm>
  968.  
  969.   ∑  JccWarrior  <ftp://ftp.redhat.com/pub/contrib/i386/jcc*.rpm>
  970.  
  971.   ∑  Kanchenjunga Java RAD Tool for PostgreSQL
  972.      <http://www.man.ac.uk/~whaley/kj/kanch.html>
  973.  
  974.   ∑  Applixware Tool  <http://www.redhat.com>
  975.  
  976.   ∑  XWPE X Windows Programming Environment
  977.      <http://www.rpi.edu/~payned/xwpe/>
  978.      <ftp://ftp.redhat.com/pub/contrib/i386/xwpe*.rpm>
  979.  
  980.   ∑  XWB X Windows Work Bench
  981.      <ftp://ftp.redhat.com/pub/contrib/i386/xwb*.rpm>
  982.  
  983.   ∑  NEdit  <ftp://ftp.redhat.com/pub/contrib/i386/nedit*.rpm>
  984.  
  985.   10.  Interface Drivers for PostgreSQL
  986.  
  987.  
  988.  
  989.  
  990.  
  991.   10.1.  ODBC Drivers for PostgreSQL
  992.  
  993.   ODBC stands for 'Open DataBase Connectivity' is a popular standard for
  994.   accessing information from various databases from different vendors.
  995.   Applications written using the ODBC drivers are guaranteed to work
  996.   with various databases like PostgreSQL, Oracle, Sybase, Informix etc..
  997.  
  998.  
  999.   ∑  PostODBC is already included in the distribution. See main web site
  1000.      <http://www.postgresql.org>. It is included on the PostgreSQL
  1001.      CDROM.
  1002.  
  1003.   ∑  <http://www.openlinksw.com> Open Link Software Corporation is
  1004.      selling ODBC for PostgreSQL and other databases.  Open Link also is
  1005.      giving away free ODBC (limited seats) check them out.
  1006.  
  1007.   ∑  Insight ODBC for PostgreSQL  <http://www.insightdist.com/psqlodbc>
  1008.      This is the official PostODBC site.
  1009.  
  1010.   There is a project called the FreeODBC Pack Package . There's no
  1011.   PostgreSQL Version there, maybe you can help.
  1012.  
  1013.   ∑  <http://www.ids.net/~bjepson/freeODBC/> This is a free of cost
  1014.      version of ODBC.
  1015.  
  1016.   10.2.  UDBC Drivers for PostgreSQL
  1017.  
  1018.   UDBC is a static version of ODBC independent of driver managers and
  1019.   DLL support, used to embed database connectivity support directly into
  1020.   applications.
  1021.  
  1022.   ∑  <http://www.openlinksw.com> Open Link Software Corporation is
  1023.      selling UDBC for PostgreSQL and other databases.  Open Link also is
  1024.      giving away free UDBC (limited seats) check them out.
  1025.  
  1026.   10.3.  JDBC Drivers for PostgreSQL
  1027.  
  1028.   JDBC stands for 'Java DataBase Connectivity'. Java is a platform
  1029.   independent programming language developed by Sun Microsystems. Java
  1030.   programmers are encouraged to write database applications using the
  1031.   JDBC to facilitate portability across databases like PostgreSQL,
  1032.   Oracle, informix, etc. If you write Java applications you can get JDBC
  1033.   drivers for PostgreSQL from the following sites:
  1034.  
  1035.   JDBC driver is already included in the PostgreSQL distribution.
  1036.  
  1037.  
  1038.   ∑  <http://www.demon.co.uk/finder/postgres/index.html> Sun's Java
  1039.      connectivity to PostgreSQL
  1040.  
  1041.   ∑  <ftp://ftp.ai.mit.edu/people/rst/rst-jdbc.tar.gz>
  1042.  
  1043.   ∑  <http://www.openlinksw.com> Open Link Software Corporation is
  1044.      selling JDBC for PostgreSQL and other databases.  Open Link also is
  1045.      giving away free JDBC (limited seats) check them out.
  1046.  
  1047.   ∑  JDBC UK site  <http://www.retep.org.uk/postgres>
  1048.  
  1049.   ∑  JDBC FAQ site  <http://eagle.eku.edu/tools/jdbc/faq.html>
  1050.  
  1051.   The JDBC home, guide and FAQ are located at -
  1052.  
  1053.   ∑  JDBC HOME  <http://splash.javasoft.com/jdbc>
  1054.  
  1055.   ∑  JDBC guide
  1056.      <http://www.javasoft.com/products/jdk/1.1/docs/guide/jdbc>
  1057.   ∑  JDBC FAQ  <http://javanese.yoyoweb.com/JDBC/FAQ.txt>
  1058.  
  1059.   10.4.  Java for PostgreSQL
  1060.  
  1061.   Java programmers can find these for PostgreSQL very useful.
  1062.  
  1063.   ∑  <ftp://ftp.redhat.com/pub/contrib/i386> and see postgresql-
  1064.      jdbc-*.rpm
  1065.  
  1066.   ∑  <http://www.blackdown.org>
  1067.  
  1068.   11.  Perl Database Interface (DBI) Driver for PostgreSQL
  1069.  
  1070.  
  1071.   11.1.  Perl 5 interface for PostgreSQL
  1072.  
  1073.   PERL is an acronym for 'Practical Extraction and Report Language'.
  1074.   Perl is available on each and every operating system and hardware
  1075.   platform in the world.  You can use Perl on Windows95/NT, all flavors
  1076.   of Unix (Solaris, HPUX, AIX, Linux, Irix, SCO etc..), mainframe MVS,
  1077.   desktop OS/2, OS/400, Amdahl UTS and many others.  Perl runs EVEN on
  1078.   many unpopular or generally-unknown operating systems and hardware!!
  1079.   So do not be surprised if you see perl running on a very rarely used
  1080.   operating system.  You can imagine the vast extent of the user base
  1081.   and developer base of Perl.
  1082.  
  1083.   Perl interface for PostgreSQL is included in the distribution of
  1084.   PostgreSQL. Check in src/pgsql_perl5 directory.
  1085.  
  1086.   ∑  Pgsql_perl5 contact Email: E.Mergl@bawue.de
  1087.  
  1088.   ∑  Another source from -
  1089.      <ftp://ftp.kciLink.com/pub/PostgresPerl-1.3.tar.gz>
  1090.  
  1091.   ∑  Perl Home page :  <http://www.perl.com/perl/index.html>
  1092.  
  1093.   ∑  Perl tutorial, look for Tutorial title at :
  1094.      <http://reference.perl.com/>
  1095.  
  1096.   ∑  Perl FAQ is at :
  1097.      <http://www.yahoo.com/Computers_and_Internet/Programming_Languages/Perl/>
  1098.  
  1099.   ∑  Perl GUI User Interfaces Perl-Qt rpm :
  1100.      <ftp://ftp.redhat.com/pub/contrib/i386> and look for
  1101.      PerlQt-1.06-1.i386.rpm
  1102.  
  1103.   ∑  Perl GUI User Interfaces Perl-Qt :
  1104.      <http://www.accessone.com/~jql/perlqt.html>
  1105.  
  1106.   ∑  Perl GUI User Interfaces Perl-XForms :
  1107.      <ftp://ftp.redhat.com/pub/contrib/i386> and look for
  1108.      Xforms4Perl-0.8.4-1.i386.rpm
  1109.  
  1110.   ∑  Perl GUI User Interfaces Perl-Tk :
  1111.      <ftp://ftp.redhat.com/pub/contrib/i386>
  1112.  
  1113.   ∑  Perl GUIkits :  <http://reference.perl.com/query.cgi?ui>
  1114.  
  1115.   ∑  Perl Database Interfaces :
  1116.      <http://reference.perl.com/query.cgi?database>
  1117.  
  1118.   ∑  Perl to "C" translator :  <http://www.perl.com/CPAN-
  1119.      local/modules/by-module/B/> and look for Compiler-a3.tar.gz
  1120.  
  1121.   ∑  Perl to Bourne shell translator :
  1122.      <http://www.perl.com/CPAN/authors/id/MERLYN/sh2perl-0.02.tar.gz>
  1123.   ∑  awk to perl a2p and sed to perl s2p is included with the PERl
  1124.      distribution.
  1125.  
  1126.   ∑  See also the newsgroups for PERL at comp.lang.perl.*
  1127.  
  1128.   11.2.  Perl Database Interface DBI
  1129.  
  1130.   11.2.1.  WHAT IS DBI ?
  1131.  
  1132.   The Perl Database Interface (DBI) is a database access Application
  1133.   Programming Interface (API) for the Perl Language. The Perl DBI API
  1134.   specification defines a set of functions, variables and conventions
  1135.   that provide a consistent database interface independent of the actual
  1136.   database being used.  The information for this DBI section is obtained
  1137.   from 'DBI FAQ' doc whose author is Alligator Descartes and reproduced
  1138.   here with his permission.
  1139.  
  1140.   ∑  Alligator Descartes Hermetica is at descarte@hermetica.com
  1141.  
  1142.   11.2.2.  DBI driver for PostgreSQL DBD-Pg-0.63
  1143.  
  1144.   Get DBD-Pg-0.63.tar.gz from below
  1145.  
  1146.   ∑  Comprehensive Perl Archive Network CPAN  <http://www.perl.com/CPAN>
  1147.  
  1148.   ∑  DBI drivers list and DBI module pages
  1149.      <http://www.hermetica.com/technologia/perl/DBI>
  1150.  
  1151.   ∑  DBI information is at  <http://www.fugue.com/dbi/>
  1152.  
  1153.   ∑  Primary ftp site  <ftp://ftp.demon.co.uk/pub/perl/db>
  1154.  
  1155.   ∑  Miscellaneous DBI link  <http://www-ccs.cs.umass.edu/db.html>
  1156.  
  1157.   ∑  Miscellaneous DBI link
  1158.      <http://www.odmg.org/odmg93/updates_dbarry.html>
  1159.  
  1160.   ∑  Miscellaneous DBI link  <http://www.jcc.com/sql_stnd.html>
  1161.  
  1162.   ∑  PostgreSQL database  <http://www.postgresql.org>
  1163.  
  1164.   REQUIREMENTS:
  1165.  
  1166.   ∑  - build, test and install Perl 5         (at least 5.002)
  1167.  
  1168.   ∑  - build, test and install the DBI module (at least 0.89)
  1169.  
  1170.   ∑  - build, test and install PostgreSQL     (at least 6.2)
  1171.  
  1172.   11.2.3.  Technical support for DBI
  1173.  
  1174.   Please send comments and bug-reports to
  1175.  
  1176.   ∑  E.Mergl@bawue.de
  1177.  
  1178.   ∑  David R. Noble drnoble@engsci.sandia.gov
  1179.  
  1180.   Please include the output of perl -v, and perl -V, the version of
  1181.   PostgreSQL, the version of DBD-Pg, and the version of DBI in your bug-
  1182.   report.
  1183.  
  1184.  
  1185.   11.2.4.  What is DBI, DBperl, Oraperl and *perl?
  1186.  
  1187.   To quote Tim Bunce, the architect and author of DBI:
  1188.  
  1189.   ``DBI is a database access Application Programming Interface (API) for
  1190.   the Perl Language. The DBI API Specification defines a set of
  1191.   functions, variables and conventions that provide a consistent
  1192.   database interface independent of the actual database being used.''
  1193.  
  1194.   In simple language, the DBI interface allows users to access multiple
  1195.   database types transparently. So, if you connecting to an Oracle,
  1196.   Informix, mSQL, Sybase or whatever database, you don't need to know
  1197.   the underlying mechanics of the 3GL layer. The API defined by DBI will
  1198.   work on all these database types.
  1199.  
  1200.   A similar benefit is gained by the ability to connect to two different
  1201.   databases of different vendor within the one perl script, ie, I want
  1202.   to read data from an Oracle database and insert it back into an
  1203.   Informix database all within one program. The DBI layer allows you to
  1204.   do this simply and powerfully.
  1205.  
  1206.   DBperl is the old name for the interface specification. It's usually
  1207.   now used to denote perl4 modules on database interfacing, such as,
  1208.   oraperl, isqlperl, ingperl and so on. These interfaces didn't have a
  1209.   standard API and are generally not supported.
  1210.  
  1211.   Here's a list of DBperl modules, their corresponding DBI counterparts
  1212.   and support information. DBI driver queries should be directed to the
  1213.   dbi-users mailing list.
  1214.  
  1215.  
  1216.            Module Name Database Required   Author          DBI
  1217.            ----------- -----------------   ------          ---
  1218.            Sybperl     Sybase              Michael Peppler DBD::Sybase
  1219.                                            <mpeppler@datamig.com>
  1220.                                            http://www.mbay.net/~mpeppler
  1221.            Oraperl     Oracle 6 & 7        Kevin Stock     DBD::Oracle
  1222.                                            <dbi-users@fugue.com>
  1223.            Ingperl     Ingres              Tim Bunce &     DBD::Ingres
  1224.                                            Ted Lemon
  1225.                                            <dbi-users@fugue.com>
  1226.            Interperl   Interbase           Buzz Moschetti  DBD::Interbase
  1227.                                            <buzz@bear.com>
  1228.            Uniperl     Unify 5.0           Rick Wargo      None
  1229.                                            <rickers@coe.drexel.edu>
  1230.            Pgperl      Postgres            Igor Metz       DBD::Pg
  1231.                                            <metz@iam.unibe.ch>
  1232.            Btreeperl   NDBM                John Conover    SDBM?
  1233.                                            <john@johncon.com>
  1234.            Ctreeperl   C-Tree              John Conover    None
  1235.                                            <john@johncon.com>
  1236.            Cisamperl   Informix C-ISAM     Mathias Koerber None
  1237.                                            <mathias@unicorn.swi.com.sg>
  1238.            Duaperl     X.500 Directory     Eric Douglas    None
  1239.                        User Agent
  1240.  
  1241.  
  1242.  
  1243.  
  1244.   However, some DBI modules have DBperl emulation layers, so, DBD::Ora≠
  1245.   cle comes with an Oraperl emulation layer, which allows you to run
  1246.   legacy oraperl scripts without modification. The emulation layer
  1247.   translates the oraperl API calls into DBI calls and executes them
  1248.   through the DBI switch.
  1249.  
  1250.   Here's a table of emulation layer information:
  1251.  
  1252.  
  1253.  
  1254.  
  1255.       Module                  Emulation Layer     Status
  1256.       ------          ---------------     ------
  1257.       DBD::Oracle     Oraperl             Complete
  1258.       DBD::Informix   Isqlperl            Under development
  1259.       DBD::Sybase     Sybperl             Working? ( Needs verification )
  1260.       DBD::mSQL       Msqlperl            Experimentally released with
  1261.                                           DBD::mSQL-0.61
  1262.  
  1263.  
  1264.  
  1265.  
  1266.   The Msqlperl emulation is a special case. Msqlperl is a perl5 driver
  1267.   for mSQL databases, but does not conform to the DBI Specification.
  1268.   It's use is being deprecated in favour of DBD::mSQL. Msqlperl may be
  1269.   downloaded from CPAN via:
  1270.  
  1271.   ∑  <http://www.perl.com/cgi-bin/cpan_mod?module=Msqlperl>
  1272.  
  1273.   11.2.5.  DBI specifications
  1274.  
  1275.   There are a few information sources on DBI.
  1276.  
  1277.   ∑  DBI Specification
  1278.      <http://www.hermetica.com/technologia/perl/DBI/doc/dbispec>
  1279.  
  1280.      There are two specifications available at this link, the new DBI
  1281.      Draft Specification which is a rapidly changing document as the
  1282.      development team drive towards a stable interface, and the old
  1283.      historical DBperl Specification out of which the current DBI
  1284.      interface evolved.
  1285.  
  1286.   The later document should be regarded as being of historical interest
  1287.   only and should not serve as a programming manual, or authoratative in
  1288.   any sense. However, it is still a very useful reference source.
  1289.  
  1290.   POD documentation PODs are chunks of documentation usually embedded
  1291.   within perl programs that document the code ``in place'', providing a
  1292.   useful resource for programmers and users of modules. POD for DBI and
  1293.   drivers is beginning to become more commonplace, and documentation for
  1294.   these modules can be read with the following commands.
  1295.  
  1296.   The DBI Specification The POD for the DBI Specification can be read
  1297.   with the command
  1298.  
  1299.   perldoc DBI
  1300.  
  1301.   Oraperl Users of the Oraperl emulation layer bundled with DBD::Oracle,
  1302.   may read up on how to program with the Oraperl interface by typing:
  1303.  
  1304.   perldoc Oraperl
  1305.  
  1306.   This will produce an updated copy of the original oraperl man page
  1307.   written by Kevin Stock for perl4. The oraperl API is fully listed and
  1308.   described there.
  1309.  
  1310.   DBD::mSQL Users of the DBD::mSQL module may read about some of the
  1311.   private functions and quirks of that driver by typing:
  1312.  
  1313.   perldoc DBD::mSQL
  1314.  
  1315.   Frequently Asked Questions The Frequently Asked Questions is also
  1316.   available as POD documentation. Read this by typing:
  1317.  
  1318.   perldoc DBI::FAQ
  1319.  
  1320.  
  1321.   This may be more convenient to people not permanently, or
  1322.   conveniently, connected to the Internet.
  1323.  
  1324.   POD in general Information on writing POD, and on the philosophy of
  1325.   POD in general, can be read by typing:
  1326.  
  1327.   perldoc perlpod
  1328.  
  1329.   Users with the Tk module installed may be interested to learn there is
  1330.   a Tk-based POD reader available called tkpod, which formats POD in a
  1331.   convenient and readable way.
  1332.  
  1333.   Rambles, Tidbits and Observations : There are a series of occasional
  1334.   rambles from various people on the DBI mailing lists.
  1335.  
  1336.   ∑  <http://www.hermetica.com/technologia/perl/DBI/tidbits>
  1337.  
  1338.  
  1339.   ``DBI -- The perl5 Database Interface'' This is an article written by
  1340.   Alligator Descartes and Tim Bunce on the structure of DBI. It was
  1341.   published in issue 5 of ``The Perl Journal''.  It's extremely good. Go
  1342.   buy the magazine. In fact, buy all of them.  ``The Perl Journal''s WWW
  1343.   site is:
  1344.  
  1345.   ∑  <http://www.tpj.com>
  1346.  
  1347.   ``DBperl'' This article, published in the November 1996 edition of
  1348.   ``Dr. Dobbs Journal'' concerned DBperl.
  1349.  
  1350.   ``The Perl5 Database Interface'' This item is a book to be written by
  1351.   Alligator Descartes and published by O'Reilly and Associates.
  1352.  
  1353.   Mailing Lists There are three mailing lists for DBI run by Ted Lemon.
  1354.   These can all be subscribed to and unsubscribed from via the World
  1355.   Wide Web at
  1356.  
  1357.   ∑  Mailing lists  <http://www.fugue.com/dbi>
  1358.  
  1359.   The lists that users may participate in are:
  1360.  
  1361.   dbi-announce This mailing list is for announcements only.  If you
  1362.   cannot successfully use the form on the above WWW page, please
  1363.   subscribe to the list in the following manner:
  1364.  
  1365.   ∑  Email: dbi-announce-request@fugue.com with a message body of
  1366.      'subscribe'
  1367.  
  1368.   dbi-dev This mailing list is intended for the use of developers
  1369.   discussing ideas and concepts for the DBI interface, API and driver
  1370.   mechanics. Only any use for developers, or interested parties.  If you
  1371.   cannot successfully use the form on the above WWW page, please
  1372.   subscribe to the list in the following manner:
  1373.  
  1374.   ∑  Email: dbi-dev-request@fugue.com with a message body of 'subscribe'
  1375.  
  1376.   dbi-users This mailing list is a general discussion list used for bug
  1377.   reporting, problem discussion and general enquiries.  If you cannot
  1378.   successfully use the form on the above WWW page, please subscribe to
  1379.   the list in the following manner:
  1380.  
  1381.   ∑  Email: dbi-users-request@fugue.com with a message body of
  1382.      'subscribe'
  1383.  
  1384.   Mailing List Archives
  1385.  
  1386.  
  1387.   ∑  US Mailing List Archives  <http://outside.organic.com/mail-
  1388.      archives/dbi-users/>
  1389.  
  1390.   ∑  European Mailing List Archives  <http://www.rosat.mpe-
  1391.      garching.mpg.de/mailing-lists/PerlDB-Interest>
  1392.  
  1393.   11.2.6.  Compilation problems or "It fails the test"
  1394.  
  1395.   If you have a core dump, try the Devel::CoreStack module for
  1396.   generating a stack trace from the core dump.  Devel::CoreStack can be
  1397.   found on CPAN at:
  1398.  
  1399.   ∑  <http://www.perl.com/cgi-bin/cpan_mod?module=Devel::CoreStack>
  1400.  
  1401.   Email the dbi-users Mailing List stack trace, module versions, perl
  1402.   version, test cases, operating system versions and any other pertinent
  1403.   information.  The more information you send, the quicker developers
  1404.   can track problems down. If you send us nothing, expect nothing back.
  1405.  
  1406.   11.2.7.  Is DBI supported under Windows 95 / NT platforms?
  1407.  
  1408.   The DBI and DBD::Oracle Win32 ports are now a standard part of DBI,
  1409.   so, downloading DBI of version higher than 0.81 should work fine.  You
  1410.   can access Microsoft Access and SQL-Server databases from DBI via
  1411.   ODBC.  Supplied with DBI-0.79 (and later) is an experimental DBI
  1412.   'emulation layer' for the Win32::ODBC module. It's called
  1413.   DBI::W32ODBC.  You will need the Win32::ODBC module.
  1414.  
  1415.   ∑  Win32 DBI    <http://www.hermetica.com/technologia/perl/DBI/win32>
  1416.  
  1417.   ∑  Win32 ODBC    <http://www.roth.net>
  1418.  
  1419.   11.2.8.  What's DBM? And why use DBI instead ?
  1420.  
  1421.   UNIX was originally blessed with simple file-based ``databases'',
  1422.   namely the dbm system. dbm lets you store data in files, and retrieve
  1423.   that data quickly. However, it also has serious drawbacks.
  1424.  
  1425.   File Locking
  1426.  
  1427.   The dbm systems did not allow particularly robust file locking
  1428.   capabilities, nor any capability for correcting problems arising
  1429.   through simultaneous writes [ to the database ].
  1430.  
  1431.   Arbitrary Data Structures
  1432.  
  1433.   The dbm systems only allows a single fixed data structure: key-value
  1434.   pairs. That value could be a complex object, such as a [ C ] struct,
  1435.   but the key had to be unique. This was a large limitation on the
  1436.   usefulness of dbm systems.
  1437.  
  1438.   However, dbm systems still provide a useful function for users with
  1439.   simple datasets and limited resources, since they are fast, robust and
  1440.   extremely well-tested. Perl modules to access dbm systems have now
  1441.   been integrated into the core Perl distribution via the AnyDBM_File
  1442.   module.
  1443.  
  1444.   To sum up, DBM is a perfectly satisfactory solution for essentially
  1445.   read-only databases, or small and simple datasets. However, for more
  1446.   powerful and scaleable datasets, not to mention robust transactional
  1447.   locking, users are recommended to use DBI.
  1448.  
  1449.   11.2.9.  Is < insert feature here > supported in DBI?
  1450.  
  1451.   Given that we're making the assumption that the feature you have
  1452.   requested is a non-standard database-specific feature, then the answer
  1453.   will be no.
  1454.  
  1455.   DBI reflects a generic API that will work for most databases, and has
  1456.   no database-specific functionality.
  1457.  
  1458.   However, driver authors may, if they so desire, include hooks to
  1459.   database-specific functionality through the func method defined in the
  1460.   DBI API. Script developers should note that use of functionality
  1461.   provided via the func methods is unlikely to be portable across
  1462.   databases.
  1463.  
  1464.   11.2.10.  Is DBI any use for CGI programming?
  1465.  
  1466.   In a word, yes! DBI is hugely useful for CGI programming! In fact, CGI
  1467.   programming is one of two top uses for DBI.
  1468.  
  1469.   DBI confers the ability to CGI programmers to power WWW-fronted
  1470.   databases to their users, which provides users with vast quantities of
  1471.   ordered data to play with. DBI also provides the possibility that, if
  1472.   a site is receiving far too much traffic than their database server
  1473.   can cope with, they can upgrade the database server behind the scenes
  1474.   with no alterations to the CGI scripts.
  1475.  
  1476.   11.2.11.  How do I get faster connection times with DBD Oracle and
  1477.   CGI?
  1478.  
  1479.   The Apache httpd maintains a pool of httpd children to service client
  1480.   requests.  Using the Apache mod_perl module by Doug MacEachern, the
  1481.   perl interpreter is embedded with the httpd children. The CGI, DBI,
  1482.   and your other favorite modules can be loaded at the startup of each
  1483.   child. These modules will not be reloaded unless changed on disk.  For
  1484.   more information on Apache, see the Apache Project's WWW site:
  1485.  
  1486.   ∑  Apache Project WWW site  <http://www.apache.org>
  1487.  
  1488.   ∑  Mod_perl module  <http://www.perl.com/cgi-
  1489.      bin/cpan_mod?module=mod_perl>
  1490.  
  1491.   11.2.12.  How do I get persistent connections with DBI and CGI?
  1492.  
  1493.   Using Edmund Mergl's Apache::DBI module, database logins are stored in
  1494.   a hash with each of these httpd child. If your application is based on
  1495.   a single database user, this connection can be started with each
  1496.   child.  Currently, database connections cannot be shared between httpd
  1497.   children.  Apache::DBI can be downloaded from CPAN via:
  1498.  
  1499.   ∑  <http://www.perl.com/cgi-bin/cpan_mod?module=Apache::DBI>
  1500.  
  1501.   11.2.13.  ``When I run a perl script from the command line, it works,
  1502.   but, when I run it under the httpd, it fails!'' Why?
  1503.  
  1504.   Basically, a good chance this is occurring is due to the fact that the
  1505.   user that you ran it from the command line as has a correctly
  1506.   configured set of environment variables, in the case of DBD::Oracle,
  1507.   variables like $ORACLE_HOME, $ORACLE_SID or TWO_TASK.  The httpd
  1508.   process usually runs under the user id of nobody, which implies there
  1509.   is no configured environment. Any scripts attempting to execute in
  1510.   this situation will correctly fail.  To solve this problem, set the
  1511.   environment for your database in a BEGIN ( ) block at the top of your
  1512.   script. This will solve the problem.  Similarly, you should check your
  1513.   httpd error logfile for any clues, as well as the ``Idiot's Guide To
  1514.   Solving Perl / CGI Problems'' and ``Perl CGI Programming FAQ'' for
  1515.   further information. It is unlikely the problem is DBI-related. Read
  1516.   BOTH these documents carefully!
  1517.  
  1518.  
  1519.   ∑  Idiot's Guide to Solving Perl / CGI problems
  1520.      <http://www.perl.com/perl/faq/index.html>
  1521.  
  1522.   11.2.14.  Can I do multi-threading with DBI?
  1523.  
  1524.   As of the current date, no. Perl does not support multi-threading.
  1525.   However, multi-threading is expected to become part of the perl core
  1526.   distribution as of version 5.005, which implies that DBI may support
  1527.   multi-threading fairly soon afterwards.  For some OCI example code for
  1528.   Oracle that has multi-threaded SELECT statements, see:
  1529.  
  1530.   ∑  <http://www.hermetica.com/technologia/oracle/oci/orathreads.tar.gz>
  1531.  
  1532.   11.2.15.  How can I invoke stored procedures with DBI?
  1533.  
  1534.   Assuming that you have created a stored procedure within the target
  1535.   database, eg, an Oracle database, you can use $dbh->do to immediately
  1536.   execute the procedure. For example,
  1537.  
  1538.   $dbh->do( "BEGIN someProcedure END" );
  1539.  
  1540.   11.2.16.  How can I get return values from stored procedures with DBI?
  1541.  
  1542.   Remember to perform error checking, though!
  1543.  
  1544.  
  1545.            $sth = $dbh->prepare( "BEGIN foo(:1, :2, :3); END;" );
  1546.            $sth->bind_param(1, $a);
  1547.            $sth->bind_param_inout(2, \$path, 2000);
  1548.            $sth->bind_param_inout(3, \$success, 2000);
  1549.            $sth->execute;
  1550.  
  1551.  
  1552.  
  1553.  
  1554.   11.2.17.  How can I create or drop a database with DBI?
  1555.  
  1556.   Database creation and deletion are concepts that are entirely too
  1557.   abstract to be adequately supported by DBI. For example, Oracle does
  1558.   not support the concept of dropping a database at all! Also, in
  1559.   Oracle, the database server essentially is the database, whereas in
  1560.   mSQL, the server process runs happily without any databases created in
  1561.   it. The problem is too disparate to attack.  Some drivers, therefore,
  1562.   support database creation and deletion through the private func
  1563.   methods. You should check the documentation for the drivers you are
  1564.   using to see if they support this mechanism.
  1565.  
  1566.   11.2.18.  How are NULL values handled by DBI?
  1567.  
  1568.   NULL values in DBI are specified to be treated as the value undef.
  1569.   NULLs can be inserted into databases as NULL, for example:
  1570.  
  1571.  
  1572.            $rv = $dbh->do( "INSERT INTO table VALUES( NULL )" );
  1573.  
  1574.  
  1575.  
  1576.  
  1577.   but when queried back, the NULLs should be tested against undef. This
  1578.   is standard across all drivers.
  1579.  
  1580.   11.2.19.  What are these func methods all about?
  1581.  
  1582.   The func method is defined within DBI as being an entry point for
  1583.   database-specific functionality, eg, the ability to create or drop
  1584.   databases. Invoking these driver-specific methods is simple, for
  1585.   example, to invoke a createDatabase method that has one argument, we
  1586.   would write:
  1587.  
  1588.  
  1589.            $rv = $dbh->func( 'argument', 'createDatabase' );
  1590.  
  1591.  
  1592.  
  1593.  
  1594.   Software developers should note that the func methods are non-portable
  1595.   between databases.
  1596.  
  1597.   11.2.20.  Commercial Support and Training
  1598.  
  1599.   The Perl5 Database Interface is FREE software. IT COMES WITHOUT
  1600.   WARRANTY OF ANY KIND.  However, some organizations are providing
  1601.   either technical support or training programs on DBI.
  1602.  
  1603.   PERL CLINIC : The Perl Clinic can arrange commercial support contracts
  1604.   for Perl, DBI, DBD::Oracle and Oraperl. Support is provided by the
  1605.   company with whom Tim Bunce, author of DBI, works. For more
  1606.   information on their services, please see :
  1607.  
  1608.   ∑  <http://www.perl.co.uk/tpc>
  1609.  
  1610.   12.  PostgreSQL Management Tools
  1611.  
  1612.  
  1613.   12.1.  PGACCESS - A GUI Tool for PostgreSQL Management
  1614.  
  1615.   PgAccess is a Tcl/Tk interface to PostgreSQL.  It is already included
  1616.   in the distribution of PostgreSQL.  You may want to check out this web
  1617.   site for a newer copy
  1618.  
  1619.   ∑  <http://www.flex.ro/pgaccess>
  1620.  
  1621.   ∑  If you have any comment, suggestion for improvements, please feel
  1622.      free to e-mail to : teo@flex.ro
  1623.  
  1624.   Features of PgAccess
  1625.  
  1626.   PgAccess windows - Main window, Table builder, Table(query) view,
  1627.   Visual query builder.
  1628.  
  1629.   Tables
  1630.  
  1631.   ∑  opening tables for viewing, max 200 records (changed by preferences
  1632.      menu)
  1633.  
  1634.   ∑  column resizing, dragging the vertical grid line (better in table
  1635.      space rather than in the table header)
  1636.  
  1637.   ∑  text wrap in cells - layout saved for every table
  1638.  
  1639.   ∑  import/export to external files (SDF,CSV)
  1640.  
  1641.   ∑  filter capabilities (enter filter like (price>3.14)
  1642.  
  1643.   ∑  sort order capabilities (enter manually the sort field(s))
  1644.  
  1645.   ∑  editing in place
  1646.  
  1647.   ∑  improved table generator assistant
  1648.  
  1649.   ∑  improved field editing
  1650.  
  1651.   Queries
  1652.  
  1653.   ∑  define , edit and stores "user defined queries"
  1654.  
  1655.   ∑  store queries as views
  1656.  
  1657.   ∑  execution of queries
  1658.  
  1659.   ∑  viewing of select type queries result
  1660.  
  1661.   ∑  query deleting and renaming
  1662.  
  1663.   ∑  Visual query builder with drag & drop capabilities. For any of you
  1664.      who had installed the Tcl/Tk plugin for Netscape Navigator, you can
  1665.      see it at work clicking here
  1666.  
  1667.   Sequences
  1668.  
  1669.   ∑  defines sequences, delete them and inspect them Functions
  1670.  
  1671.   ∑  define, inspect and delete functions in SQL language
  1672.  
  1673.   Future implementation will have
  1674.  
  1675.   ∑  table design (add new fields, renaming, etc.)
  1676.  
  1677.   ∑  function definition
  1678.  
  1679.   ∑  report generator
  1680.  
  1681.   ∑  basic scripting
  1682.  
  1683.   If you have any comment, suggestion for improvements e-mail to :
  1684.  
  1685.   ∑  teo@flex.ro
  1686.  
  1687.   Information about libgtcl
  1688.  
  1689.   You will need the PostgreSQL to Tcl interface library libgtcl, lined
  1690.   as a Tcl/Tk 'load'-able module. The libpgtcl and the source is located
  1691.   in the PostgreSQL directory /src/interfaces/libpgtcl. Specifically,
  1692.   you will need a libpgtcl library that is 'load'-able from Tcl/Tk. This
  1693.   is technically different from an ordinary PostgreSQL loadable object
  1694.   file, because libpgtcl is a collection of object files. Under Linux,
  1695.   this is called libpgtcl.so.  You can download from the above site a
  1696.   version already compiled for Linux i386 systems. Just copy libpgtcl.so
  1697.   into your system library director (/usr/lib).  One of the solutions is
  1698.   to remove from the source the line containing load libpgtcl.so and to
  1699.   load pgaccess.tcl not with wish, but with pgwish (or wishpg) that wish
  1700.   that was linked with libpgtcl library.
  1701.  
  1702.   12.2.  Windows Interactive Query Tool for PostgreSQL (WISQL or MPSQL)
  1703.  
  1704.   MPSQL provides users with a graphical SQL interface to PostgresSQL.
  1705.   MPSQL is similar to Oracle's SQL Worksheet and Microsoft SQL Server's
  1706.   query tool WISQL.  It has nice GUI and has history of commands. Also
  1707.   you can cut and paste and it has other nice features to improve your
  1708.   productivity.
  1709.  
  1710.   ∑  <http://www.troubador.com/~keidav/index.html>
  1711.  
  1712.   ∑  Email: keidav@whidbey.com
  1713.  
  1714.   ∑  <http://www.ucolick.org/~de/> in file tcl_syb/wisql.html
  1715.  
  1716.  
  1717.   ∑  <http://www.troubador.com/~keidav/index.html>
  1718.  
  1719.   ∑  Email: de@ucolick.org
  1720.  
  1721.   12.3.  Interactive Query Tool (ISQL) for PostgreSQL called PSQL
  1722.  
  1723.   ISQL is For Character command line terminals.  This is included in the
  1724.   distribution, and is called PSQL. Very similar to Sybase ISQL, Oracle
  1725.   SQLplus. At unix prompt give command 'psql' which will put you in
  1726.   psql> prompt.
  1727.  
  1728.  
  1729.        Type \h to see help of commands.
  1730.  
  1731.  
  1732.  
  1733.  
  1734.   Very user friendly and easy to use.  Can also be accessed from shell
  1735.   scripts.
  1736.  
  1737.   12.4.  MPMGR - A Database Management Tool for PostgresSQL
  1738.  
  1739.   MPMGR will provide a graphical management interface for PostgresSQL.
  1740.   You can find it at
  1741.  
  1742.   ∑  <http://www.troubador.com/~keidav/index.html>
  1743.  
  1744.   ∑  Email: keidav@whidbey.com
  1745.  
  1746.   ∑  <http://www.troubador.com/~keidav/index.html>
  1747.  
  1748.   ∑  <http://www.ucolick.org/~de> in file tcl_syb/wisql.html
  1749.  
  1750.   ∑  WISQL for PostgreSQL  <http://www.ucolick.org/~de/Tcl/pictures>
  1751.  
  1752.   ∑  Email: de@ucolick.org
  1753.  
  1754.   13.  Setting up multi-boxes PostgreSQL with just one monitor
  1755.  
  1756.   You can stack up the cpu-boxes and connect to just one monitor and use
  1757.   the switch box to select the host.  This saves space and you eliminate
  1758.   monitor, keyboard and the mouse (saving anywhere from 100 to 500 US
  1759.   dollars per set) and also avoid lot of clutter.
  1760.  
  1761.   Using this switch box, you can stack up many PostgreSQL servers
  1762.   (development, test, production), Web servers, ftp servers, Intranet
  1763.   servers, Mail servers, News servers in a tower shelf. The switch box
  1764.   can be used for controlling Windows 95/NT or OS/2 boxes as well.
  1765.  
  1766.   Please check out these sites:
  1767.  
  1768.   ∑  Network Technologies Inc
  1769.      <http://www.networktechinc.com/servswt.html> (120 dollars/PC 8
  1770.      ports) which lists
  1771.  
  1772.   ∑  Scene Double Inc, England
  1773.      <http://www.scene.demon.co.uk/qswitch.htm>
  1774.  
  1775.   ∑  Cybex corporation  <http://www.cybex.com>
  1776.  
  1777.   ∑  Raritan Inc  <http://www.raritan.com>
  1778.  
  1779.   ∑  RealStar Solutions Inc  <http://www.real-star.com/kvm.htm>
  1780.  
  1781.   ∑  Belkin Inc  <http://www.belkin.com>
  1782.  
  1783.   ∑  DataComm Warehouse Inc Call 24 hours a day, 7 days a week at
  1784.      1-800-328-2261They supply all varieties of computer hardware
  1785.      <http://www.warehouse.com>
  1786.  
  1787.   ∑  Better Box Communications Ltd.
  1788.      <http://www.betterbox.com/info.html>
  1789.  
  1790.   ∑  Go to nearest hardware store and ask for "Server Switch" also known
  1791.      as "KVM Auto Switches".
  1792.  
  1793.   Search engine yahoo to find more companies with "Server Switches" or
  1794.   "KVM Switches".
  1795.  
  1796.   It is strongly recommended to have a dedicated unix box for each
  1797.   PostgreSQL data-server for better performance. No other application
  1798.   program/processes should run on this box. See the Business section of
  1799.   your local newspapers for local vendors selling only intel box, 13"
  1800.   monochrome monitor (very low cost monitor). Local vendors sell just
  1801.   the hardware without any Microsoft Windows/DOS (saves you about $
  1802.   150).  You do not need a color monitor for the database server, as you
  1803.   can do remote administration from color PC workstation.  Get RedHat
  1804.   (or some other distribution of) Linux cdrom from below -
  1805.  
  1806.   ∑  Linux System Labs Web site:   <http://www.lsl.com/>  7 (U.S.
  1807.      dollars)
  1808.  
  1809.   ∑  Cheap Bytes Inc Web site:   <http://www.cheapbytes.com/> 7 (U.S.
  1810.      dollars)
  1811.  
  1812.      Make sure that the hardware you purchase is supported by Redhat
  1813.      Linux. Check the ftp site of Redhat for recommended hardware like
  1814.      SCSI adapters, video cards before buying.  For just $ 600 you will
  1815.      get a powerful intel box with Redhat Linux running PostgreSQL.  Use
  1816.      odbc/jdbc/perl/tcl to connect to PostgreSQL from Windows95, OS/2,
  1817.      Unix Motif or web browser (e.g. Redbaron, Opera, Netscape, 20
  1818.      others).  (Web browsers are very fast becoming the standard
  1819.      client).
  1820.  
  1821.   Using this idea you can control many cpu boxes by just one monitor and
  1822.   one keyboard!
  1823.  
  1824.   Below is the extract from networktechnic Inc for the "Server Switches"
  1825.  
  1826.   Order now call 800-742-8324 (toll free in USA)
  1827.  
  1828.   To receive our catalog please Email your address to:
  1829.   sales@networktechinc.com
  1830.  
  1831.   CONTROL MULTIPLE PC'S with one keyboard monitor & mouse These
  1832.   electronic switches will allow one keyboard, monitor & mouse to
  1833.   control up to 64 PC's. Embedded microcomputers simulate the presence
  1834.   of keyboard, monitor & mouse to all attached PC's 100% of the time.
  1835.  
  1836.   Features and Applications
  1837.  
  1838.  
  1839.   ∑  Keyboard, front panel or remote control
  1840.  
  1841.   ∑  9 pin D Serial or 6 pin miniDIN mouse support
  1842.  
  1843.   ∑  5 pin DIN or 6 pin miniDIN keyboard support
  1844.  
  1845.   ∑  1600x1200 video resolution with no degradation
  1846.  
  1847.   ∑  Uses standard cables
  1848.  
  1849.   ∑  Desktop or rackmount
  1850.  
  1851.   Specifications - Keyboard
  1852.  
  1853.  
  1854.   ∑  All connectors are female
  1855.  
  1856.   ∑  5 pin DIN or 6 pin miniDIN
  1857.  
  1858.   ∑  Will hard or soft boot all PC's 100% of the time
  1859.  
  1860.   Controls - Buttons on Front
  1861.  
  1862.  
  1863.   ∑  Touch a button and be connected to that PC
  1864.  
  1865.   ∑  Hold any button in for more than 0.5 second and go into SCAN,
  1866.      BROADCAST or COMMAND mode
  1867.  
  1868.   ∑  LEDs on front indicate mode of operation Keyboard
  1869.  
  1870.   ∑  Type CTRL+* and go into COMMAND mode
  1871.  
  1872.   ∑  SCAN, BROADCAST or COMMAND are available
  1873.  
  1874.   Mouse
  1875.  
  1876.   * 9 pin D serial
  1877.  
  1878.   ∑  o NTI switch emulates Microsoft serial mouse to all PC's
  1879.  
  1880.   ∑  o 9 pin D male for mouse
  1881.  
  1882.   ∑  o 9 pin D female for PC's
  1883.  
  1884.   * 6 pin miniDIN
  1885.  
  1886.   ∑  o NTI switch emulates IBM PS/2 style mouse to all PC's
  1887.  
  1888.   ∑  o All connectors are female
  1889.  
  1890.   Wired remote
  1891.  
  1892.   ∑  Optional--must be purchased
  1893.  
  1894.   ∑  Operates same as "Buttons on Front"
  1895.  
  1896.   Monitor-VGA
  1897.  
  1898.   ∑  Bandwidth is 150 MHz
  1899.  
  1900.   ∑  1600X1200 resolution with no degradation
  1901.  
  1902.   ∑  All connectors are female
  1903.  
  1904.   14.  Applications and Tools for PostgreSQL
  1905.  
  1906.   14.1.  PostgreSQL 4GL for web database applications - AppGEN Develop≠
  1907.   ment System
  1908.  
  1909.   AppGEN can be downloaded from
  1910.  
  1911.   ∑  <http://www.man.ac.uk/~whaley/ag/appgen.html>
  1912.  
  1913.   ∑  <ftp://ftp.mcc.ac.uk/pub/linux/ALPHA/AppGEN>.
  1914.  
  1915.      AppGEN is a high level fourth generation language and application
  1916.      generator for producing World Wide Web (WWW) based applications.
  1917.      These applications are typically used over the internet or within a
  1918.      corporate intranet. AppGEN applications are implemented as C
  1919.      scripts conforming to the Common Gateway Interface (CGI) standard
  1920.      supported by most Web Servers.
  1921.  
  1922.   To use AppGEN you will need the following :-
  1923.  
  1924.   PostgresSQL, relational database management system
  1925.  
  1926.   A CGI compatible web server such as NCSA's HTTPD
  1927.  
  1928.   An ansi C compiler such as GCC
  1929.  
  1930.   AppGEN consists of the following Unix (Linux) executables :-
  1931.  
  1932.  
  1933.   ∑  defgen, which produces a basic template application from a logical
  1934.      data structure. The applications are capable of adding, updating,
  1935.      deleting and searching for records within the database whilst
  1936.      automatically maintaining referential integrity.
  1937.  
  1938.  
  1939.   ∑  appgen, the AppGEN compiler which compiles the appgen source code
  1940.      into CGI executable C source and HTML formatted documents ready for
  1941.      deployment on a web server.
  1942.  
  1943.  
  1944.   ∑  dbf2sql, a utility fo converting dBase III compatible .dbf files
  1945.      into executable SQL scripts. This enables data stored in most
  1946.      DOS/Windows based database packages to be migrated to a SQL server
  1947.      such as PostgresSQL.
  1948.  
  1949.   ∑  In addition, AppGEN comprises of a collection of HTML documents,
  1950.      GIF files and Java applets which are used at runtime by the system.
  1951.      And of course, like all good software, the full source code is
  1952.      included.
  1953.  
  1954.   The author, Andrew Whaley, can be contacted on
  1955.  
  1956.   ∑  andrew@arthur.smuht.nwest.nhs.uk
  1957.  
  1958.   14.2.  WWW Web interface for PostgresSQL - DBENGINE
  1959.  
  1960.   dbengine a plug 'n play Web interface for PostgreSQL created by Ingo
  1961.   Ciechowski. It is at
  1962.  
  1963.   ∑  <http://www.cis-computer.com/dbengine/ >
  1964.  
  1965.      About DBENGINE : dbengine is an interface between the WWW and
  1966.      Postgres95 which provides simple access to any existing database
  1967.      within just a few minutes.
  1968.  
  1969.   PHP 3 gives you a Perl like language in your documents, but no real
  1970.   Perl while AppGen and wdb-p95 require that you create some
  1971.   configuration file for each of your databases -- sound's like you'll
  1972.   first of all have to learn some sort of new mata language before you
  1973.   can get started.
  1974.  
  1975.   Unlike other tools you don't have to learn any special programming or
  1976.   scripting language to get started with dbengine. Also there's no
  1977.   configuration file for each database, so you don't have to get
  1978.   familiar with such a new structure.  However - in case you want to
  1979.   gain access to the full features of dbengine it'd be a good idea to
  1980.   know the Perl language.
  1981.   The whole system can be configured by simple manipulations of an
  1982.   additional database that contains closer information about how to
  1983.   visualize your database access.  You can even specify virtual Fields
  1984.   which are calculated on the fly right before they're displayed on the
  1985.   screen.
  1986.  
  1987.   License : dbengine is free software under the same terms as Perl. Read
  1988.   its licence if you aren't sure what you can or can't do. The bottom
  1989.   line is that this is a kinder and gentler version of the GNU licence
  1990.   -- one that doesn't infect your work if you care to borrow from
  1991.   dbengine or package up pieces of it as part of a commercial product.
  1992.  
  1993.   14.3.  Apache Webserver Module for PostgreSQL - NeoSoft NeoWebScript
  1994.  
  1995.   Apache is a well-known Web Server. And a module to interface
  1996.   PostgreSQL to Apache Webserver is at -
  1997.  
  1998.   ∑  <http://www.neosoft.com/neowebscript/>
  1999.  
  2000.      NeoWebScript is a programming language that allows both simple and
  2001.      complex programs to be embedded into HTML files.
  2002.  
  2003.   When an HTML page containing embedded NeoWebScript is requested, the
  2004.   NeoWebScript-enabled webserver executes the embedded script(s),
  2005.   producing a webpage containing customized content created by the
  2006.   program.
  2007.  
  2008.   NeoWebScript is a fast, secure, easy to learn way to do powerful,
  2009.   server-based interactive programming directly in the HTML code in web
  2010.   pages. With NeoWebScript, counters, email forms, graffiti walls, guest
  2011.   books and visitor tracking are all easy, even for a beginning
  2012.   programmer. See how well NeoWebScript holds its' own vs. PERL and
  2013.   JavaScript.
  2014.  
  2015.   If you'd like to install NeoWebScript on your webserver, your
  2016.   Webmaster needs to read our Sysop FAQ to get started. Theory of
  2017.   Operations will explain how NeoWebScript works, while installation
  2018.   will take them through the steps. Management deals with configuration
  2019.   issues and running the server, tests let you verify correct
  2020.   NeoWebScript operation, and troubleshooting deals with server
  2021.   problems.
  2022.  
  2023.   There is no cost to you to use NeoWebScript-2.2 for your ISP, your
  2024.   intranet, or your extranet.  You'll see a full license when you
  2025.   register to download, but it costs $ 99 if you want to embed it in
  2026.   your own product or use it in a commerce (eg. SSL) server.
  2027.  
  2028.   NeoWebScript is a module for the Apache webserver that allows you to
  2029.   embed the Tcl/Tk programming language in your webpages as a scripting
  2030.   tool. It was invented by Karl Lehenbauer, NeoSoft's Chief Technical
  2031.   Officer, and documented, enhanced and extended by NeoSoft's
  2032.   programmers and technical writers.
  2033.  
  2034.   The Apache webserver is the world's most popular webserver, accounting
  2035.   for 68 % of the sites polled.
  2036.  
  2037.   Tcl/Tk is the powerful, free, cross-platform scripting language
  2038.   developed by Dr. John Ousterhout. In his own words
  2039.  
  2040.   "Tcl/Tk lets software developers get the job done ten times faster
  2041.   than with toolkits based on C or C++. It's also a great glue language
  2042.   for making existing applications work together and making them more
  2043.   graphical and Internet-aware."
  2044.  
  2045.   Karl Lehenbauer, Founder and Chief Technical Officer of NeoSoft, has
  2046.   been part of Tcl/Tk development from the very beginning.  Together
  2047.   with Mark Diehkans, they authored Extended Tcl, also known as TclX or
  2048.   NeoSoft Tcl, a powerful set of extensions to the language. Many of the
  2049.   current core Tcl commands originated in Extended Tcl, and were then
  2050.   imported into the core language by Dr.  Ousterhout.
  2051.  
  2052.   NeoSoft Inc., 1770 St. James Place, Suite 500, Houston, TX 77056 USA
  2053.  
  2054.   14.4.  HEITML server side extension of HTML and a 4GL language for
  2055.   PostgreSQL
  2056.  
  2057.   Tool heitml is another way to interface postgres with the world wide
  2058.   web.  For more details contact
  2059.  
  2060.  
  2061.                  Helmut Emmelmann H.E.I. Informationssyteme GmbH
  2062.                  Wimpfenerstrasse 23 Tel. 49-621-795141
  2063.                  68259 Mannheim Germany Fax. 49-621-795161
  2064.  
  2065.  
  2066.  
  2067.  
  2068.  
  2069.   ∑  E-mail Mr.Helmut Emmelmann at emmel@h-e-i.de
  2070.  
  2071.   ∑  Heitml main web site  <http://www.heitml.com>
  2072.  
  2073.   ∑  Heitml secondary web site  <http://www.h-e-i.deom>
  2074.  
  2075.   heitml is a server side extension of HTML and a 4GL language at the
  2076.   same time. People can write web applications in the HTML style by
  2077.   using new HTML-like tags.
  2078.  
  2079.   heitml (pronounced "Hi"-TML) is an extension of HTML and a full-
  2080.   featured 4th generation language that enables Web-based Applications
  2081.   to interact with data stored in SQL databases, without resorting to
  2082.   complex CGI scripts.
  2083.  
  2084.   heitml extends HTML on the sever side, dynamically converting ".hei"
  2085.   files to HTML format and so is compatible with any web browser.It
  2086.   embraces the familiar, easy-to-use HTML syntax and provides a large
  2087.   assortment of pre-developed Tags and Libraries to take care of tasks
  2088.   that formerly required CGI. As XML, heitml provides user defined tags.
  2089.   With heitml the user defined markup can be translated to HTML and send
  2090.   to a browser.
  2091.  
  2092.   heitml targets both HTML designers and professional programmers alike.
  2093.   HTML designers can use heitml Tags to build dynamic web pages, access
  2094.   SQL databases, or create complete web applications. Counters,
  2095.   registration databases, search forms, email forms, or hierarchical
  2096.   menues can all be created simply by using the pre-developed HTML-like
  2097.   Tags found in the many Component Libraries.
  2098.  
  2099.   For programmers heitml embeds a complete forth generation language in
  2100.   HTML
  2101.  
  2102.  
  2103.                  (e.g. <if>, <while>, and <let> Tags),
  2104.  
  2105.  
  2106.  
  2107.  
  2108.   plus powerful expression evaluation with integer, real, boolean,
  2109.   string, and tuple data types. Tuples have reference semantics as in
  2110.   modern object oriented languages and are stored on a heap. heitml
  2111.   variables including all complex data structures stored on the heap
  2112.   maintain their values between pages using the Session Mode. It is
  2113.   possible to define your own tags or environment tags and even re-
  2114.   define HTML-tags.
  2115.  
  2116.   heitml makes it possible to
  2117.  
  2118.   - - - develop Web Sites in a structured and modular way, drastically
  2119.   reducing maintenance overhead.
  2120.  
  2121.   - - - develop intelligent and interactive Web Sites, with content that
  2122.   dynamically adapts itself to user needs.
  2123.  
  2124.   - - - show the content of SQL databases with no programming other than
  2125.   to use our library of prefined "dba" Tags.
  2126.  
  2127.   - - - develop complex database and Catalog Shopping applications using
  2128.   Session Variables
  2129.  
  2130.   heitml runs on Linux with any Web Server using the CGI interface, and
  2131.   is especially fast (avoiding the CGI overhead) within the APACHE Web
  2132.   Server using the apache API. Currently MSQL (Version 1 and 2),
  2133.   PostgreSQL (Version 6), mysql, and the yard databases are supported).
  2134.   heitml also works on Linux, BSDi, Solaris and SunOS, as well as
  2135.   Windows NT with CGI and ISAPI and ODBC and Windows 95.
  2136.  
  2137.   heitml (on linux) is free for research, non-commercial and private
  2138.   usage. Commercial Web Sites must pay a licensing fee. The fully
  2139.   operational version of heitml is available for a trial period
  2140.   downloaded freely. (Note, however, that each ".hei" Web Page you
  2141.   develop will display a message identifying it as the version for non-
  2142.   commercial use. After registration, you will receive a key to switch
  2143.   off the message without having to re-install the program.)
  2144.  
  2145.   heitml (pronounced "Hi"-TML) significantly extends and enhances the
  2146.   functionality of HTML by definable tags and full programming features.
  2147.   This makes dynamic content and database applications possible simply
  2148.   within the HTML world, without CGI and without external scripting or
  2149.   programming languages.  This means you, as an HTML author, can embed
  2150.   applications in your web pages, simply by using some new tags without
  2151.   CGI and without programming. As an advanced user or programmer on the
  2152.   other hand you can create and program powerful tag libraries. This
  2153.   approach makes heitml suitable for HTML newcomers and professional
  2154.   programmers alike.  heitml runs on the web server and dynamically
  2155.   generates HTML, so heitml is compatible with the internet standards
  2156.   and with any web browser. It allows full access to databases while
  2157.   shielding the user from any unneccessary CGI complexity. heitml has
  2158.   been developed according to the newst research and in compiler
  2159.   construction and transaction systems.
  2160.  
  2161.   heitml pages are developed just the same way as HTML pages, with a
  2162.   text editor or HTML editor, and placed on the web server as usual.
  2163.   However now pages can contain dynamic heitml tags and access tag
  2164.   libraries.  You can use these tags to access the database, to create
  2165.   dynamic content, to send emails, and even to create powerful
  2166.   applications like registration databases and shopping systems.
  2167.  
  2168.   HTML newcomers and professional programmers alike will be amazed at
  2169.   how quickly and easily they can design exciting applications like our
  2170.   Interactive Guestbook without resorting to complex and difficult to
  2171.   learn CGI scripts, simply by using the tools provided in our dba
  2172.   Library.
  2173.  
  2174.   heitml is accompanied by a wide range of tag libraries, to create
  2175.   guestbooks, database maintenance applications, extensible query forms,
  2176.   powerful email forms or structure your web site using a hierarchic
  2177.   menu. These tools are ready to go, just add the corresponding tags to
  2178.   your web site.
  2179.   As an experienced programmer you can make fully use of the heitml
  2180.   persistent dynamic tuple architecture : heitml is not just a scripting
  2181.   language with dynamic typing, full power expression evaluation,
  2182.   recursive procedures and extensive parameter passing features, but it
  2183.   also features persistent dynamic tuples to automatically keep session
  2184.   data of any size.
  2185.  
  2186.   14.5.  America On-line AOL Web server for PostgreSQL
  2187.  
  2188.   The no-cost commercial webserver, AOLserver version 2.3 supports
  2189.   database connections to PostgreSQL 6.2.1 and higher.  for more info
  2190.   see
  2191.  
  2192.   ∑  AOL Web Server  <http://www.aolserver.com>
  2193.  
  2194.   14.6.  Problem/Project Tracking System Application Tool for PostgreSQL
  2195.  
  2196.   This is at
  2197.  
  2198.   ∑  <http://www.homeport.org/~shevett/pts/>
  2199.  
  2200.   14.7.  Convert dbase dbf files to PostgreSQL
  2201.  
  2202.   The program dbf2msql works fine with mSQL and PostgreSQL. You can find
  2203.   it at
  2204.  
  2205.   ∑  <ftp://ftp.nerosworld.com/pub/SQL/dbf2sql/>
  2206.  
  2207.   ∑  <ftp://ftp.postgresql.org/pub/incoming/dbf2pg-3.0.tar.gz>
  2208.  
  2209.   This program was written by Maarten Boekhold, Faculty of Electrical
  2210.   Engineering TU Delft, NL Computer Architecture and Digital Technique
  2211.   section
  2212.  
  2213.   ∑  M.Boekhold@et.tudelft.nl
  2214.  
  2215.   You can also use a python method to read dbf files and load into a
  2216.   postgres database.
  2217.  
  2218.   ∑  See  <http://www.python.org>
  2219.  
  2220.   15.  Web Database Design/Implementation tool for PostgreSQL - EARP
  2221.  
  2222.  
  2223.   ∑  <http://www.oswego.edu/Earp>
  2224.  
  2225.   ∑  <ftp://ftp.oswego.edu> in the directory 'pub/unix/earp'.
  2226.  
  2227.   15.1.  What is EARP ?
  2228.  
  2229.   The "Easily Adjustable Response Program" (EARP) created by David
  2230.   Dougherty.  EARP is a Web Database Design/Implementation tool, built
  2231.   on top of the PostgreSQL database system. Its functionality includes:
  2232.  
  2233.  
  2234.   ∑  A Visual Design System.
  2235.  
  2236.   ∑  A sendmail interface. (can handle incoming and outgoing mail)
  2237.  
  2238.   ∑  An Enhanced Security Mechanism.
  2239.  
  2240.   ∑  A cgi driver.
  2241.  
  2242.  
  2243.  
  2244.  
  2245.   15.2.  Implementation
  2246.  
  2247.   The main implementation of EARP is a CGI binary which runs under the
  2248.   http daemon to provide access to the database server. All of the
  2249.   design tools are built into the driver, no design takes place over
  2250.   anything but the web. The tools themselves require a graphical
  2251.   browser, the compatibility of objects designed with the tools is
  2252.   implementation independent, based on designing individuals
  2253.   preferences.
  2254.  
  2255.   15.3.  What you need to run EARP
  2256.  
  2257.   EARP will likely run on a variety of platforms with little or no
  2258.   porting. The known working platforms consist of the following:
  2259.  
  2260.   ∑  Solaris 2.5
  2261.  
  2262.   ∑  Linux 1.2.13+
  2263.  
  2264.   ∑  GNU C++
  2265.  
  2266.   ∑  PostgreSQL (Version 1.01 / 1.02 )
  2267.  
  2268.   ∑  netsite server
  2269.  
  2270.   ∑  NCSA httpd
  2271.  
  2272.  
  2273.   ∑  GNU C++
  2274.  
  2275.   ∑  PostgreSQL (Version 1.01 / 1.02 )
  2276.  
  2277.   ∑  NCSA httpd
  2278.  
  2279.   ∑  Apache httpd
  2280.  
  2281.      The current (1.3) release of Earp was designed on top of the libpq
  2282.      release that came with PostgreSQL v1.01/1.02.  If you are using a
  2283.      more recent version of Postgres, expect that the program will
  2284.      require some porting to work correctly. In the development version
  2285.      (Earp 2.0), libpq support is being incorporated as a module.
  2286.  
  2287.   15.4.  How does it work ?
  2288.  
  2289.   One of the main features of EARP is that it uses an Object Oriented
  2290.   approach to producing html pages which interface to the database. Most
  2291.   pages will consist of several objects. Each object is produced by some
  2292.   sort of tool and given a name, objects are then linked together in a
  2293.   callable sequence by the page tool. Objects are also reusable across
  2294.   multiple pages.  Basic tools exist for HTML, Querys, Grabbing input
  2295.   from forms, Extendable Formatting of Query and Input objects, and
  2296.   Linking together of objects into other objects. More advanced tools
  2297.   include the mail tool and the multithreaded query tool.
  2298.  
  2299.   Another feature of EARP is advanced security. Access to various areas
  2300.   of the EARP system can be limited in a variety of ways. To facilitate
  2301.   its advanced security, EARP performs checks for each connection to the
  2302.   system, determining what ids and groups the connecting agent belongs
  2303.   to. Access to areas is defined seperately, and the combination decides
  2304.   if access to a specific area of Earp is allowed. Moreover, all that is
  2305.   required to implement the security features is an http server that
  2306.   supports basic (or better) user authentication.
  2307.  
  2308.  
  2309.  
  2310.  
  2311.   15.5.  Where to get EARP ?
  2312.  
  2313.   EARP is available via anonymous ftp from
  2314.  
  2315.   ∑  <ftp://ftp.oswego.edu> in the directory 'pub/unix/earp'.
  2316.  
  2317.   16.  PHP 3 Server-side html-embedded scripting language for PostgreSQL
  2318.  
  2319.   WWW Interface Tool is at -
  2320.  
  2321.   ∑  <http://www.php.net>
  2322.  
  2323.   ∑  <http://www.vex.net/php>
  2324.  
  2325.   Old name is Professional Home Pages (PHP 3) and new name is PHP
  2326.   Hypertext Pre-Processor
  2327.  
  2328.   ∑  <http://www.php.org>
  2329.  
  2330.   ∑  Mirror sites are in many countries like www.COUNTRYCODE.php.org
  2331.  
  2332.   ∑  <http://www.fe.de.php.org>
  2333.  
  2334.   ∑  <http://www.sk.php.org>
  2335.  
  2336.   ∑  <http://www.fe.de.php.org>
  2337.  
  2338.   ∑  <http://php.iquest.net/>
  2339.  
  2340.   Questions e-mail to :
  2341.  
  2342.   ∑  rasmus@lerdorf.on.ca
  2343.  
  2344.      PHP 3 is a server-side html-embedded scripting language. It lets
  2345.      you write simple scripts right in your .HTML files much like
  2346.      JavaScript does, except, unlike JavaScript PHP 3 is not browser-
  2347.      dependant. JavaScript is a client-side html-embedded language while
  2348.      PHP 3 is a server-side language. PHP 3 is similar in concept to
  2349.      Netscape's LiveWire Pro product. If you have the money, you run
  2350.      Netscape's Commerce Server and you run one of the supported
  2351.      operating systems, you should probably have a look at LiveWire Pro.
  2352.      If you like free fast-moving software that comes with full source
  2353.      code you will probably like PHP 3.
  2354.  
  2355.   16.1.  Major Features
  2356.  
  2357.   Standard CGI, FastCGI and Apache module Support As a standard CGI
  2358.   program, PHP 3 can be installed on any Unix machine running any Unix
  2359.   web server. With support for the new FastCGI standard, PHP 3 can take
  2360.   advantage of the speed improvements gained through this mechanism. As
  2361.   an Apache module, PHP 3 becomes an extremely powerful and lightning
  2362.   fast alternative to CGI programmimg.
  2363.  
  2364.  
  2365.   ∑  Access Logging With the access logging capabilities of PHP 3, users
  2366.      can maintain their own hit counting and logging. It does not use
  2367.      the system's central access log files in any way, and it provides
  2368.      real-time access monitoring. The Log Viewer Script provides a quick
  2369.      summary of the accesses to a set of pages owned by an individual
  2370.      user. In addition to that, the package can be configured to
  2371.      generate a footer on every page which shows access information. See
  2372.      the bottom of this page for an example of this.
  2373.  
  2374.   ∑  Access Control A built-in web-based configuration screen handles
  2375.      access control configuration. It is possible to create rules for
  2376.      all or some web pages owned by a certain person which place various
  2377.      restrictions on who can view these pages and how they will be
  2378.      viewed. Pages can be password protected, completely restricted,
  2379.      logging disabled and more based on the client's domain, browser, e-
  2380.      mail address or even the referring document.
  2381.  
  2382.   ∑  Postgres Support Postgres is an advanced free RDBMS. PHP 3 supports
  2383.      embedding Postgres95 and PostgreSQL SQL queries directly in .html
  2384.      files.
  2385.  
  2386.  
  2387.   ∑  RFC-1867 File Upload Support File Upload is a new feature in
  2388.      Netscape 2.0. It lets users upload files to a web server. PHP 3
  2389.      provides the actual Mime decoding to make this work and also
  2390.      provides the additional framework to do something useful with the
  2391.      uploaded file once it has been received.
  2392.  
  2393.   ∑  HTTP-based authentication control PHP 3 can be used to create
  2394.      customized HTTP-based authentication mechanisms for the Apache web
  2395.      server.
  2396.  
  2397.   ∑  Variables, Arrays, Associative Arrays PHP 3  supports typed
  2398.      variables, arrays and even Perl-like associative arrays. These can
  2399.      all be passed from one web page to another using either GET or POST
  2400.      method forms.
  2401.  
  2402.   ∑  Conditionals, While Loops PHP 3 supports a full-featured C-like
  2403.      scripting language.  You can have if/then/elseif/else/endif
  2404.      conditions as well as while loops and switch/case statements to
  2405.      guide the logical flow of how the html page should be displayed.
  2406.  
  2407.   ∑  Extended Regular Expressions Regular expressions are heavily used
  2408.      for pattern matching, pattern substitutions and general string
  2409.      manipulation. PHP 3 supports all common regular expression
  2410.      operations.
  2411.  
  2412.   ∑  Raw HTTP Header Control The ability to have web pages send
  2413.      customized raw HTTP headers based on some condition is essential
  2414.      for high-level web site design. A frequent use is to send a
  2415.      Location: URL header to redirect the calling client to some other
  2416.      URL. It can also be used to turn off cacheing or manipulate the
  2417.      last update header of pages.
  2418.  
  2419.   ∑  On-the-fly GIF image creation PHP 3 has support for Thomas
  2420.      Boutell's GD image library which makes it possible to generate GIF
  2421.      images on the fly.
  2422.  
  2423.   ∑  ISP "Safe Mode" support PHP 3 supports a unique "Safe Mode" which
  2424.      makes it safe to have multiple users run PHP scripts on the same
  2425.      server.
  2426.  
  2427.   ∑  It's Free!  One final essential feature. The package is completely
  2428.      free.  It is licensed under the GPL which allows you to use the
  2429.      software for any purpose, commercial or otherwise. See the GNU
  2430.      Public License document for complete details.
  2431.  
  2432.   16.2.  Credits
  2433.  
  2434.   * Large parts of this code were developed at and for the University of
  2435.   Toronto. Many thanks to Lee Oattes of the Network Development
  2436.   Department at the university for constant constructive criticism.
  2437.  
  2438.   * The PostgreSQL support code was written by Adam Sussman
  2439.  
  2440.   ∑  asussman@vidya.com
  2441.  
  2442.  
  2443.   * Countless others have helped test and debug the package.
  2444.  
  2445.   16.3.  PHP 3 - Brief History
  2446.  
  2447.   PHP began life as a simple little cgi wrapper written in Perl. It was
  2448.   never intended to go beyond own private use.  The name of this first
  2449.   package was Personal Home Page Tools, which later became Personal Home
  2450.   Page Construction Kit.
  2451.  
  2452.   A tool was written to easily embed SQL queries into web pages. It was
  2453.   basically another CGI wrapper that parsed SQL queries and made it easy
  2454.   to create forms and tables based on these queries. This tool was named
  2455.   FI (Form Interpreter).
  2456.  
  2457.   PHP/FI version 2.0 is a complete rewrite of these two packages
  2458.   combined into a single program. It has now evolved to the point where
  2459.   it is a simple programming language embedded inside HTML files. The
  2460.   original acronym, PHP, has stuck. It isn't really appropriate any
  2461.   longer. PHP/FI is used more for entire web sites today than for small
  2462.   Personal Home Page setups. By whatever name, it eliminates the need
  2463.   for numerous small Perl cgi programs by allowing you to place simple
  2464.   scripts directly in your HTML files. This speeds up the overall
  2465.   performance of your web pages since the overhead of forking Perl
  2466.   several times has been eliminated. It also makes it easier to manage
  2467.   large web sites by placing all components of a web page in a single
  2468.   html file. By including support for various databases, it also makes
  2469.   it trivial to develop database enabled web pages. Many people find the
  2470.   embedded nature much easier to deal with than trying to create
  2471.   separate HTML and CGI files.
  2472.  
  2473.   Throughout this documentation any references to PHP, FI or PHP/FI all
  2474.   refer to the same thing. The difference between PHP and FI is only a
  2475.   conceptual one. Both are built from the same source distribution. Now
  2476.   PHP/FI is renamed as PHP 3.
  2477.  
  2478.   16.4.  So, what can I do with PHP/FI ?
  2479.  
  2480.   The first thing you will notice if you run a page through PHP/FI is
  2481.   that it adds a footer with information about the number of times your
  2482.   page has been accessed (if you have compiled access logging into the
  2483.   binary). This is just a very small part of what PHP/FI can do for you.
  2484.   It serves another very important role as a form interpreter cgi, hence
  2485.   the FI part of the name. For example, if you create a form on one of
  2486.   your web pages, you need something to process the information on that
  2487.   form. Even if you just want to pass the information to another web
  2488.   page, you will have to have a cgi program do this for you. PHP/FI
  2489.   makes it extremely easy to take form data and do things with it.
  2490.  
  2491.   16.5.  A simple example
  2492.  
  2493.   Suppose you have a form:
  2494.  
  2495.  
  2496.        <FORM ACTION="/cgi-bin/php.cgi/~userid/display.html" METHOD=POST>
  2497.        <INPUT TYPE="text" name="name">
  2498.        <INPUT TYPE="text" name="age">
  2499.        <INPUT TYPE="submit">
  2500.        <FORM>
  2501.  
  2502.  
  2503.  
  2504.  
  2505.   Your display.html file could then contain something like:
  2506.  
  2507.  
  2508.  
  2509.   < ?echo "Hi $ name, you are $ age years old!<p>" >
  2510.  
  2511.  
  2512.  
  2513.  
  2514.   It's that simple! PHP/FI automatically creates a variable for each
  2515.   form input field in your form. You can then use these variables in the
  2516.   ACTION URL file.
  2517.  
  2518.   The next step once you have figured out how to use variables is to
  2519.   start playing with some logical flow tags in your pages. For example,
  2520.   if you wanted to display different messages based on something the
  2521.   user inputs, you would use if/else logic. In our above example, we can
  2522.   display different things based on the age the user entered by changing
  2523.   our display.html to:
  2524.  
  2525.  
  2526.        <?
  2527.            if($age>50);
  2528.                echo "Hi $name, you are ancient!<p>";
  2529.            elseif($age>30);
  2530.                echo "Hi $name, you are very old!<p>";
  2531.            else;
  2532.                echo "Hi $name.";
  2533.            endif;
  2534.        >
  2535.  
  2536.  
  2537.  
  2538.  
  2539.   PHP/FI provides a very powerful scripting language which will do much
  2540.   more than what the above simple example demonstrates. See the section
  2541.   on the PHP/FI Script Language for more information.
  2542.  
  2543.   You can also use PHP/FI to configure who is allowed to access your
  2544.   pages.  This is done using a built-in configuration screen. With this
  2545.   you could for example specify that only people from certain domains
  2546.   would be allowed to see your pages, or you could create a rule which
  2547.   would password protect certain pages. See the Access Control section
  2548.   for more details.
  2549.  
  2550.   PHP/FI is also capable of receiving file uploads from any RFC-1867
  2551.   compliant web browser. This feature lets people upload both text and
  2552.   binary files. With PHP/FI's access control and logical functions, you
  2553.   have full control over who is allowed to upload and what is to be done
  2554.   with the file once it has been uploaded. See the File Upload section
  2555.   for more details.
  2556.  
  2557.   PHP/FI has support for the PostgreSQL database package. It supports
  2558.   embedded SQL queries in your .HTML files. See the section on
  2559.   PostgreSQL Support for more information.
  2560.  
  2561.   PHP/FI also has support for the mysql database package. It supports
  2562.   embedded SQL queries in your .HTML files. See the section on mysql
  2563.   Support for more information.
  2564.  
  2565.   16.6.  CGI Redirection
  2566.  
  2567.  
  2568.   16.6.1.  Apache 1.0.x Notes
  2569.  
  2570.   A good way to run PHP/FI is by using a cgi redirection module with the
  2571.   Apache server. Please note that you do not need to worry about
  2572.   redirection modules if you are using the Apache module version of
  2573.   PHP/FI. There are two of these redirection modules available. One is
  2574.   developed by Dave Andersen
  2575.   ∑  angio@aros.net
  2576.  
  2577.      and it is available at
  2578.  
  2579.   ∑  <ftp://ftp.aros.net/pub/util/apache/mod_cgi_redirect.c>
  2580.  
  2581.      and the other comes bundled with Apache and is called
  2582.      mod_actions.c. The modules are extremely similar. They differ
  2583.      slightly in their usage. Both have been tested and both work with
  2584.      PHP/FI.
  2585.  
  2586.   Check the Apache documentation on how to add a module. Generally you
  2587.   add the module name to a file called Configuration. The line to be
  2588.   added if you want to use the mod_actions module is:
  2589.  
  2590.   Module action_module mod_actions.o
  2591.  
  2592.   If you are using the mod_cgi_redirect.c module add this line:
  2593.  
  2594.   Module cgi_redirect_module mod_cgi_redirect.o
  2595.  
  2596.   Then compile your httpd and install it. To configure the cgi
  2597.   redirection you need to either create a new mime type in your
  2598.   mime.types file or you can use the AddType command in your srm.conf
  2599.   file to add the mime type. The mime type to be added should be
  2600.   something like this:
  2601.  
  2602.  
  2603.             application/x-httpd-php phtml
  2604.  
  2605.  
  2606.  
  2607.  
  2608.   If you are using the mod_actions.c module you need to add the follow≠
  2609.   ing line to your srm.conf file:
  2610.  
  2611.  
  2612.             Action application/x-httpd-php /cgi-bin/php.cgi
  2613.  
  2614.  
  2615.  
  2616.  
  2617.   If you are using mod_cgi_redirect.c you should add this line to
  2618.   srm.conf:
  2619.  
  2620.  
  2621.             CgiRedirect application/x-httpd-php /cgi-bin/php.cgi
  2622.  
  2623.  
  2624.  
  2625.  
  2626.   Don't try to use both mod_actions.c and mod_cgi_redirect.c at the same
  2627.   time.
  2628.  
  2629.   Once you have one of these cgi redirection modules installed and
  2630.   configured correctly, you will be able to specify that you want a file
  2631.   parsed by php/fi simply by making the file's extension .phtml.
  2632.   Furthermore, if you add index.phtml to your DirectoryIndex
  2633.   configuration line in your srm.conf file then the top-level page in a
  2634.   directory will be automatically parsed by php if your index file is
  2635.   called index.phtml.
  2636.  
  2637.   16.6.2.  Netscape HTTPD
  2638.  
  2639.   You can automatically redirect requests for files with a given
  2640.   extension to be handled by PHP/FI by using the Netscape Server CGI
  2641.   Redirection module. This module is available in the File Archives on
  2642.   the PHP/FI Home Page. The README in the package explicitly explains
  2643.   how to configure it for use with PHP/FI.
  2644.  
  2645.   16.6.3.  NCSA HTTPD
  2646.  
  2647.   NCSA does not currently support modules, so in order to do cgi
  2648.   redirection with this server you need to modify your server source
  2649.   code. A patch to do this with NCSA 1.5 is available in the PHP/FI file
  2650.   archives.
  2651.  
  2652.   16.7.  Running PHP/FI from the command line
  2653.  
  2654.   If you build the CGI version of PHP/FI, you can use it from the
  2655.   command line simply typing: php.cgi filename where filename is the
  2656.   file you want to parse. You can also create standalone PHP/FI scripts
  2657.   by making the first line of your script look something like:
  2658.  
  2659.  
  2660.            #!/usr/local/bin/php.cgi -q
  2661.  
  2662.  
  2663.  
  2664.  
  2665.   The "-q" suppresses the printing of the HTTP headers. You can leave
  2666.   off this option if you like.
  2667.  
  2668.   17.  Python Interface for PostgreSQL
  2669.  
  2670.   Python in an interpreted, object orientated scripting language.  It is
  2671.   simple to use (light syntax, simple and straighforward statements),
  2672.   and has many extensions for building GUIs, interfacing with WWW, etc.
  2673.   An intelligent web browser (HotJava like) is currently under
  2674.   development (november 1995), and this should open programmers many
  2675.   doors. Python is copyrighted by Stichting S Mathematisch Centrum,
  2676.   Amsterdam, The Netherlands, and is freely distributable.  It contains
  2677.   support for dynamic loading of objects, classes, modules, and
  2678.   exceptions.  Adding interfaces to new system libraries through C code
  2679.   is straightforward, making Python easy to use in custom settings.
  2680.   Python is a very high level scripting language with X interface.
  2681.   Python package is distributed on Linux cdroms includes most of the
  2682.   standard Python modules, along with modules for interfacing to the Tix
  2683.   widget set for Tk.
  2684.  
  2685.   PyGreSQL is a python module that interfaces to a PostgreSQL database.
  2686.   It embeds the PostgreSQL query library to allow easy use of the
  2687.   powerful PostgreSQL features from a Python script.  PyGreSQL is
  2688.   written by D'Arcy J.M. Cain and Pascal Andre.
  2689.  
  2690.   ∑  New site of PyGreSQL  <http://www.druid.net/pygresql/>
  2691.  
  2692.   ∑  Maintained by D'Arcy at  <http://www.druid.net/~darcy/>
  2693.  
  2694.   ∑  Old site is at
  2695.      <ftp://ftp.via.ecp.fr/pub/python/contrib/Database/PyGres95.README >
  2696.  
  2697.   ∑  D'Arcy J.M. Cain darcy@druid.net
  2698.  
  2699.   ∑  Pascal Andre andre@chimay.via.ecp.fr
  2700.  
  2701.   ∑  Pascal Andre andre@via.ecp.fr
  2702.  
  2703.  
  2704.  
  2705.  
  2706.  
  2707.   17.1.  Where to get PyGres ?
  2708.  
  2709.   The home sites of the differents packages are:
  2710.  
  2711.   ∑  Python
  2712.      <ftp://ftp.python.org:/pub/www.python.org/1.5/python1.5b2.tar.gz>
  2713.  
  2714.   ∑  PyGreSQL  <ftp://ftp.druid.net/pub/distrib/PyGreSQL-2.1.tgz>
  2715.  
  2716.   ∑  Old site
  2717.      <ftp://ftp.via.ecp.fr/pub/python/contrib/Database/PyGres95-1.0b.tar.gz
  2718.      >
  2719.  
  2720.      You should anyway try to find some mirror site closer of your site.
  2721.      Refer to the information sources to find these sites. PyGreSQL
  2722.      should reside in the contrib directories of Python and PostgreSQL
  2723.      sites.
  2724.  
  2725.   17.2.  Information and support
  2726.  
  2727.   If you need information about these packages please check their web
  2728.   sites:
  2729.  
  2730.   ∑  Python :      <http://www.python.org/>
  2731.  
  2732.   ∑  PostgreSQL :
  2733.      <http://epoch.cs.berkeley.edu:8000/postgres95/index.html>
  2734.  
  2735.   ∑  PyGreSQL  <ftp://ftp.druid.net/pub/distrib/PyGreSQL-2.1.tgz>
  2736.  
  2737.   ∑  Old site PyGreSQL :
  2738.      <http://www.via.ecp.fr/via/products/pygres.html>
  2739.  
  2740.   For support :
  2741.  
  2742.   ∑  Mailing list for PyGreSQL. You can join by sending email to
  2743.      majordomo@vex.net with the line "subscribe pygresql name@domain" in
  2744.      the body replacing "name@domain" with your own email address.
  2745.  
  2746.   ∑  Newsgroup for Python :     newsgroup comp.lang.python
  2747.  
  2748.   ∑  PyGreSQL :   contact Andre at andre@via.ecp.fr for bug reports,
  2749.      ideas, remarks
  2750.  
  2751.   18.  Gateway between PostgreSQL and the WWW - WDB-P95
  2752.  
  2753.  
  2754.   18.1.  About wdb-p95
  2755.  
  2756.   WDB-P95 - A Web interface to PostgreSQL Databases was created by J.
  2757.   Douglas Dunlop It is at
  2758.  
  2759.   ∑  New WDB from J Rowe is at
  2760.      <http://www.lava.net/beowulf/programming/wdb>
  2761.  
  2762.   ∑  New versions of WWW-WDB is at  <http://www.eol.ists.ca/~dunlop/wdb-
  2763.      p95/>
  2764.  
  2765.   ∑  For questions or to join Mailing lists contact dunlop@eol.ists.ca
  2766.  
  2767.      This is a modified version of wdb-1.3a2 which provides a gateway to
  2768.      a the WWW for PostgreSQL. This version also requires a Browser that
  2769.      is capable of handling HTML Tables for the tabular output. This is
  2770.      not required by the original wdb and can be fairly easily reverted.
  2771.  
  2772.  
  2773.   You can try out CASI Tape and Image Query. You can have a peek at the
  2774.   Form Definition File (FDF) which is used to create the CASI Tape and
  2775.   Image Query too, which includes a JOIN of 2 tables.
  2776.  
  2777.   This release contains all files necessary to install and run WDB-P95
  2778.   as an interface to your PostgreSQL databases. To port this system to
  2779.   other database should be relatively easy - provided that it supports
  2780.   standard SQL and has a Perl interface.
  2781.  
  2782.   18.2.  Does the PostgreSQL server, pgperl, and httpd have to be on the
  2783.   same host?
  2784.  
  2785.   No - the PostgreSQL server does not have to be on the same host. As
  2786.   WDB-P95 is called by the http daemon, they have to be on the same
  2787.   host. - And as WDB-P95 was written to use Pg.pm - pgperl has to be on
  2788.   the same host too.  Pgperl was written using the libpq library, so it
  2789.   will be able to access any PostgreSQL server anywhere in the net, just
  2790.   like any other PostgreSQL client. As illustrated below
  2791.  
  2792.   (WWW Client (Netscape)) => (HTTP Server (NCSA's http) + WDB-P95 +
  2793.   pgperl + libpq)=> (PostgreSQL server)
  2794.  
  2795.   Curly brackets () represent machines.
  2796.  
  2797.   Each machine can be of a different type : NT, SUN, HP, ... but you
  2798.   need the libpq interface library for the machine type where you plan
  2799.   to use WDB-P95, as you need it to compile pgperl. (The system was
  2800.   designed to use HTML tables so a recent WWW client is best)
  2801.  
  2802.   19.  "C", "C++", ESQL/C language Interfaces and Bitwise Operators for
  2803.   PostgreSQL
  2804.  
  2805.  
  2806.   19.1.  "C" interface
  2807.  
  2808.   It is included in distribution and is called 'libpq'. Similar to
  2809.   Oracle OCI, Sybase DB-lib, Informix CLI libraries.
  2810.  
  2811.  
  2812.   19.2.  "C++" interface
  2813.  
  2814.   It is included in distribution and is called 'libpq++'.
  2815.  
  2816.  
  2817.   19.3.  ESQL/C
  2818.  
  2819.   ESQL/C 'Embedded C Pre-compiler' for PostgreSQL ESQL/C is like Oracle
  2820.   Pro*C, Informix ESQL/C.  The PostgreSQL ESQL/C is an SQL application-
  2821.   programming interface (API) enables the C programmer to create custom
  2822.   applications with database-management capabilities. The PostgreSQL
  2823.   ESQL/C allows you to use a third-generation language with which you
  2824.   are familiar and still take advantage of the Structured Query Language
  2825.   (SQL).
  2826.  
  2827.   ESQL/C consists of the following pieces of software:
  2828.  
  2829.   ∑  The ESQL/C libraries of C functions provide access to the database
  2830.      server.
  2831.  
  2832.   ∑  The ESQL/C header files provide definitions for the data
  2833.      structures, constants, and macros useful to the ESQL/C program.
  2834.  
  2835.   ∑  The ESQL/C preprocessor, is a source-code preprocessor that
  2836.      converts a C file containing SQL statements into an executable
  2837.      file.
  2838.  
  2839.      It is at
  2840.  
  2841.   ∑  ESQL/C for PostgreSQL is already included in the distribution.
  2842.  
  2843.   ∑  Main site  <ftp://ftp.lysator.liu.se/pub/linus>
  2844.  
  2845.   ∑  Email : linus@epact.se
  2846.  
  2847.   19.4.  BitWise Operators for PostgreSQL
  2848.  
  2849.   Bitwise operators was written by Nicolas Moldavsky
  2850.  
  2851.   ∑  nico@overnet.com.ar
  2852.  
  2853.      "C" functions that implement bitwise operators (AND, OR, XOR, bit
  2854.      complement) on pgsql. Get them by anonymous FTP from
  2855.  
  2856.   ∑  <ftp://ftp.overnet.com.ar/pub/utils/linux/bitpgsql.tgz>
  2857.  
  2858.      Makefile for Linux is included.
  2859.  
  2860.   20.  Japanese Kanji Code for PostgreSQL
  2861.  
  2862.   It is at the following site
  2863.  
  2864.   ∑  <ftp://ftp.sra.co.jp/pub/cmd/postgres/>
  2865.  
  2866.   21.  PostgreSQL Port to Windows 95/Windows NT
  2867.  
  2868.   Port to Windows 95/Windows NT is underway.  Porting is being done
  2869.   using gcc, gmake for Win NT/95. To compile source code on win32 gnu-
  2870.   win32 program is used.  GNU gcc is available for win32. Check this
  2871.   site -
  2872.  
  2873.   ∑  <http://www.cygnus.com/misc/gnu-win32>
  2874.  
  2875.      At this site and get the file cdk.exe (self-extractor file for gnu-
  2876.      win32)
  2877.  
  2878.   Porting can also be done using the following "Unix-Emulator on NT"
  2879.   tool from
  2880.  
  2881.   ∑  <http://www.softway.com>
  2882.  
  2883.   22.  Mailing Lists and Newsgroups
  2884.  
  2885.  
  2886.   22.1.  Newsgroups
  2887.  
  2888.   There is newsgroup for PostgreSQL at news.postgresql.org Please follow
  2889.   these steps to subscribe
  2890.  
  2891.  
  2892.        1. Choose Window | Netscape News
  2893.        2. Choose File | Open News Host
  2894.        3. Type news.postgresql.org in the edit box.
  2895.        4. The name of the newsgroup is comp.databases.postgresql.questions.
  2896.        To add right-click on news.postgresql.org, and choose Add Newsgroup.
  2897.        Then type the newsgroup into the edit box. The newsgroup will be added
  2898.        to the list in the left hand pane.
  2899.        5. Newsgroups will be listed in the left hand pane. Any messages in
  2900.        the selected newsgroup will appear in the right hand pane.
  2901.  
  2902.  
  2903.  
  2904.  
  2905.   22.2.  Get a Free e-mail account
  2906.  
  2907.   Check out the free deals offered - get free e-mail accounts from
  2908.  
  2909.   ∑  In Yahoo  <http://www.yahoo.com> click on e-mail
  2910.  
  2911.   ∑  In Lycos  <http://www.lycos.com> click on new e-mail accounts
  2912.  
  2913.   ∑  In hotmail  <http://www.hotmail.com> click on new e-mail accounts
  2914.  
  2915.      Subscribe to PostgreSQL mailing list and Yahoo has additional
  2916.      feature of creating a seperate folder for PostgreSQL e-mails, so
  2917.      that your regular e-mail is not cluttered. Select menu Email- >
  2918.      Options- > Filters and pick seperate folder for email.  With this
  2919.      e-mail account you can access mail from anywhere in the world as
  2920.      long as you have access to a web page.
  2921.  
  2922.   If you have any other e-mail, you can use "Mail Filters" to receive
  2923.   automatically the PostgreSQL mails into a seperate folder. This will
  2924.   avoid mail cluttering.
  2925.  
  2926.   22.3.  English Mailing List
  2927.  
  2928.   See the Mailing Lists Item on the main web page at :
  2929.  
  2930.   ∑  <http://www.postgresql.org/>
  2931.  
  2932.   ∑  Email questions to: pgsql-questions@postgresql.org
  2933.  
  2934.   ∑  Developers pgsql-hackers@postgresql.org
  2935.  
  2936.   ∑  Port specific questions pgsql-ports@postgresql.org
  2937.  
  2938.   ∑  Documentation questions pgsql-docs@postgresql.org
  2939.  
  2940.      You will get the answers/replies back by e-mail in less than a
  2941.      day!!
  2942.  
  2943.   You can also subscribe to mailing lists.  See also the section 'Get a
  2944.   Free e-mail account' above.  To subscribe or unsubscribe from the
  2945.   list, send mail to
  2946.  
  2947.   ∑  pgsql-questions-request@postgresql.org
  2948.  
  2949.   ∑  pgsql-hackers-request@postgresql.org
  2950.  
  2951.   ∑  pgsql-ports-request@postgresql.org
  2952.  
  2953.   ∑  pgsql-docs-request@postgresql.org
  2954.  
  2955.      The body of the message should contain the single line
  2956.  
  2957.   subscribe
  2958.  
  2959.   (or)
  2960.  
  2961.   unsubscribe
  2962.  
  2963.   22.4.  Archive of Mailing List
  2964.  
  2965.   Also mailing lists are archived in html format at the following
  2966.   location -
  2967.  
  2968.   ∑  Date-wise listing available via MHonarc via the WWW at
  2969.      <http://www.postgresql.org/mhonarc/pgsql-questions>
  2970.  
  2971.   ∑  <ftp://ftp.postgresql.org> directory is /pub/majordomo
  2972.  
  2973.   22.5.  Spanish Mailing List
  2974.  
  2975.   Now there is an "unofficial" list of postgreSQL in Spanish.  See also
  2976.   the section 'Free Account to Organise your PostgreSQL e-mails' above.
  2977.   To subscribe the user has to send a message to:
  2978.  
  2979.   ∑  majordomo@tlali.iztacala.unam.mx
  2980.  
  2981.      The body of the message should contain the single line:
  2982.  
  2983.   inscripcion pgsql-ayuda
  2984.  
  2985.   23.  Documentation and Reference Books
  2986.  
  2987.  
  2988.   23.1.  User Guides and Manuals
  2989.  
  2990.   The following are included in the PostgreSQL distribution in the
  2991.   postscript format and unix man-pages.  If you have access to internet,
  2992.   you can find the documents listed below at
  2993.   <http://www.postgresql.org/docs>
  2994.  
  2995.  
  2996.   ∑  "Installation Guide"
  2997.  
  2998.   ∑  "User Guide" for PostgreSQL
  2999.  
  3000.   ∑  "Implementation Guide" detailing database internals of PostgreSQL.
  3001.  
  3002.   ∑  Online manuals.
  3003.  
  3004.   ∑  Online manuals in HTML formats.
  3005.  
  3006.   ∑  Also manuals in Postscript format for printing hard copies.
  3007.  
  3008.   23.2.  Online Documentation
  3009.  
  3010.  
  3011.   ∑  Listing and description of default data types and operators
  3012.  
  3013.  
  3014.        Is a a part of PSQL command in the release 6.3.
  3015.  
  3016.  
  3017.  
  3018.  
  3019.   ∑  Listing of supported SQL keywords
  3020.  
  3021.  
  3022.        There is a script in the /tools directory to do that
  3023.  
  3024.  
  3025.  
  3026.  
  3027.   ∑  Listings of supported statements -
  3028.  
  3029.  
  3030.        Use the command psql \h
  3031.  
  3032.  
  3033.  
  3034.  
  3035.   ∑  Basic relational database concepts under PostgreSQL
  3036.      (implementation) and several online examples (queries) -
  3037.        Look at the regression tests at src/test. There you can find the directories
  3038.        regress/sql and suite/*.sql.
  3039.  
  3040.  
  3041.  
  3042.  
  3043.   ∑  Tutorial for PostgreSQL.
  3044.  
  3045.  
  3046.        SQL tutorial scripts is in the directory src/tutorial
  3047.  
  3048.  
  3049.  
  3050.  
  3051.   See also "SQL Tutorial for beginners" in Appendix B of this document
  3052.   ``''
  3053.  
  3054.   23.3.  Useful Reference Textbooks
  3055.  
  3056.  
  3057.   ∑  "Understanding the New SQL: A Complete Guide" - by Jim Melton and
  3058.      Alan R.Simon
  3059.  
  3060.  
  3061.        Morgan Kaufman Publisher is one of best SQL books. This deals with SQL92.
  3062.  
  3063.  
  3064.  
  3065.  
  3066.   ∑  "A Guide to THE SQL STANDARD" - by C.J.Date
  3067.  
  3068.  
  3069.        Addison-Wesley Publishing company is also a good book. Very popular book for SQL.
  3070.  
  3071.  
  3072.  
  3073.  
  3074.   ∑  SQL - The Standard Handbook,  November 1992
  3075.  
  3076.  
  3077.        Stephen Cannan and Gerard Otten
  3078.        McGraw-Hill Book Company Europe , Berkshire, SL6 2QL, England
  3079.  
  3080.  
  3081.  
  3082.  
  3083.   ∑  SQL Instant Reference, 1993
  3084.  
  3085.  
  3086.        Martin Gruber, Technical Editor: Joe Celko
  3087.        SYBEX Inc.  2021 Challenger Drive Alameda, CA 94501
  3088.  
  3089.  
  3090.  
  3091.  
  3092.   ∑  C.J.Date, "An introduction to Database Systems" (6th Edition),
  3093.      Addison-Wesley, 1995, ISBN 0-201-82458-2
  3094.  
  3095.  
  3096.        This book is the Bible of Database Management Systems.
  3097.        The book details normalization, SQL, recovery, concurrency, security,
  3098.        integrity, and extensions to the original relational model, current issues
  3099.        like client/server systems and the Object Oriented model(s). Many
  3100.        references are included for further reading. Recommended for most users.
  3101.  
  3102.  
  3103.   ∑  Stefan Stanczyk, "Theory and Practice of Relational Databases", UCL
  3104.      Press Ltd, 1990, ISBN 1-857-28232-9
  3105.  
  3106.  
  3107.        Book details theory of relational databases, relational algebra, calculus
  3108.        and normalisation. But it does not cover real world issues and examples
  3109.        beyond simple examples. Recommended for most users.
  3110.  
  3111.  
  3112.  
  3113.  
  3114.   ∑  "The Practical SQL Handbook" Third Edition, Addison Wesley
  3115.      Developers Press ISBN 0-201-44787-8
  3116.  
  3117.  
  3118.        Recommended for most users.
  3119.  
  3120.  
  3121.  
  3122.  
  3123.   ∑  Michael Stonebraker, "Readings in Database Systems", Morgan
  3124.      Kaufmann, 1988, ISBN 0-934613-65-6
  3125.  
  3126.  
  3127.        This book is a collection of papers that have been published over the
  3128.        years on databases. It's not for the casual user but it is really a
  3129.        reference for advanced (post-graduate) students or database system
  3130.        developers.
  3131.  
  3132.  
  3133.  
  3134.  
  3135.   ∑  C.J.Date, "Relational Database - Selected Readings", Addison-
  3136.      Wesley, 1986, ISBN 0-201-14196-5
  3137.  
  3138.  
  3139.        This book is a collection of papers that have been published over the
  3140.        years on databases. It's not for the casual user but it is really a
  3141.        reference for advanced (post-graduate) students or database system
  3142.        developers.
  3143.  
  3144.  
  3145.  
  3146.  
  3147.   ∑  Nick Ryan and Dan Smith, "Database Systems Engineering",
  3148.      International Thomson Computer Press, 1995, ISBN 1-85032-115-9
  3149.  
  3150.  
  3151.        This book goes into the details of access methods, storage techniques.
  3152.  
  3153.  
  3154.  
  3155.  
  3156.   ∑  Bipin C. Desai, "An introduction to Database Systems", West
  3157.      Publishing Co., 1990, ISBN 0-314-66771-7
  3158.  
  3159.  
  3160.        It's not for the casual user but it is for advanced (post-graduate)
  3161.        students or database system developers.
  3162.  
  3163.  
  3164.  
  3165.  
  3166.   ∑  Joe Celko "INSTANT SQL Programming"
  3167.  
  3168.  
  3169.   Wrox Press Ltd.
  3170.   Unit 16, 20 James Road, Tyseley
  3171.   Birmingham, B11 2BA, England
  3172.   1995
  3173.  
  3174.  
  3175.  
  3176.  
  3177.   ∑  Michael Gorman "Database Management Systems: Understanding and
  3178.      Applying Database"
  3179.  
  3180.  
  3181.        Technology
  3182.        QED and John Wiley
  3183.        1991
  3184.  
  3185.  
  3186.  
  3187.  
  3188.   ∑  Michael Gorman "Enterprise Database for a Client/Server
  3189.      Environment" QED and John Wiley
  3190.  
  3191.  
  3192.        Presents the requirements of building client/server database
  3193.        applications via repository metamodels and the use of ANSI standard SQL
  3194.        1993
  3195.  
  3196.  
  3197.  
  3198.  
  3199.   Hundreds of other titles on SQL are available! Check out a bookstore.
  3200.  
  3201.   23.4.  ANSI/ISO SQL Specifications documents  - SQL 1992, SQL 1998
  3202.  
  3203.   ANSI/ISO SQL specifications documents can be found at these sites
  3204.   listed below -
  3205.  
  3206.   ∑  <http://www.naiua.org/std-orgs.html>
  3207.  
  3208.   ∑  <http://www.ansi.org/docs> and click on file cat_c.html and search
  3209.      with "Database SQL"
  3210.  
  3211.   ∑  SQL92 standard  <http://www.jcc.com> and click on file
  3212.      sql_stnd.html
  3213.  
  3214.   ∑  ANSI/ISO SQL specifications
  3215.      <http://www.contrib.andrew.cmu.edu/~shadow/sql.html> You will find
  3216.      SQL Reference here.
  3217.  
  3218.   23.5.  Syntax of ANSI/ISO SQL 1992
  3219.  
  3220.   See Appendix A of this document ``''
  3221.  
  3222.   23.6.  Syntax of ANSI/ISO SQL 1998
  3223.  
  3224.   The SQL 1998 (SQL 3) specification is still under development.  See
  3225.   'Electronic Access to the SQL3 Working Draft' of this document at ``''
  3226.  
  3227.   23.7.  SQL Tutorial for beginners
  3228.  
  3229.   See Appendix B of this document ``''
  3230.  
  3231.   23.8.  Temporal Extension to SQL92
  3232.  
  3233.  
  3234.  
  3235.   ∑  Document for Temporal Extension to SQL-92
  3236.      <ftp://FTP.cs.arizona.edu/tsql/tsql2/>
  3237.  
  3238.   ∑  Temporal SQL-3 specification
  3239.      <ftp://FTP.cs.arizona.edu/tsql/tsql2/sql3/>
  3240.  
  3241.   This directory contains the language specification for a temporal
  3242.   extension to the SQL-92 language standard. This new language is
  3243.   designated TSQL2.
  3244.  
  3245.   The language specification present here is the final version of the
  3246.   language.
  3247.  
  3248.   Correspondence may be directed to the chair of the TSQL2 Language
  3249.   Design Committee, Richard T.Snodgrass, Department of Computer Science,
  3250.   University of Arizona, Tucson, AZ 85721,
  3251.  
  3252.   ∑  rts@cs.arizona.edu
  3253.  
  3254.      The affiliations and e-mail addresses of the TSQL2 Language Design
  3255.      Committee members may be found in a separate section at the end of
  3256.      the language specification.
  3257.  
  3258.   The contents of this directory are as follows.
  3259.  
  3260.   spec.dvi,.ps    TSQL2 Language Specification, published in September,
  3261.   1994
  3262.  
  3263.   bookspec.ps     TSQL2 Language Specification, as it appears in the
  3264.   TSQL2 book, published in September, 1995 (see below).
  3265.  
  3266.   sql3            change proposals submitted to the ANSI and ISO SQL3
  3267.   committees.
  3268.  
  3269.   Associated with the language specification is a collection of
  3270.   commentaries which discuss design decisions, provide examples, and
  3271.   consider how the language may be implemented. These commentaries were
  3272.   originally proposals to the TSQL2 Language Design Committee. They now
  3273.   serve a different purpose: to provide examples of the constructs,
  3274.   motivate the many decisions made during the language design, and
  3275.   compare TSQL2 with the many other language proposals that have been
  3276.   made over the last fifteen years. It should be emphasized that these
  3277.   commentaries are not part of the TSQL2 language specification per se,
  3278.   but rather supplement and elaborate upon it. The language
  3279.   specification proper is the final word on TSQL2.
  3280.  
  3281.   The commentaries, along with the language specification, several
  3282.   indexes, and other supporting material, has been published as a book:
  3283.  
  3284.   Snodgrass, R.T., editor, The TSQL2 Temporal Query Language, Kluwer
  3285.   Academic Publishers, 1995, 674+xxiv pages.
  3286.  
  3287.   The evaluation commentary appears in the book in an abbreviated form;
  3288.   the full commentary is provided in this directory as file eval.ps
  3289.  
  3290.   The file tl2tsql2.pl is a prolog program that tranlates allowed
  3291.   temporal logic to TSQL2. This program was written by Michael Boehlen
  3292.  
  3293.   ∑  boehlen@iesd.auc.dk
  3294.  
  3295.      He may be contacted for a paper that describes this translation.
  3296.      This is a rather dated version of that program. Newer versions are
  3297.      available at
  3298.  
  3299.   ∑  <http://www.cs.auc.dk/general/DBS/tdb/TimeCenter/Software>
  3300.  
  3301.      (the TimeDB and Tiger systems).
  3302.  
  3303.   23.9.  Part 0 - Acquiring ISO/ANSI SQL Documents
  3304.  
  3305.   This document shows you how to (legally) acquire a copy of the SQL-92
  3306.   standard and how to acquire a copy of the "current" SQL3 Working
  3307.   Draft.
  3308.  
  3309.   The standard is copyrighted ANSI standard by ANSI, the ISO standard by
  3310.   ISO.
  3311.  
  3312.   There are two (2) current SQL standards, an ANSI publication and an
  3313.   ISO publication. The two standards are word-for-word identical except
  3314.   for such trivial matters as the title of the document, page headers,
  3315.   the phrase "International Standard" vs "American Standard", and so
  3316.   forth.
  3317.  
  3318.   Buying the SQL-92 Standard
  3319.  
  3320.   The ISO standard, ISO/IEC 9075:1992, Information Technology - Database
  3321.   Languages - SQL, is currently (March, 1993) available and in stock
  3322.   from ANSI at:
  3323.  
  3324.  
  3325.             American National Standards Institute
  3326.             1430 Broadway
  3327.             New York, NY 10018 (USA)
  3328.             Phone (sales): +1.212.642.4900
  3329.  
  3330.  
  3331.  
  3332.  
  3333.   at a cost of US$230.00. The ANSI version, ANSI X3.135-1992, American
  3334.   National Standard for Information Systems - Database Language SQL, was
  3335.   not available from stock at this writing, but was expected to be
  3336.   available by some time between late March and early May, 1993). It is
  3337.   expected to be be priced at US$225.00.
  3338.  
  3339.   If you purchase either document from ANSI, it will have a handling
  3340.   charge of 7% added to it (that is, about US$9.10). Overseas shipping
  3341.   charges will undoubtedly add still more cost. ANSI requires a hardcopy
  3342.   of a company purchase order to accompany all orders; alternately, you
  3343.   can send a check drawn on a US bank in US dollars, which they will
  3344.   cash and clear before shipping your order. (An exception exists: If
  3345.   your organization is a corporate member of ANSI, then ANSI will ship
  3346.   the documents and simply bill your company.)
  3347.  
  3348.   The ISO standard is also available outside the United States from
  3349.   local national bodies (country standardization bodies) that are
  3350.   members of either ISO (International Organization for Standardization)
  3351.   or IEC (International Electrotechnical Commission). Copies of the list
  3352.   of national bodies and their addresses are available from ANSI or from
  3353.   other national bodies. They are also available from ISO:
  3354.  
  3355.  
  3356.             International Organization for Standardization
  3357.             Central Secretariat
  3358.             1, rue de Varembi
  3359.             CH-1211 Genhve 20
  3360.             Switzerland
  3361.  
  3362.  
  3363.  
  3364.  
  3365.   If you prefer to order the standard in a more convenient and quick
  3366.   fashion, you'll have to pay for the privilege. You can order ISO/IEC
  3367.   9075:1992, Information Technology - Database Languages - SQL, from:
  3368.  
  3369.  
  3370.             Global Engineering Documents
  3371.             2805 McGaw Ave
  3372.             Irvine, CA 92714 (USA)
  3373.             USA
  3374.             Phone (works from anywhere): +1.714.261.1455
  3375.             Phone (only in the USA): (800)854-7179
  3376.  
  3377.  
  3378.  
  3379.  
  3380.   for a cost of US$308.00. I do not know if that includes shipping or
  3381.   not, but I would guess that international shipping (at least) would
  3382.   cost extra. They will be able to ship you a document fairly quickly
  3383.   and will even accept "major credit cards". Global does not yet have
  3384.   the ANSI version nor do they have a price or an expected date (though
  3385.   I would expect it within a few weeks following the publication by ANSI
  3386.   and at a price near US$300.00).
  3387.  
  3388.   Buying a copy of the SQL3 Working Draft
  3389.  
  3390.   You can purchase a hardcopy of the SQL3 working draft from the ANSI X3
  3391.   Secretariat, CBEMA (Computer and Business Equipment Manufacturers
  3392.   Association). They intend to keep the "most recent" versions of the
  3393.   SQL3 working draft available and sell them for about US$60.00 to
  3394.   US$65.00.  You can contact CBEMA at:
  3395.  
  3396.  
  3397.             CBEMA, X3 Secretariat
  3398.             Attn: Lynn Barra
  3399.             1250 Eye St.
  3400.             Suite 200
  3401.             Washington, DC 20005 (USA)
  3402.  
  3403.  
  3404.  
  3405.  
  3406.   Lynn Barra can also be reached by telephone at +1.202.626.5738 to
  3407.   request a copy, though mail is probably more courteous.
  3408.  
  3409.   Electronic Access to the SQL3 Working Draft
  3410.  
  3411.   The most recent version (as of the date of this writing) of the SQL3
  3412.   (both ANSI and ISO) working draft (and all of its Parts) is available
  3413.   by "anonymous ftp" or by "ftpmail" on:
  3414.  
  3415.  
  3416.             gatekeeper.dec.com
  3417.  
  3418.          at
  3419.  
  3420.             /pub/standards/sql/
  3421.  
  3422.  
  3423.  
  3424.  
  3425.   In this directory are a number of files.  There are PostScript. files
  3426.   and "plain text" (not prettily formatted, but readable on a screen
  3427.   without special software).
  3428.  
  3429.   In general, you can find files with names like:
  3430.  
  3431.  
  3432.  
  3433.        sql-bindings-mar94.ps
  3434.        sql-bindings-mar94.txt
  3435.        sql-cli-mar94.ps
  3436.        sql-cli-mar94.txt
  3437.        sql-foundation-mar94.ps
  3438.        sql-foundation-mar94.txt
  3439.        sql-framework-mar94.ps
  3440.        sql-framework-mar94.txt
  3441.        sql-psm-mar94.ps
  3442.        sql-psm-mar94.txt
  3443.  
  3444.  
  3445.  
  3446.  
  3447.   As new versions of the documents are produced, the "mar94" will change
  3448.   to indicate the new date of publication (e.g., "aug94" is the expected
  3449.   date of the next publication after "mar94").
  3450.  
  3451.   In addition, for those readers unable to get a directory listing by
  3452.   FTP, we have placed a file with the name:
  3453.  
  3454.  
  3455.             ls
  3456.  
  3457.  
  3458.  
  3459.  
  3460.   into the same directory.  This file (surprise!) contains a directory
  3461.   listing of the directory.
  3462.  
  3463.   Retrieving Files Directly Using ftp
  3464.  
  3465.   This is a sample of how to use FTP. Specifically, it shows how to
  3466.   connect to gatekeeper.dec.com, get to the directory where the base
  3467.   document is kept, and transfer the document to your host. Note that
  3468.   your host must have Internet access to do this. The login is 'ftp' and
  3469.   the password is your email address (this is sometimes referred to as
  3470.   bits are stripped from the file(s) received. 'get' gets one file at a
  3471.   time. Comments in the script below are inside angle brackets < like so
  3472.   > .
  3473.  
  3474.  
  3475.  
  3476.  
  3477.  
  3478.  
  3479.  
  3480.  
  3481.  
  3482.  
  3483.  
  3484.  
  3485.  
  3486.  
  3487.  
  3488.  
  3489.  
  3490.  
  3491.  
  3492.  
  3493.  
  3494.  
  3495.  
  3496.  
  3497.  
  3498.  
  3499.     % ftp gatekeeper.dec.com
  3500.     Connected to gatekeeper.dec.com.
  3501.     220- *** /etc/motd.ftp ***
  3502.          Gatekeeper.DEC.COM is an unsupported service of DEC Corporate Research.
  3503.          <...this goes on for a while...>
  3504.     220 gatekeeper.dec.com FTP server (Version 5.83 Sat ... 1992) ready.
  3505.     Name (gatekeeper.dec.com:<yourlogin here>): ftp  <anonymous also works>
  3506.     331 Guest login ok, send ident as password.
  3507.     Password: <enter your email address here >
  3508.     230 Guest login ok, access restrictions apply.
  3509.     Remote system type is UNIX.  <or whatever>
  3510.     Using binary mode to transfer files.
  3511.     ftp> cd pub/standards/sql
  3512.     250 CWD command successful.
  3513.     ftp> dir
  3514.     200 PORT command successful.
  3515.     150 Opening ASCII mode data connection for /bin/ls.
  3516.     total 9529
  3517.     -r--r--r--  1 root     system     357782 Feb 25 10:18 x3h2-93-081.ps
  3518.     -r--r--r--  1 root     system     158782 Feb 25 10:19 x3h2-93-081.txt
  3519.     -r--r--r--  1 root     system     195202 Feb 25 10:20 x3h2-93-082.ps
  3520.     -r--r--r--  1 root     system      90900 Feb 25 10:20 x3h2-93-082.txt
  3521.     -r--r--r--  1 root     system    5856284 Feb 25 09:55 x3h2-93-091.ps
  3522.     -r--r--r--  1 root     system    3043687 Feb 25 09:57 x3h2-93-091.txt
  3523.     226 Transfer complete.
  3524.     ftp> type binary
  3525.     200 Type set to I.
  3526.     ftp> get x3h2-93-082.txt
  3527.     200 PORT command successful.
  3528.     150 Opening BINARY mode data connection for x3h2-93-082.txt (90900 bytes).
  3529.     226 Transfer complete.
  3530.     90900 bytes received in 0.53 seconds (166.11 Kbytes/s)
  3531.     ftp> quit
  3532.     % <the file is now in your directory as x3h2-93-082.txt>
  3533.  
  3534.  
  3535.  
  3536.  
  3537.   Retrieving Files Without Direct ftp Support
  3538.  
  3539.   Digital Equipment Corporation, like several other companies, provides
  3540.   ftp email service. The response can take several days, but it does
  3541.   provide a service equivalent to ftp for those without direct Internet
  3542.   ftp access. The address of the server is:
  3543.  
  3544.   ftpmail@decwrl.dec.com
  3545.  
  3546.   The following script will retrieve the PostScript for the latest
  3547.   version of the SQL3 document:
  3548.  
  3549.  
  3550.             reply joe.programmer@imaginary-corp.com
  3551.             connect gatekeeper.dec.com anonymous
  3552.             binary
  3553.             compress
  3554.  
  3555.  
  3556.  
  3557.  
  3558.   The following script will retrieve the PostScript for the latest ver≠
  3559.   sion of the SQL3 document:
  3560.  
  3561.  
  3562.  
  3563.  
  3564.  
  3565.        reply joe.programmer@imaginary-corp.com
  3566.        connect gatekeeper.dec.com anonymous
  3567.        binary
  3568.        compress
  3569.        uuencode
  3570.        chdir /pub/standards/sql
  3571.        get x3h2-93-091.ps
  3572.        quit
  3573.  
  3574.  
  3575.  
  3576.  
  3577.   The first line in the script commands the server to return the
  3578.   requested files to you; you should replace "joe.programmer@imaginary-
  3579.   corp.com" with your Internet address. The file in this example,
  3580.   x3h2-93-091.ps, is returned in "compress"ed "uuencode"d format as 34
  3581.   separate email messages. If your environment does not provide tools
  3582.   for reconstructing such files, then you could retrieve the file as
  3583.   plain text with the following script:
  3584.  
  3585.  
  3586.             reply joe.programmer@imaginary-corp.com
  3587.             connect gatekeeper.dec.com anonymous
  3588.             chdir /pub/standards/sql
  3589.             get x3h2-93-091.ps
  3590.             quit
  3591.  
  3592.  
  3593.  
  3594.  
  3595.   But be warned, the .ps file will probably be sent to you in more than
  3596.   70 parts!
  3597.  
  3598.   To retrieve any particular file, other than x3h2-93-091.ps, simply
  3599.   replace "x3h2-93-091.ps" with the name of the desired file. To get a
  3600.   directory listing of all files available, replace "get x3h2-93-091.ps"
  3601.   with "dir".
  3602.  
  3603.   23.10.  Part 1 - ISO/ANSI SQL Current Status
  3604.  
  3605.   This chapter is a source of information about the SQL standards
  3606.   process and its current state.
  3607.  
  3608.   Current Status:
  3609.  
  3610.   Development is currently underway to enhance SQL into a
  3611.   computationally complete language for the definition and management of
  3612.   persistent, complex objects. This includes: generalization and
  3613.   specialization hierarchies, multiple inheritance, user defined data
  3614.   types, triggers and assertions, support for knowledge based systems,
  3615.   recursive query expressions, and additional data administration tools.
  3616.   It also includes the specification of abstract data types (ADTs),
  3617.   object identifiers, methods, inheritance, polymorphism, encapsulation,
  3618.   and all of the other facilities normally associated with object data
  3619.   management.
  3620.  
  3621.   In the fall of 1996, several parts of SQL3 went through a ISO CD
  3622.   ballot.  Those parts were SQL/Framework, SQL/Foundation, and
  3623.   SQL/Bindings. Those ballots failed (as expected) with 900 or so
  3624.   comments. In Late January, there was an ISO DBL editing meeting that
  3625.   processed a large number of problem solutions that were either
  3626.   included with ballot comments or submitted as separate papers. Since
  3627.   the DBL editing meeting was unable to process all of the comments, the
  3628.   editing meeting has been extended. The completion of the editing
  3629.   meeting is scheduled for the end of July, 1997, in London.
  3630.  
  3631.   Following the July editing meeting, the expectation is that a Final CD
  3632.   ballot will be requested for these parts of SQL. The Final CD process
  3633.   will take about 6 months and a DBL editing meeting, after which there
  3634.   will be a DIS ballot and a fairly quick IS ballot.
  3635.  
  3636.   The ISO procedures have changed since SQL/92, so the SQL committees
  3637.   are still working through the exact details of the process.
  3638.  
  3639.   If everything goes well, these parts of SQL3 will become an official
  3640.   ISO/IEC standard in late 1998, but the schedule is very tight.
  3641.  
  3642.   In 1993, the ANSI and ISO development committees decided to split
  3643.   future SQL development into a multi-part standard. The Parts are:
  3644.  
  3645.  
  3646.   ∑  Part 1: Framework A non-technical description of how the document
  3647.      is structured.
  3648.  
  3649.   ∑  Part 2: Foundation The core specification, including all of the new
  3650.      ADT features.
  3651.  
  3652.   ∑  Part 3: SQL/CLI The Call Level Interface.
  3653.  
  3654.   ∑  Part 4: SQL/PSM The stored procedures specification, including
  3655.      computational completeness.
  3656.  
  3657.   ∑  Part 5: SQL/Bindings The Dynamic SQL and Embedded SQL bindings
  3658.      taken from SQL-92.
  3659.  
  3660.   ∑  Part 6: SQL/XA An SQL specialization of the popular XA Interface
  3661.      developed by X/Open
  3662.  
  3663.   ∑  Part 7:SQL/TemporalAdds time related capabilities to the SQL
  3664.      standards.
  3665.  
  3666.   In the USA, the entirety of SQL3 is being processed as both an ANSI
  3667.   Domestic ("D") project and as an ISO project. The expected time frame
  3668.   for completion of SQL3 is currently 1999.
  3669.  
  3670.   The SQL/CLI and SQL/PSM are being processed as fast as possible as
  3671.   addendums to SQL-92. In the USA, these are being processed only as
  3672.   International ("I") projects. SQL/CLI was completed in 1995. SQL/PSM
  3673.   should be completed sometime in late 1996.
  3674.  
  3675.   In addition to the SQL3 work, a number of additional projects are
  3676.   being persued:
  3677.  
  3678.  
  3679.   ∑  SQL/MM An ongoing effort to define standard multi-media packages
  3680.      using the SQL3 ADT capabilities.
  3681.  
  3682.   ∑  Remote Data Access (RDA)
  3683.  
  3684.   Standards Committee and Process
  3685.  
  3686.   There are actually a number of SQL standards committees around the
  3687.   world.  There is an international SQL standards group as a part of
  3688.   ISO. A number of countries have committees that focus on SQL. These
  3689.   countries (usually) send representatives to ISO/IEC JTC1/SC 21/WG3 DBL
  3690.   meetings. The countries that actively participate in the ISO SQL
  3691.   standards process are:
  3692.  
  3693.  
  3694.   ∑  Australia
  3695.  
  3696.  
  3697.   ∑  Brazil
  3698.  
  3699.   ∑  Canada
  3700.  
  3701.   ∑  France
  3702.  
  3703.   ∑  Germany
  3704.  
  3705.   ∑  Japan
  3706.  
  3707.   ∑  Korea
  3708.  
  3709.   ∑  The Netherlands
  3710.  
  3711.   ∑  United Kingdom
  3712.  
  3713.   ∑  United States
  3714.  
  3715.   NIST Validation
  3716.  
  3717.   SQL implementations are validated (in the Unites States) by the
  3718.   National Institute of Standards and Testing (NIST). NIST currently has
  3719.   a validation test suite for entry level SQL-92. The exact details of
  3720.   the NIST validation requirements are defined as a Federal Information
  3721.   Processing Standard (FIPS). The current requirements for SQL are
  3722.   defined in FIPS 127-2. The Postscript and Text versions of this
  3723.   document can be retrieved from NIST.  The current SQL Validated
  3724.   Products List can also be retrieved from NIST.
  3725.  
  3726.   Standard SQL Publications and Articles
  3727.  
  3728.   There are two versions of the SQL standard. Both are available from
  3729.   ANSI:
  3730.  
  3731.  
  3732.   ∑  ISO/IEC 9075:1992, "Information Technology --- Database Languages
  3733.      --- SQL"
  3734.  
  3735.   ∑  ANSI X3.135-1992, "Database Language SQL"
  3736.  
  3737.   The two versions of the SQL standard are identical except for the
  3738.   front matter and references to other standards. Both versions are
  3739.   available from:
  3740.  
  3741.  
  3742.             American National Standards Institute
  3743.             1430 Broadway
  3744.             New York, NY 10018
  3745.             USA
  3746.             Phone (sales): +1.212.642.4900
  3747.  
  3748.  
  3749.  
  3750.  
  3751.   In additon to the SQL-92 standard, there is now a Technical Corrigen≠
  3752.   dum (bug fixes):
  3753.  
  3754.  
  3755.           * Technical Corrigendum 1:1994 to ISO/IEC 9075:1992
  3756.  
  3757.  
  3758.  
  3759.  
  3760.   TC 1 should also be available from ANSI. There is only an ISO version
  3761.   of TC 1 -- it applies both to the ISO and ANSI versions of SQL-92.
  3762.  
  3763.   In addition to the standards, several books have been written about
  3764.   the 1992 SQL standard. These books provide a much more readable
  3765.   description of the standard than the actual standard.
  3766.  
  3767.   Related Standards
  3768.  
  3769.   A number of other standards are of interest to the SQL community. This
  3770.   section contains pointers to information on those efforts. These
  3771.   pointers will be augmented as additional information becomes available
  3772.   on the web.
  3773.  
  3774.  
  3775.   ∑  SQL Environments (FIPS 193)
  3776.  
  3777.   ∑  Next Generation Repository Systems (X3H4) - a News Release calling
  3778.      for particpation in "Developing Standards for the Next Generation
  3779.      Repository Systems."
  3780.  
  3781.   23.11.  Part 2 - ISO/ANSI SQL Foundation
  3782.  
  3783.   A significant portion of the SQL3 effort is in the SQL Foundation
  3784.   document:
  3785.  
  3786.  
  3787.   ∑  Base SQL/PSM capabilities (moved form SQL/PSM-92)
  3788.  
  3789.   ∑  New data types
  3790.  
  3791.   ∑  Triggers
  3792.  
  3793.   ∑  Subtables
  3794.  
  3795.   ∑  Abstract Data Types (ADT)
  3796.  
  3797.   ∑  Object Oriented Capabilities
  3798.  
  3799.   There are several prerequisites to the object oriented capabilities:
  3800.  
  3801.  
  3802.   ∑  Capability of defining complex operations
  3803.  
  3804.   ∑  Store complex operations in the database
  3805.  
  3806.   ∑  External procedure calls ≠ Some operations may not be in SQL, or
  3807.      may require external interactions
  3808.  
  3809.   These capabilities are defined as a part of SQL/PSM
  3810.  
  3811.   A great deal of work is currently being done to refine the SQL-3
  3812.   object model and align it with the object model proposed by ODMG. This
  3813.   effort is described in the X3H2 and ISO DBL paper: Accomodating SQL3
  3814.   and ODMG. A recent update on the SQL3/OQL Merger is also available.
  3815.  
  3816.   SQL3 Timing
  3817.  
  3818.   Work on SQL3 is well underway, but the final standards is several
  3819.   years away.
  3820.  
  3821.  
  3822.   ∑  International ballot to progress SQL3 Foundation from Working Draft
  3823.      to Committee Draft (CD) taking place fall, 1996.
  3824.  
  3825.   ∑  Ballot is expected to generate numerous comments
  3826.  
  3827.   ∑  A second CD ballot is likely to be required
  3828.  
  3829.   ∑  Draft International Standard ballot is likely to be take place in
  3830.      mid 1998
  3831.  
  3832.   ∑  International Standard could be completed by mid 1999.
  3833.  
  3834.   The ANSI version of the standard will be on a similar schedule.
  3835.  
  3836.   23.12.  Part 3 - ISO/ANSI SQL Call Level Interface
  3837.  
  3838.   The SQL/CLI is a programing call level interface to SQL databases. It
  3839.   is designed to support database access from shrink-wrapped
  3840.   applications. The CLI was originally created by a subcommittee of the
  3841.   SQL Access Group (SAG).  The SAG/CLI specification was published as
  3842.   the Microsoft Open DataBase Connectivity (ODBC) specification in 1992.
  3843.   In 1993, SAG submitted the CLI to the ANSI and ISO SQL committees.
  3844.   (The SQL Access Group has now merged with X/Open consortium.)
  3845.  
  3846.   SQL/CLI provides an international standard for:
  3847.  
  3848.  
  3849.   ∑  Implementation-independent CLI to access SQL databases
  3850.  
  3851.   ∑  Client-server tools can easily access database through dynamic Link
  3852.      Libraries
  3853.  
  3854.   ∑  Supports and encourages rich set of Client-server tools
  3855.  
  3856.   SQL/CLI Timing
  3857.  
  3858.   For the standards process, SQL/CLI is being processed with blinding
  3859.   speed.
  3860.  
  3861.  
  3862.   ∑  SQL/CLI is an addendum to 1992 SQL standard (SQL-92)
  3863.  
  3864.   ∑  Completed as an ISO standard in 1995
  3865.  
  3866.   ∑  ISO/IEC 9075-3:1995 Information technology -- Database languages --
  3867.      SQL -- Part 3: Call-Level Interface (SQL/CLI)
  3868.  
  3869.   ∑  Current SQL/CLI effort is adding support for SQL3 features
  3870.  
  3871.   23.13.  Part 4 - ISO/ANSI SQL Persistent Stored Modules
  3872.  
  3873.   SQL/PSM expands SQL by adding:
  3874.  
  3875.  
  3876.   ∑  Procedural language extensions
  3877.  
  3878.   ∑  Multi-statement and Stored Procedures
  3879.  
  3880.   ∑  External function and procedure calls
  3881.  
  3882.   In addition to being a valuable application development tool, SQL/PSM
  3883.   provides the foundation support for the object oriented capabilities
  3884.   in SQL3.
  3885.  
  3886.   Multi-statement and Stored Procedures
  3887.  
  3888.   Multi-statement and stored procedures offer a variety of advantages in
  3889.   a client/server environment:
  3890.  
  3891.  
  3892.   ∑  Performance - Since a stored procedure can perform multiple SQL
  3893.      statements, network interaction with the client are reduced.
  3894.  
  3895.   ∑  Security - A user can be given the right to call a stored procedure
  3896.      that updates a table or set of tables but denied the right to
  3897.      update the tables directly
  3898.  
  3899.   ∑  Shared code - The code in a stored procedure does not have to be
  3900.      rewritten and retested for each client tool that accesses the
  3901.      database.
  3902.  
  3903.   ∑  Control - Provides a single point of definition and control for
  3904.      application logic.
  3905.  
  3906.   Procedural Language Extensions
  3907.  
  3908.   Procedural language add the power of a traditional programming
  3909.   language to SQL through flow control statements and a variety of other
  3910.   programming constructs.
  3911.  
  3912.   Flow Control Statements
  3913.  
  3914.  
  3915.   ∑  If-then-else
  3916.  
  3917.   ∑  Looping constructs
  3918.  
  3919.   ∑  Exception handling
  3920.  
  3921.   ∑  Case statement
  3922.  
  3923.   ∑  Begin-End blocks
  3924.  
  3925.   The procedural language extensions include other programming language
  3926.   constructs:
  3927.  
  3928.  
  3929.   ∑  Variable declarations
  3930.  
  3931.   ∑  Set statements for value assignment
  3932.  
  3933.   ∑  Get diagnostics for process and status information
  3934.  
  3935.   In addition, all of the traditional SQL statements can be included in
  3936.   multi-statement procedures.
  3937.  
  3938.   External Procedure and Function Calls
  3939.  
  3940.   One feature frequently mentioned in the wish lists for many database
  3941.   products, and implemented in some, is a capability augmenting the
  3942.   built-in features with calls to user-written procedures external to
  3943.   the database software.
  3944.  
  3945.  
  3946.   ∑  Allows a particular site or application to add their own database
  3947.      functions
  3948.  
  3949.   ∑  Can be used throughout the database applications
  3950.  
  3951.   The benefit of this capability is that it gives the database (and
  3952.   therefore database applications) access to a rich set of procedures
  3953.   and functions too numerous to be defined by a standards committee.
  3954.  
  3955.   SQL/PSM Timing
  3956.  
  3957.   SQL/PSM is proceeding quickly:
  3958.  
  3959.  
  3960.  
  3961.   ∑  SQL/PSM is an addendum to SQL-92
  3962.  
  3963.   ∑  International ballot to progress SQL/PSM from a Draft International
  3964.      Standard to an International Standard ended January, 1996.
  3965.  
  3966.   ∑  Editing meeting in May, 1996 did not resolve all of the comments
  3967.  
  3968.   ∑  Continuation of PSM Editing meeting is scheduled for September 30
  3969.      through October 4, 1996
  3970.  
  3971.   ∑  The schedule is tight but there is a chance that PSM will be
  3972.      published with a 1996 date.
  3973.  
  3974.   ∑  The official designation will be: ISO/IEC DIS 9075-4:199?
  3975.      Information technology -- Database languages -- SQL -- Part 4: SQL
  3976.      Persistent Stored Modules (SQL/PSM)
  3977.  
  3978.   ∑  Work is well underway on adding SQL/PSM support for SQL3 features.
  3979.  
  3980.   23.14.  Part 5 - ISO/ANSI SQL/Bindings
  3981.  
  3982.   For ease of reference, the programming language bindings have been
  3983.   pulled out into a separate document. The current version is simply an
  3984.   extract of the dynamic and embedded bindings from SQL-92.
  3985.  
  3986.   A variety of issues remain unresolved for the programming language
  3987.   bindings.
  3988.  
  3989.   For traditional programming language, mappings exist for the SQL-92
  3990.   datatypes. However, mappings must be defined between SQL objects and
  3991.   programming language variables.
  3992.  
  3993.   For object oriented languages, mapping must be defined for the current
  3994.   SQL datatypes and between the SQL object model and the object model of
  3995.   the object-oriented language.
  3996.  
  3997.   The object model needs to stabilize before these can be addressed.
  3998.  
  3999.   The language bindings will be completed as a part of SQL3.
  4000.  
  4001.   23.15.  Part 6 - ISO/ANSI SQL XA Interface Specialization (SQL/XA)
  4002.  
  4003.   This specification would standardize an application program interface
  4004.   (API) between a global Transaction Manager and an SQL Resource
  4005.   Manager. It would standardize the function calls, based upon the
  4006.   semantics of ISO/IEC 10026, "Distributed Transaction Processing", that
  4007.   an SQL Resource Manager would have to support for two-phase commit.
  4008.   The base document is derived from an X/Open publication, with X/Open
  4009.   permission, that specifies explicit input and output parameters and
  4010.   semantics, in terms of SQL data types, for the following functions:
  4011.   xa_close, xa_commit, xa_complete, xa_end, xa_forget, xa_open,
  4012.   xa_prepare, xa_recover, xa_rollback, and xa_start.
  4013.  
  4014.   ISO is currently attempting to fast-track the X/Open XA specification.
  4015.   The fast-track process adopts a current industry specification with no
  4016.   changes.  The XA fast-track ballot at the ISO SC21, JTC 1 level
  4017.   started on April 27, 1995 and ends on October 27, 1995. If the XA
  4018.   specification is approved by 75% of the votes, and by 2/3 of the p-
  4019.   members of JTC 1, it will become an International Standard. If the
  4020.   fast-track ballot is approved, SQL/XA could become a standard in 1996.
  4021.  
  4022.   23.16.  Part 7 - ISO/ANSI SQL Temporal
  4023.  
  4024.   Temporal SQL deals with time-related data. The concept is that it is
  4025.   useful to query data to discover what it looked like at a particular
  4026.   point in time.  Temporal SQL is a December, 1994 paper by Rick
  4027.   Snodgrass describing the concepts.
  4028.  
  4029.   X3 Announces the Approval of a New Project, ISO/IEC 9075 Part 7:
  4030.   SQL/Temporal is a press release related to SQL/Temporal.
  4031.  
  4032.  
  4033.        ----------------------------------------------------------------------------
  4034.                                        Temporal SQL
  4035.                                        ************
  4036.        Rick Snodgrass (chair of the TSQL2 committee)
  4037.        31-Dec-1994
  4038.  
  4039.  
  4040.  
  4041.  
  4042.   Several people have questioned the need for additional support for
  4043.   time in SQL3 (as proposed by DBL RIO-75, requesting a new part of SQL
  4044.   to support temporal databases). The claim is that abstract data types
  4045.   (ADT's) are sufficient for temporal support. In this informational
  4046.   item, I argue, using concrete examples, that using columns typed with
  4047.   abstract data types is inadequate for temporal queries. In particular,
  4048.   many common temporal queries are either difficult to simulate in SQL,
  4049.   or require embedding SQL in a procedural language. Alternatives are
  4050.   expressed in TSQL2, a temporal extension to SQL-92.
  4051.  
  4052.   23.16.1.  INTRODUCTION
  4053.  
  4054.   Valid-time support goes beyond that of a temporal ADT. With the later,
  4055.   a column is specified as of a temporal domain, such as DATE or
  4056.   INTERVAL (examples will be given shortly). With valid time, the rows
  4057.   of a table vary over time, as reality changes. The timestamp
  4058.   associated with a row of a valid-time table is interpreted by the
  4059.   query language as the time when the combination of values of the
  4060.   columns in the row was valid. This implicit timestamp allows queries
  4061.   to be expressed succinctly and intuitively.
  4062.  
  4063.   23.16.2.  A CASE STUDY - STORING CURRENT INFORMATION
  4064.  
  4065.   The University of Arizona's Office of Appointed Personnel has some
  4066.   information in a database, including each employee's name, their
  4067.   current salary, and their current title. This can be represented by a
  4068.   simple table.
  4069.  
  4070.  
  4071.                Employee(Name, Salary, Title)
  4072.  
  4073.  
  4074.  
  4075.  
  4076.   Given this table, finding an employee's salary is easy.
  4077.  
  4078.  
  4079.                SELECT Salary
  4080.                FROM Employee
  4081.                WHERE Name = 'Bob'
  4082.  
  4083.  
  4084.  
  4085.  
  4086.   Now the OAP wishes to record the date of birth. To do so, a column is
  4087.   added to the table, yielding the following schema.
  4088.  
  4089.  
  4090.                Employee(Name, Salary, Title, DateofBirth DATE)
  4091.  
  4092.  
  4093.   Finding the employee's date of birth is analogous to determining the
  4094.   salary.
  4095.  
  4096.  
  4097.                SELECT DateofBirth
  4098.                FROM Employee
  4099.                WHERE Name = 'Bob'
  4100.  
  4101.  
  4102.  
  4103.  
  4104.   23.16.3.  A CASE STUDY - STORING HISTORY INFORMATION
  4105.  
  4106.   The OAP wishes to computerize the employment history. To do so, they
  4107.   append two columns, one indicating when the information in the row
  4108.   became valid, the other indicating when the information was no longer
  4109.   valid.
  4110.  
  4111.   Employee (Name, Salary, Title, DateofBirth, Start DATE, Stop DATE)
  4112.  
  4113.   To the data model, these new columns are identical to DateofBirth.
  4114.   However, their presence has wide-ranging consequences.
  4115.  
  4116.   23.16.4.  A CASE STUDY - PROJECTION
  4117.  
  4118.   To find an employee's current salary, things are more difficult.
  4119.  
  4120.  
  4121.                SELECT Salary
  4122.                FROM Employee
  4123.                WHERE Name = 'Bob' AND Start <= CURRENT_DATE AND CURRENT_DATE <= Stop
  4124.  
  4125.  
  4126.  
  4127.  
  4128.   This query is more complicated than the previous one. The culprit is
  4129.   obviously the two new columns. The OAP wants to distribute to each
  4130.   employee their salary history. Specifically, for each person, the max≠
  4131.   imal intervals at each salary needs to be determined. Unfortunately,
  4132.   this is not possible in SQL. An employee could have arbitrarily many
  4133.   title changes between salary changes.
  4134.  
  4135.  
  4136.        Name    Salary  Title             DateofBirth   Start           Stop
  4137.        ----    ------  -----             -----------   -----           ----
  4138.        Bob     60000   Assistant Provost 1945-04-09    1993-01-01      1993-05-30
  4139.        Bob     70000   Assistant Provost 1945-04-09    1993-06-01      1993-09-30
  4140.        Bob     70000   Provost           1945-04-09    1993-10-01      1994-01-31
  4141.        Bob     70000   Professor         1945-04-09    1994-02-01      1994-12-31
  4142.  
  4143.                                       Figure 1
  4144.  
  4145.  
  4146.  
  4147.  
  4148.   Note that there are three rows in which Bob's salary remained constant
  4149.   at $70,000. Hence, the result should be two rows for Bob.
  4150.  
  4151.  
  4152.        Name    Salary  Start           Stop
  4153.        ----    ------  -----           ----
  4154.        Bob     60000   1993-01-01      1993-05-30
  4155.        Bob     70000   1993-06-01      1994-12-31
  4156.  
  4157.  
  4158.  
  4159.   One alternative is to give the user a printout of Salary and Title
  4160.   information, and have user determine when his/her salary changed. This
  4161.   alternative is not very appealing or realistic. A second alternative
  4162.   is to use SQL as much as possible.
  4163.  
  4164.  
  4165.        CREATE TABLE Temp(Salary, Start, Stop)
  4166.        AS      SELECT Salary, Start, Stop
  4167.                FROM Employee;
  4168.  
  4169.  
  4170.  
  4171.  
  4172.   repeat
  4173.  
  4174.  
  4175.                UPDATE Temp T1
  4176.                SET (T1.Stop) = (SELECT MAX(T2.Stop)
  4177.                                 FROM Temp AS T2
  4178.                                 WHERE T1.Salary = T2.Salary AND T1.Start < T2.Start
  4179.                                        AND T1.Stop >= T2.Start AND T1.Stop < T2.Stop)
  4180.                WHERE EXISTS (SELECT *
  4181.                              FROM Temp AS T2
  4182.                              WHERE T1.Salary = T2.Salary AND T1.Start < T2.Start
  4183.                                        AND T1.Stop >= T2.Start AND T1.Stop < T2.Stop)
  4184.                until no rows updated;
  4185.  
  4186.        DELETE FROM Temp T1
  4187.  
  4188.        WHERE EXISTS (SELECT *
  4189.                      FROM Temp AS T2
  4190.                      WHERE T1.Salary = T2.Salary
  4191.                                AND ((T1.Start > T2.Start AND T1.Stop <= T2.Stop)
  4192.                                OR (T1.Start >= T2.Start AND T1.Stop < T2.Stop))
  4193.  
  4194.  
  4195.  
  4196.  
  4197.   The loop finds those intervals that overlap or are adjacent and thus
  4198.   should be merged. The loop is executed log N times in the worst case,
  4199.   where N is the number of rows in a chain of overlapping or adjacent
  4200.   value-equivalent rows. The reader can simulate the query on the exam≠
  4201.   ple table to convince him/herself of its correctness.
  4202.  
  4203.   A third alternative is to use SQL only to open a cursor on the table.
  4204.   A linked list of periods is maintained, each with a salary. This
  4205.   linked list should be initialized to empty.
  4206.  
  4207.  
  4208.        DECLARE emp_cursor CURSOR FOR
  4209.                SELECT Salary, Title, Start, Stop
  4210.                FROM Employee;
  4211.        OPEN emp_cursor;
  4212.        loop:
  4213.                FETCH emp_cursor INTO :salary, :start, :stop;
  4214.                if no-data returned then goto finished;
  4215.                find position in linked list to insert this information;
  4216.                goto loop;
  4217.        finished:
  4218.        CLOSE emp_cursor;
  4219.  
  4220.  
  4221.  
  4222.  
  4223.   iterate through linked list, printing out dates and salaries
  4224.  
  4225.   The linked list may not be necessary in this case if the cursor is
  4226.   ORDER BY Start.
  4227.  
  4228.   In any case, the query, a natural one, is quite difficult to express
  4229.   using the facilities present in SQL-92. The query is trivial in TSQL2.
  4230.  
  4231.  
  4232.                SELECT Salary
  4233.                FROM Employee
  4234.  
  4235.  
  4236.  
  4237.  
  4238.   23.16.5.  A CASE STUDY - JOIN
  4239.  
  4240.   A more drastic approach is to avoid the problem of extracting the
  4241.   salary history by reorganizing the schema to separate salary, title,
  4242.   and date of birth information (in the following, we ignore the date of
  4243.   birth, for simplicity).
  4244.  
  4245.  
  4246.                Employee1 (Name, Salary, Start DATE, Stop DATE)
  4247.                Employee2 (Name, Title, Start DATE, Stop DATE)
  4248.  
  4249.  
  4250.  
  4251.  
  4252.   The Employee1 table is as follows.
  4253.  
  4254.  
  4255.        Name    Salary  Start           Stop
  4256.        ----    ------  -----           ----
  4257.        Bob     60000   1993-01-01      1993-05-30
  4258.        Bob     70000   1993-06-01      1993-12-31
  4259.  
  4260.  
  4261.  
  4262.  
  4263.   Here is the example Employee2 table.
  4264.  
  4265.  
  4266.        Name    Title                   Start           Stop
  4267.        ----    ------                  -----           ----
  4268.        Bob     Assistant Provost       1993-01-01      1993-09-30
  4269.        Bob     Provost                 1993-10-01      1994-01-31
  4270.        Bob     Professor               1994-02-01      1994-12-31
  4271.  
  4272.  
  4273.  
  4274.  
  4275.   With this change, getting the salary information for an employee is
  4276.   now easy.
  4277.  
  4278.  
  4279.                SELECT Salary, Start, Stop
  4280.                FROM Employee1
  4281.                WHERE Name = 'Bob'
  4282.  
  4283.  
  4284.  
  4285.  
  4286.   But what if the OAP wants a table of salary, title intervals (that is,
  4287.   suppose the OAP wishes a table to be computed in the form of Figure
  4288.   1)? One alternative is to print out two tables, and let the user fig≠
  4289.   ure out the combinations. A second alternative is to use SQL entirely.
  4290.   Unfortunately, this query must do a case analysis of how each row of
  4291.   Employee1 overlaps each row of Employee2; there are four possible
  4292.   cases.
  4293.  
  4294.  
  4295.        SELECT Employee1.Name, Salary, Dept, Employee1.Start, Employee1.Stop
  4296.        FROM Employee1, Employee2
  4297.        WHERE Employee1.Name = Employee2.Name
  4298.             AND Employee2.Start <= Employee1.Start AND Employee1.Stop < Employee2.Stop
  4299.        UNION
  4300.        SELECT Employee1.Name, Salary, Dept, Employee1.Start, Employee2.Stop
  4301.        FROM Employee1, Employee2
  4302.        WHERE Employee1.Name = Employee2.Name
  4303.             AND Employee1.Start >= Employee2.Start AND Employee2.Stop < Employee1.Stop
  4304.                AND Employee1.Start < Employee2.Stop
  4305.        UNION
  4306.        SELECT Employee1.Name, Salary, Dept, Employee2.Start, Employee1.Stop
  4307.        FROM Employee1, Employee2
  4308.        WHERE Employee1.Name = Employee2.Name
  4309.             AND Employee2.Start > Employee1.Start AND Employee1.Stop < Employee2.Stop
  4310.                AND Employee2.Start < Employee1.Stop
  4311.        UNION
  4312.        SELECT Employee1.Name, Salary, Dept, Employee2.Start, Employee2.Stop
  4313.        FROM Employee1, Employee2
  4314.        WHERE Employee1.Name = Employee2.Name
  4315.             AND Employee2.Start > Employee1.Start AND Employee2.Stop < Employee1.Stop
  4316.  
  4317.  
  4318.  
  4319.  
  4320.   Getting all the cases right is a challenging task. In TSQL2, perform≠
  4321.   ing a temporal join is just what one would expect.
  4322.  
  4323.  
  4324.                SELECT Employee1.Name, Salary, Dept
  4325.                FROM Employee1, Employee2
  4326.                WHERE Employee1.Name = Employee2.Name
  4327.  
  4328.  
  4329.  
  4330.  
  4331.   23.16.6.  A CASE STUDY - AGGREGATES
  4332.  
  4333.   Now the OAP is asked, what is the maximum salary? Before adding time,
  4334.   this was easy.
  4335.  
  4336.  
  4337.                SELECT MAX(Salary)
  4338.                FROM Employee
  4339.  
  4340.  
  4341.  
  4342.  
  4343.   Now that the salary history is stored, we'd like a history of the max≠
  4344.   imum salary over time. The problem, of course, is that SQL does not
  4345.   provide temporal aggregates. The easy way to do this is to print out
  4346.   the information, and scan manually for the maximums. An alternative is
  4347.   to be tricky and convert the snapshot aggregate query into a non-
  4348.   aggregate query, then convert that into a temporal query. The non-
  4349.   aggregate query finds those salaries for which a greater salary does
  4350.   not exist.
  4351.  
  4352.  
  4353.  
  4354.  
  4355.  
  4356.  
  4357.           SELECT Salary
  4358.           FROM Employee AS E1
  4359.           WHERE NOT EXISTS (SELECT *
  4360.                             FROM Employee AS E2
  4361.                             WHERE E2.Salary > E1.Salary)
  4362.  
  4363.  
  4364.  
  4365.  
  4366.   Converting this query into a temporal query is far from obvious. The
  4367.   following is one approach.
  4368.  
  4369.  
  4370.        CREATE TABLE Temp (Salary, Start, Stop)
  4371.        AS      SELECT Salary, Start, Stop
  4372.                FROM Employee;
  4373.        INSERT INTO Temp
  4374.                SELECT T.Salary, T.Start, E.Start
  4375.                FROM Temp AS T, Employee AS E
  4376.                WHERE E.Start >= T.Start AND E.Start < T.Stop AND E.Salary > T.Salary;
  4377.  
  4378.        INSERT INTO Temp
  4379.                SELECT T.Salary, T.Stop, E.Stop
  4380.                FROM Temp AS T, Employee AS E
  4381.                WHERE E.Stop > T.Start AND E.Stop <= T.Stop AND E.Salary > T.Salary;
  4382.        DELETE FROM Temp T
  4383.        WHERE EXISTS (SELECT *
  4384.                      FROM Employee AS E
  4385.                      WHERE ((T.Start => E.Start AND T.Start < E.Stop)
  4386.                                OR (E.Start >= T.Start AND E.Start < T.Stop))
  4387.                            AND E.Salary > T.Salary;
  4388.  
  4389.  
  4390.  
  4391.  
  4392.   This approach creates an auxiliary table. We add to this table the
  4393.   lower period of a period subtraction and the upper period of a period
  4394.   subtraction.  We then delete all periods that overlap with some row
  4395.   defined by the subquery, thereby effecting the NOT EXISTS. Finally we
  4396.   generate from the auxiliary table maximal periods, in the same way
  4397.   that the salary information was computed above. As one might imagine,
  4398.   such SQL code is extremely inefficient to execute, given the complex
  4399.   nested queries with inequality predicates.
  4400.  
  4401.   A third alternative is to use SQL as little as possible, and instead
  4402.   compute the desired maximum history in a host language using cursors.
  4403.  
  4404.   The query in TSQL2 is again straightforward and intuitive.
  4405.  
  4406.  
  4407.                SELECT MAX(Salary)
  4408.                FROM Employee
  4409.  
  4410.  
  4411.  
  4412.  
  4413.   23.16.7.  SUMMARY
  4414.  
  4415.   Time-varying data is manipulated in most database applications. Valid-
  4416.   time support is absent in SQL. Many common temporal queries are either
  4417.   difficult to simulate in SQL, or require embedding SQL in a procedural
  4418.   language, due to SQL's lack of support for valid-time tables in its
  4419.   data model and query constructs.
  4420.  
  4421.   Elsewhere, we showed that adding valid-time support requires few
  4422.   changes to the DBMS implementation, can dramatically simplify some
  4423.   queries and enable others, and can later enable optimizations in
  4424.   storage structures, indexing methods, and optimization strategies that
  4425.   can yield significant performance improvements.
  4426.  
  4427.   With a new part of SQL3 supporting time-varying information, we can
  4428.   begin to address such applications, enabling SQL3 to better manage
  4429.   temporal data.
  4430.  
  4431.  
  4432.        ----------------------------------------------------------------------------
  4433.                   Accredited Standards Committee* X3, Information Technology
  4434.        NEWS RELEASE
  4435.  
  4436.        Doc. No.:       PR/96-0002
  4437.  
  4438.        Reply to:       Barbara Bennett at bbennett@itic.nw.dc.us
  4439.  
  4440.                     X3 Announces the Approval of a New Project, ISO/IEC
  4441.  
  4442.                                 9075 Part 7:  SQL/Temporal
  4443.  
  4444.        Washington D.C., January 1996
  4445.        ----------------------------------------------------------------------------
  4446.  
  4447.  
  4448.  
  4449.  
  4450.   -- Accredited Standards Committee X3, Information Technology is
  4451.   announcing the approval of a new project on SQL/Temporal Support,
  4452.   ISO/IEC 9075 Part 7, with the work being done in Technical Committee
  4453.   X3H2, Database.  The scope of this proposed standard specifies a new
  4454.   Part of the emerging SQL3 standard, e.g., Part 7, Temporal SQL, to be
  4455.   extensions to the SQL language supporting storage, retrieval, and
  4456.   manipulation of temporal data in an SQL database environment.  The
  4457.   next X3H2 meeting is scheduled for March 11-14, 1996 in Kansas.
  4458.  
  4459.   Inquiries regarding this project should be sent to the
  4460.  
  4461.  
  4462.                Chairman of X3H2,
  4463.                Dr. Donald R. Deutsch,
  4464.                Sybase, Inc., Suite 800,
  4465.                6550 Rock Spring
  4466.                Drive, Bethesda, MD  20817.
  4467.                Email: deutsch@sybase.com.
  4468.  
  4469.  
  4470.  
  4471.  
  4472.   An initial call for possible patents and other pertinent issues (copy≠
  4473.   rights, trademarks) is now being issued.  Please submit information on
  4474.   these issues to the
  4475.  
  4476.  
  4477.                X3 Secretariat at
  4478.                1250 Eye Street
  4479.                NW, Suite 200,
  4480.                Washington DC  20005.
  4481.                Email: x3sec@itic.nw.dc.us
  4482.                FAX:  (202)638-4922.
  4483.  
  4484.  
  4485.  
  4486.  
  4487.  
  4488.  
  4489.   23.17.  Part 8 - ISO/ANSI SQL MULTIMEDIA (SQL/MM)
  4490.  
  4491.   A new ISO/IEC international standardization project for development of
  4492.   an SQL class library for multimedia applications was approved in early
  4493.   1993.  This new standardization activity, named SQL Multimedia
  4494.   (SQL/MM), will specify packages of SQL abstract data type (ADT)
  4495.   definitions using the facilities for ADT specification and invocation
  4496.   provided in the emerging SQL3 specification. SQL/MM intends to
  4497.   standardize class libraries for science and engineering, full-text and
  4498.   document processing, and methods for the management of multimedia
  4499.   objects such as image, sound, animation, music, and video. It will
  4500.   likely provide an SQL language binding for multimedia objects defined
  4501.   by other JTC1 standardization bodies (e.g. SC18 for documents, SC24
  4502.   for images, and SC29 for photographs and motion pictures).
  4503.  
  4504.   The Project Plan for SQL/MM indicates that it will be a multi-part
  4505.   standard consisting of an evolving number of parts. Part 1 will be a
  4506.   Framework that specifies how the other parts are to be constructed.
  4507.   Each of the other parts will be devoted to a specific SQL application
  4508.   package. The following SQL/MM Part structure exists as of August 1994:
  4509.  
  4510.  
  4511.   ∑  Part 1: Framework A non-technical description of how the document
  4512.      is structured.
  4513.  
  4514.   ∑  Part 2: Full Text Methods and ADTs for text data processing. About
  4515.      45 pages.
  4516.  
  4517.   ∑  Part 3: Spatial Methods and ADTs for spatial data management. About
  4518.      200 pages with active contributions from Spatial Data experts from
  4519.      3 national bodies.
  4520.  
  4521.   ∑  Part 4: General Purpose Methods and ADTs for complex numbers,
  4522.      Facilities include trig and exponential functions, vectors, sets,
  4523.      etc.  Currently about 90 pages.
  4524.  
  4525.   There are a number of standards efforts in the area of Spatial and
  4526.   Geographic information:
  4527.  
  4528.  
  4529.   ∑  ANSI X3L1 - Geographic Information Systems.  Mark Ashworth of
  4530.      Unisys is the liason between X3L1 and ANSI X3H2. He is also the
  4531.      editor for parts 1, 3, and 4 of the SQL/MM draft.
  4532.  
  4533.   ∑  ISO TC 211 - Geographic information/Geomatics
  4534.  
  4535.   24.  Technical support for PostgreSQL
  4536.  
  4537.   If you have any technical question or encounter any problem you can e-
  4538.   mail to:
  4539.  
  4540.   ∑  pgsql-questions@postgresql.org
  4541.  
  4542.      and expect e-mail answer in less than a day. As the user-base of
  4543.      internet product is very vast, and users support other users,
  4544.      internet will be capable of giving technical support to billions of
  4545.      users easily. Email support is much more convenient than telephone
  4546.      support as you can cut and paste error messages, program output
  4547.      etc.. and easily transmit to mailing list/newsgroup.
  4548.  
  4549.   In the near future, PostgreSQL organisation will be selling technical
  4550.   support to large/small companies, the revenue generated will be used
  4551.   for maintaining several mirror sites (web and ftp) around the world.
  4552.   The revenue will also be used to produce printed documentation,
  4553.   guides, textbooks which will help the customers.
  4554.  
  4555.   You can also take help from professional consulting firms like
  4556.   Anderson, WGS (Work Group Solutions). Contact them for help, since
  4557.   they have very good expertise in "C", "C++" (PostgreSQL is written in
  4558.   "C") -
  4559.  
  4560.   ∑  Work Group Solutions  <http://www.wgs.com>
  4561.  
  4562.   ∑  Anderson Consulting  <http://www.ac.com>
  4563.  
  4564.   25.  Economic and Business Aspects
  4565.  
  4566.   Commercial databases pay many taxes like federal, state, sales,
  4567.   employment, social security, medicare taxes, health care for
  4568.   employees, bunch of benefits for employees, marketing and
  4569.   advertisement costs. All these costs do not go directly for the
  4570.   development of the database. When you buy a commercial database, some
  4571.   portion of the amount goes for overheads like taxes, expenses and
  4572.   balance for database R&D costs.
  4573.  
  4574.   Also commercial databases have to pay for buildings/real-estates and
  4575.   purchase Unix machines, install and maintain them. All of these costs
  4576.   are passed onto customers.
  4577.  
  4578.   PostgreSQL has the advantage over commercial databases as there is no
  4579.   direct tax since it is made on the internet. A very vast group of
  4580.   people contribute to the development of the PostgreSQL. For example,
  4581.   in a hypothetical case, if there are one million companies in U.S.A
  4582.   and each contribute about $ 10 (worth of software to PostgreSQL) than
  4583.   each and every company will get ten million dollars!! This is the
  4584.   GREAT MAGIC of software development on internet.
  4585.  
  4586.   Currently, PostgreSQL source code is about 2,00,000 lines of "C",
  4587.   "C++" code. If cost of each line of "C" code is $ 2 than the total
  4588.   cost of PostgreSQL as of today is $ 4,00,000 (four hundred thousand
  4589.   dollars!).
  4590.  
  4591.   Many companies already develop in-house vast amount of "C", "C++"
  4592.   code. Hence by taking in the source code of PostgreSQL and
  4593.   collaborating with other companies on internet will greatly benefit
  4594.   the company saving time and efforts.
  4595.  
  4596.   26.  List of Other Databases
  4597.  
  4598.   Listed below are other SQL databases for Unix, Linux.
  4599.  
  4600.   ∑  Click and go to Applications->databases.
  4601.      <http://www.caldera.com/tech-ref/linuxapps/linapps.html>
  4602.  
  4603.   ∑  Click and go to Applications->databases.
  4604.      <http://www.xnet.com/~blatura/linapps.shtml>
  4605.  
  4606.   ∑  Database resources  <http://linas.org/linux/db.html> This was
  4607.      written by Linas Vepstas: linas@fc.net
  4608.  
  4609.   ∑  Free Database List
  4610.      <http://cuiwww.unige.ch:80/~scg/FreeDB/FreeDB.list.html>
  4611.  
  4612.   ∑  Browne's RDBMS List <http://www.hex.net/~cbbrowne/rdbms.html>
  4613.      written by Christopher B. Browne cbbrowne@hex.net
  4614.  
  4615.   ∑  SAL's List of Relational DBMS <http://SAL.KachinaTech.COM/H/1/>
  4616.  
  4617.   ∑  SAL's List of Object-Oriented DBMS
  4618.      <http://SAL.KachinaTech.COM/H/2/>
  4619.  
  4620.  
  4621.   ∑  SAL's List of Utilites and Other Databases
  4622.      <http://SAL.KachinaTech.COM/H/3/>
  4623.  
  4624.   ∑  ACM SIGMOD Index of Publicly Available Database Software
  4625.      <http://bunny.cs.uiuc.edu/sigmod/databaseSoftware/>
  4626.  
  4627.   27.  Internet World Wide Web Searching Tips
  4628.  
  4629.   Internet is very vast and it has vast number of software and has a
  4630.   ocean of information underneath. It is growing at the rate of 300%
  4631.   annually world wide. It is estimated that there are about 10 million
  4632.   Web sites world wide!
  4633.  
  4634.   To search for a information you would use search engines like "Yahoo",
  4635.   "Netscape", "Lycos" etc. Go to Yahoo, click on search.  Use filtering
  4636.   options to narrow down your search criteria. The default search action
  4637.   is "Intelligent search" which is more general and lists all
  4638.   possiblities. Click on "Options" to select "EXACT phrase" search,
  4639.   "AND" search, "OR" search, etc.. This way you would find the
  4640.   information you need much faster. Also in the search menu, there are
  4641.   radio-buttons for searching in Usenet, Web-sites and Yahoo sites.
  4642.  
  4643.   28.  Conclusion
  4644.  
  4645.   After researching all the available databases which are free and
  4646.   source code is available, it was found that ONLY PostgreSQL is the
  4647.   MOST mature, most widely used and robust RDBMS SQL free database
  4648.   (object relational) in the world.
  4649.  
  4650.   PostgreSQL is very appealing since lot of work had already been done.
  4651.   It has ODBC and JDBC drivers, using these it is possible to write
  4652.   applications independent of the databases. The applications written in
  4653.   PostgreSQL using ODBC, JDBC drivers are easily portable to other
  4654.   databases like Oracle, Sybase and Informix and vice versa.
  4655.  
  4656.   You may ask "But why PostgreSQL ?" The answer is, since it takes lot
  4657.   more time to develop a database system from scratch, it makes sense to
  4658.   pick up a database system which satisfies the following conditions -
  4659.  
  4660.   A database system
  4661.  
  4662.   ∑  Whose source code is available - Must be a 'Open Source Code'
  4663.      system
  4664.  
  4665.   ∑  Has no license strings, no ownership strings attached to it
  4666.  
  4667.   ∑  Which can be distributed on internet
  4668.  
  4669.   ∑  Which had been on development for several years.
  4670.  
  4671.   ∑  Which satisfies standards like ISO/ANSI SQL 92 (and SQL 89)
  4672.  
  4673.   ∑  Which can satisfy future needs like SQL 3 (SQL 98)
  4674.  
  4675.   ∑  Which has advanced capabilities
  4676.  
  4677.      And it just happens to be 'PostgreSQL' which satisfies all these
  4678.      conditions and is an appropriate software for this situation.
  4679.  
  4680.   29.  FAQ - Questions on PostgreSQL
  4681.  
  4682.   Please refer to the latest version of FAQ for General, Linux and Irix
  4683.   at
  4684.  
  4685.   ∑  <http://www.postgresql.org/docs/faq-english.shtml>
  4686.  
  4687.   30.  Copyright Notice
  4688.  
  4689.   Copyright (c) 1997 Al Dev (Alavoor Vasudevan). All rights reserved.
  4690.  
  4691.   NO LIABILITY FOR CONSEQUENTIAL DAMAGES. In no event shall the author
  4692.   of this document be liable for any damages whatsoever (including
  4693.   without limitation, special, incidental, consequential, or
  4694.   direct/indirect damages for personal injury, loss of business profits,
  4695.   business interruption, loss of business information, or any other
  4696.   pecuniary loss) arising out of the use of this document.
  4697.  
  4698.   Author offers no warranties or guarantees on fitness, usability,
  4699.   merchantability of this document. Brands, companies and product names
  4700.   mentioned in this document are trademarks or registered trademarks of
  4701.   their respective holders.  Please refer to individual copyright
  4702.   notices of brands, companies and products mentioned in this document.
  4703.   It is your responsibility to read and understand the copyright notices
  4704.   of the organisations/companies/products/authors mentioned in this
  4705.   document before using their respective information.
  4706.  
  4707.   AE.  Appendix A - Syntax of ANSI/ISO SQL 1992
  4708.  
  4709.  
  4710.  
  4711.  
  4712.  
  4713.  
  4714.  
  4715.  
  4716.  
  4717.  
  4718.  
  4719.  
  4720.  
  4721.  
  4722.  
  4723.  
  4724.  
  4725.  
  4726.  
  4727.  
  4728.  
  4729.  
  4730.  
  4731.  
  4732.  
  4733.  
  4734.  
  4735.  
  4736.  
  4737.  
  4738.  
  4739.  
  4740.  
  4741.  
  4742.  
  4743.  
  4744.  
  4745.  
  4746.  
  4747.  
  4748.  
  4749.  
  4750.  
  4751.  
  4752.  
  4753.   This file contains a depth-first tree traversal of the BNF
  4754.   for the  language done at about 27-AUG-1992 11:03:41.64.
  4755.   The specific version of the BNF included here is:  ANSI-only, SQL2-only.
  4756.  
  4757.  
  4758.   <SQL terminal character> ::=
  4759.         <SQL language character>
  4760.       | <SQL embedded language character>
  4761.  
  4762.   <SQL language character> ::=
  4763.         <simple Latin letter>
  4764.       | <digit>
  4765.       | <SQL special character>
  4766.  
  4767.   <simple Latin letter> ::=
  4768.         <simple Latin upper case letter>
  4769.       | <simple Latin lower case letter>
  4770.  
  4771.   <simple Latin upper case letter> ::=
  4772.             A | B | C | D | E | F | G | H | I | J | K | L | M | N | O
  4773.       | P | Q | R | S | T | U | V | W | X | Y | Z
  4774.  
  4775.   <simple Latin lower case letter> ::=
  4776.             a | b | c | d | e | f | g | h | i | j | k | l | m | n | o
  4777.       | p | q | r | s | t | u | v | w | x | y | z
  4778.  
  4779.   <digit> ::=
  4780.       0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9
  4781.  
  4782.   <SQL special character> ::=
  4783.         <space>
  4784.       | <double quote>
  4785.       | <percent>
  4786.       | <ampersand>
  4787.       | <quote>
  4788.       | <left paren>
  4789.       | <right paren>
  4790.       | <asterisk>
  4791.       | <plus sign>
  4792.       | <comma>
  4793.       | <minus sign>
  4794.       | <period>
  4795.       | <solidus>
  4796.       | <colon>
  4797.       | <semicolon>
  4798.       | <less than operator>
  4799.       | <equals operator>
  4800.       | <greater than operator>
  4801.       | <question mark>
  4802.       | <underscore>
  4803.       | <vertical bar>
  4804.  
  4805.   <space> ::= !! <EMPHASIS>(space character in character set in use)
  4806.  
  4807.   <double quote> ::= "
  4808.  
  4809.   <percent> ::= %
  4810.  
  4811.   <ampersand> ::= &
  4812.  
  4813.   <quote> ::= '
  4814.  
  4815.   <left paren> ::= (
  4816.  
  4817.   <right paren> ::= )
  4818.  
  4819.   <asterisk> ::= *
  4820.  
  4821.   <plus sign> ::= +
  4822.  
  4823.   <comma> ::= ,
  4824.  
  4825.   <minus sign> ::= -
  4826.  
  4827.   <period> ::= .
  4828.  
  4829.   <solidus> ::= /
  4830.  
  4831.   <colon> ::= :
  4832.  
  4833.   <semicolon> ::= ;
  4834.  
  4835.   <less than operator> ::= <
  4836.  
  4837.   <equals operator> ::= =
  4838.  
  4839.   <greater than operator> ::= >
  4840.  
  4841.   <question mark> ::= ?
  4842.  
  4843.   <underscore> ::= _
  4844.  
  4845.   <vertical bar> ::= |
  4846.  
  4847.   <SQL embedded language character> ::=
  4848.         <left bracket>
  4849.       | <right bracket>
  4850.  
  4851.   <left bracket> ::= [
  4852.  
  4853.   <right bracket> ::= ]
  4854.  
  4855.   <token> ::=
  4856.         <nondelimiter token>
  4857.       | <delimiter token>
  4858.  
  4859.   <nondelimiter token> ::=
  4860.         <regular identifier>
  4861.       | <key word>
  4862.       | <unsigned numeric literal>
  4863.       | <national character string literal>
  4864.       | <bit string literal>
  4865.       | <hex string literal>
  4866.  
  4867.   <regular identifier> ::= <identifier body>
  4868.  
  4869.   <identifier body> ::=
  4870.       <identifier start> [ ( <underscore> | <identifier part> )... ]
  4871.  
  4872.   <identifier start> ::= <EMPHASIS>(!! See the Syntax Rules)
  4873.  
  4874.   <identifier part> ::=
  4875.         <identifier start>
  4876.       | <digit>
  4877.  
  4878.   <key word> ::=
  4879.         <reserved word>
  4880.       | <non-reserved word>
  4881.  
  4882.   <reserved word> ::=
  4883.         ABSOLUTE | ACTION | ADD | ALL
  4884.       | ALLOCATE | ALTER | AND
  4885.       | ANY | ARE
  4886.       | AS | ASC
  4887.       | ASSERTION | AT
  4888.       | AUTHORIZATION | AVG
  4889.       | BEGIN | BETWEEN | BIT | BIT_LENGTH
  4890.       | BOTH | BY
  4891.       | CASCADE | CASCADED | CASE | CAST
  4892.       | CATALOG
  4893.       | CHAR | CHARACTER | CHAR_LENGTH
  4894.       | CHARACTER_LENGTH | CHECK | CLOSE | COALESCE
  4895.       | COLLATE | COLLATION
  4896.       | COLUMN | COMMIT
  4897.       | CONNECT
  4898.       | CONNECTION | CONSTRAINT
  4899.       | CONSTRAINTS | CONTINUE
  4900.       | CONVERT | CORRESPONDING | COUNT | CREATE | CROSS
  4901.       | CURRENT
  4902.       | CURRENT_DATE | CURRENT_TIME
  4903.       | CURRENT_TIMESTAMP | CURRENT_USER | CURSOR
  4904.       | DATE | DAY | DEALLOCATE | DEC
  4905.       | DECIMAL | DECLARE | DEFAULT | DEFERRABLE
  4906.       | DEFERRED | DELETE | DESC | DESCRIBE | DESCRIPTOR
  4907.       | DIAGNOSTICS
  4908.       | DISCONNECT | DISTINCT | DOMAIN | DOUBLE | DROP
  4909.       | ELSE | END | END-EXEC | ESCAPE
  4910.       | EXCEPT | EXCEPTION
  4911.       | EXEC | EXECUTE | EXISTS
  4912.       | EXTERNAL | EXTRACT
  4913.       | FALSE | FETCH | FIRST | FLOAT | FOR
  4914.       | FOREIGN | FOUND | FROM | FULL
  4915.       | GET | GLOBAL | GO | GOTO
  4916.       | GRANT | GROUP
  4917.       | HAVING | HOUR
  4918.       | IDENTITY | IMMEDIATE | IN | INDICATOR
  4919.       | INITIALLY | INNER | INPUT
  4920.       | INSENSITIVE | INSERT | INT | INTEGER | INTERSECT
  4921.       | INTERVAL | INTO | IS
  4922.       | ISOLATION
  4923.       | JOIN
  4924.       | KEY
  4925.       | LANGUAGE | LAST | LEADING | LEFT
  4926.       | LEVEL | LIKE | LOCAL | LOWER
  4927.       | MATCH | MAX | MIN | MINUTE | MODULE
  4928.       | MONTH
  4929.       | NAMES | NATIONAL | NATURAL | NCHAR | NEXT | NO
  4930.       | NOT | NULL
  4931.       | NULLIF | NUMERIC
  4932.       | OCTET_LENGTH | OF
  4933.       | ON | ONLY | OPEN | OPTION | OR
  4934.       | ORDER | OUTER
  4935.       | OUTPUT | OVERLAPS
  4936.       | PAD | PARTIAL | POSITION | PRECISION | PREPARE
  4937.       | PRESERVE | PRIMARY
  4938.       | PRIOR | PRIVILEGES | PROCEDURE | PUBLIC
  4939.       | READ | REAL | REFERENCES | RELATIVE | RESTRICT
  4940.       | REVOKE | RIGHT
  4941.       | ROLLBACK | ROWS
  4942.       | SCHEMA | SCROLL | SECOND | SECTION
  4943.       | SELECT
  4944.       | SESSION | SESSION_USER | SET
  4945.       | SIZE | SMALLINT | SOME | SPACE | SQL | SQLCODE
  4946.       | SQLERROR | SQLSTATE
  4947.       | SUBSTRING | SUM | SYSTEM_USER
  4948.       | TABLE | TEMPORARY
  4949.       | THEN | TIME | TIMESTAMP
  4950.       | TIMEZONE_HOUR | TIMEZONE_MINUTE
  4951.       | TO | TRAILING | TRANSACTION
  4952.       | TRANSLATE | TRANSLATION | TRIM | TRUE
  4953.       | UNION | UNIQUE | UNKNOWN | UPDATE | UPPER | USAGE
  4954.       | USER | USING
  4955.       | VALUE | VALUES | VARCHAR | VARYING | VIEW
  4956.       | WHEN | WHENEVER | WHERE | WITH | WORK | WRITE
  4957.       | YEAR
  4958.       | ZONE
  4959.  
  4960.   <non-reserved word> ::=
  4961.  
  4962.         ADA
  4963.       | C | CATALOG_NAME
  4964.       | CHARACTER_SET_CATALOG | CHARACTER_SET_NAME
  4965.       | CHARACTER_SET_SCHEMA | CLASS_ORIGIN | COBOL | COLLATION_CATALOG
  4966.       | COLLATION_NAME | COLLATION_SCHEMA | COLUMN_NAME | COMMAND_FUNCTION
  4967.       | COMMITTED
  4968.       | CONDITION_NUMBER | CONNECTION_NAME | CONSTRAINT_CATALOG | CONSTRAINT_NAME
  4969.       | CONSTRAINT_SCHEMA | CURSOR_NAME
  4970.       | DATA | DATETIME_INTERVAL_CODE
  4971.       | DATETIME_INTERVAL_PRECISION | DYNAMIC_FUNCTION
  4972.       | FORTRAN
  4973.       | LENGTH
  4974.       | MESSAGE_LENGTH | MESSAGE_OCTET_LENGTH | MESSAGE_TEXT | MORE | MUMPS
  4975.       | NAME | NULLABLE | NUMBER
  4976.       | PASCAL | PLI
  4977.       | REPEATABLE | RETURNED_LENGTH | RETURNED_OCTET_LENGTH | RETURNED_SQLSTATE
  4978.       | ROW_COUNT
  4979.       | SCALE | SCHEMA_NAME | SERIALIZABLE | SERVER_NAME | SUBCLASS_ORIGIN
  4980.       | TABLE_NAME | TYPE
  4981.       | UNCOMMITTED | UNNAMED
  4982.  
  4983.   <unsigned numeric literal> ::=
  4984.         <exact numeric literal>
  4985.       | <approximate numeric literal>
  4986.  
  4987.   <exact numeric literal> ::=
  4988.         <unsigned integer> [ <period> [ <unsigned integer> ] ]
  4989.       | <period> <unsigned integer>
  4990.  
  4991.   <unsigned integer> ::= <digit>...
  4992.  
  4993.   <approximate numeric literal> ::= <mantissa> E <exponent>
  4994.  
  4995.   <mantissa> ::= <exact numeric literal>
  4996.  
  4997.   <exponent> ::= <signed integer>
  4998.  
  4999.   <signed integer> ::= [ <sign> ] <unsigned integer>
  5000.  
  5001.   <sign> ::= <plus sign> | <minus sign>
  5002.  
  5003.   <national character string literal> ::=
  5004.       N <quote> [ <character representation>... ] <quote>
  5005.         [ ( <separator>... <quote> [ <character representation>... ] <quote> )... ]
  5006.  
  5007.   <character representation> ::=
  5008.         <nonquote character>
  5009.       | <quote symbol>
  5010.  
  5011.   <nonquote character> ::= !! <EMPHASIS>(See the Syntax Rules.)
  5012.  
  5013.   <quote symbol> ::= <quote><quote>
  5014.  
  5015.   <separator> ::= ( <comment> | <space> | <newline> )...
  5016.  
  5017.   <comment> ::=
  5018.       <comment introducer> [ <comment character>... ] <newline>
  5019.  
  5020.   <comment introducer> ::= <minus sign><minus sign>[<minus sign>...]
  5021.  
  5022.   <comment character> ::=
  5023.         <nonquote character>
  5024.       | <quote>
  5025.  
  5026.   <newline> ::= !! <EMPHASIS>(implementation-defined end-of-line indicator)
  5027.  
  5028.   <bit string literal> ::=
  5029.       B <quote> [ <bit>... ] <quote>
  5030.         [ ( <separator>... <quote> [ <bit>... ] <quote> )... ]
  5031.  
  5032.   <bit> ::= 0 | 1
  5033.  
  5034.   <hex string literal> ::=
  5035.       X <quote> [ <hexit>... ] <quote>
  5036.         [ ( <separator>... <quote> [ <hexit>... ] <quote> )... ]
  5037.  
  5038.   <hexit> ::= <digit> | A | B | C | D | E | F | a | b | c | d | e | f
  5039.  
  5040.   <delimiter token> ::=
  5041.         <character string literal>
  5042.       | <date string>
  5043.       | <time string>
  5044.       | <timestamp string>
  5045.       | <interval string>
  5046.       | <delimited identifier>
  5047.       | <SQL special character>
  5048.       | <not equals operator>
  5049.       | <greater than or equals operator>
  5050.       | <less than or equals operator>
  5051.       | <concatenation operator>
  5052.       | <double period>
  5053.       | <left bracket>
  5054.       | <right bracket>
  5055.  
  5056.   <character string literal> ::=
  5057.       [ <introducer><character set specification> ]
  5058.       <quote> [ <character representation>... ] <quote>
  5059.         [ ( <separator>... <quote> [ <character representation>... ] <quote> )... ]
  5060.  
  5061.   <introducer> ::= <underscore>
  5062.  
  5063.   <character set specification> ::=
  5064.         <standard character repertoire name>
  5065.       | <implementation-defined character repertoire name>
  5066.       | <user-defined character repertoire name>
  5067.       | <standard universal character form-of-use name>
  5068.       | <implementation-defined universal character form-of-use name>
  5069.  
  5070.   <standard character repertoire name> ::= <character set name>
  5071.  
  5072.   <character set name> ::= [ <schema name> <period> ]
  5073.         <SQL language identifier>
  5074.  
  5075.   <schema name> ::=
  5076.       [ <catalog name> <period> ] <unqualified schema name>
  5077.  
  5078.   <catalog name> ::= <identifier>
  5079.  
  5080.   <identifier> ::=
  5081.       [ <introducer><character set specification> ] <actual identifier>
  5082.  
  5083.   <actual identifier> ::=
  5084.         <regular identifier>
  5085.       | <delimited identifier>
  5086.  
  5087.   <delimited identifier> ::=
  5088.       <double quote> <delimited identifier body> <double quote>
  5089.  
  5090.   <delimited identifier body> ::= <delimited identifier part>...
  5091.  
  5092.   <delimited identifier part> ::=
  5093.         <nondoublequote character>
  5094.       | <doublequote symbol>
  5095.  
  5096.   <nondoublequote character> ::= <EMPHASIS>(!! See the Syntax Rules)
  5097.  
  5098.   <doublequote symbol> ::= <double quote><double quote>
  5099.  
  5100.   <unqualified schema name> ::= <identifier>
  5101.  
  5102.   <SQL language identifier> ::=
  5103.       <SQL language identifier start>
  5104.          [ ( <underscore> | <SQL language identifier part> )... ]
  5105.  
  5106.   <SQL language identifier start> ::= <simple Latin letter>
  5107.  
  5108.   <SQL language identifier part> ::=
  5109.         <simple Latin letter>
  5110.       | <digit>
  5111.  
  5112.   <implementation-defined character repertoire name> ::=
  5113.       <character set name>
  5114.  
  5115.   <user-defined character repertoire name> ::= <character set name>
  5116.  
  5117.   <standard universal character form-of-use name> ::=
  5118.       <character set name>
  5119.  
  5120.   <implementation-defined universal character form-of-use name> ::=
  5121.       <character set name>
  5122.  
  5123.   <date string> ::=
  5124.       <quote> <date value> <quote>
  5125.  
  5126.   <date value> ::=
  5127.       <years value> <minus sign> <months value>
  5128.           <minus sign> <days value>
  5129.  
  5130.   <years value> ::= <datetime value>
  5131.  
  5132.   <datetime value> ::= <unsigned integer>
  5133.  
  5134.   <months value> ::= <datetime value>
  5135.  
  5136.   <days value> ::= <datetime value>
  5137.  
  5138.   <time string> ::=
  5139.       <quote> <time value> [ <time zone interval> ] <quote>
  5140.  
  5141.   <time value> ::=
  5142.       <hours value> <colon> <minutes value> <colon> <seconds value>
  5143.  
  5144.   <hours value> ::= <datetime value>
  5145.  
  5146.   <minutes value> ::= <datetime value>
  5147.  
  5148.   <seconds value> ::=
  5149.         <seconds integer value> [ <period> [ <seconds fraction> ] ]
  5150.  
  5151.   <seconds integer value> ::= <unsigned integer>
  5152.  
  5153.   <seconds fraction> ::= <unsigned integer>
  5154.  
  5155.   <time zone interval> ::=
  5156.       <sign> <hours value> <colon> <minutes value>
  5157.  
  5158.   <timestamp string> ::=
  5159.       <quote> <date value> <space> <time value>
  5160.           [ <time zone interval> ] <quote>
  5161.  
  5162.   <interval string> ::=
  5163.       <quote> ( <year-month literal> | <day-time literal> ) <quote>
  5164.  
  5165.   <year-month literal> ::=
  5166.         <years value>
  5167.       | [ <years value> <minus sign> ] <months value>
  5168.  
  5169.   <day-time literal> ::=
  5170.         <day-time interval>
  5171.       | <time interval>
  5172.  
  5173.   <day-time interval> ::=
  5174.       <days value>
  5175.         [ <space> <hours value> [ <colon> <minutes value>
  5176.           [ <colon> <seconds value> ] ] ]
  5177.  
  5178.   <time interval> ::=
  5179.         <hours value> [ <colon> <minutes value> [ <colon> <seconds value> ] ]
  5180.       | <minutes value> [ <colon> <seconds value> ]
  5181.       | <seconds value>
  5182.  
  5183.   <not equals operator> ::= <>
  5184.  
  5185.   <greater than or equals operator> ::= >=
  5186.  
  5187.   <less than or equals operator> ::= <=
  5188.  
  5189.   <concatenation operator> ::= ||
  5190.  
  5191.   <double period> ::= ..
  5192.  
  5193.   <module> ::=
  5194.       <module name clause>
  5195.       <language clause>
  5196.       <module authorization clause>
  5197.       [ <temporary table declaration>... ]
  5198.       <module contents>...
  5199.  
  5200.   <module name clause> ::=
  5201.       MODULE [ <module name> ]
  5202.         [ <module character set specification> ]
  5203.  
  5204.   <module name> ::= <identifier>
  5205.  
  5206.   <module character set specification> ::=
  5207.       NAMES ARE <character set specification>
  5208.  
  5209.   <language clause> ::=
  5210.       LANGUAGE <language name>
  5211.  
  5212.   <language name> ::=
  5213.       ADA | C | COBOL | FORTRAN | MUMPS | PASCAL | PLI
  5214.  
  5215.   <module authorization clause> ::=
  5216.         SCHEMA <schema name>
  5217.       | AUTHORIZATION <module authorization identifier>
  5218.       | SCHEMA <schema name>
  5219.             AUTHORIZATION <module authorization identifier>
  5220.  
  5221.   <module authorization identifier> ::=
  5222.       <authorization identifier>
  5223.  
  5224.   <authorization identifier> ::= <identifier>
  5225.  
  5226.   <temporary table declaration> ::=
  5227.       DECLARE LOCAL TEMPORARY TABLE
  5228.           <qualified local table name>
  5229.         <table element list>
  5230.         [ ON COMMIT ( PRESERVE | DELETE ) ROWS ]
  5231.  
  5232.   <qualified local table name> ::=
  5233.       MODULE <period> <local table name>
  5234.  
  5235.   <local table name> ::= <qualified identifier>
  5236.  
  5237.   <qualified identifier> ::= <identifier>
  5238.  
  5239.   <table element list> ::=
  5240.         <left paren> <table element> [ ( <comma> <table element> )... ] <right paren>
  5241.  
  5242.   <table element> ::=
  5243.         <column definition>
  5244.       | <table constraint definition>
  5245.  
  5246.   <column definition> ::=
  5247.       <column name> ( <data type> | <domain name> )
  5248.       [ <default clause> ]
  5249.       [ <column constraint definition>... ]
  5250.       [ <collate clause> ]
  5251.  
  5252.   <column name> ::= <identifier>
  5253.  
  5254.   <data type> ::=
  5255.         <character string type>
  5256.              [ CHARACTER SET <character set specification> ]
  5257.       | <national character string type>
  5258.       | <bit string type>
  5259.       | <numeric type>
  5260.       | <datetime type>
  5261.       | <interval type>
  5262.  
  5263.   <character string type> ::=
  5264.         CHARACTER [ <left paren> <length> <right paren> ]
  5265.       | CHAR [ <left paren> <length> <right paren> ]
  5266.       | CHARACTER VARYING <left paren> <length> <right paren>
  5267.       | CHAR VARYING <left paren> <length> <right paren>
  5268.       | VARCHAR <left paren> <length> <right paren>
  5269.  
  5270.   <length> ::= <unsigned integer>
  5271.  
  5272.   <national character string type> ::=
  5273.         NATIONAL CHARACTER [ <left paren> <length> <right paren> ]
  5274.       | NATIONAL CHAR [ <left paren> <length> <right paren> ]
  5275.       | NCHAR [ <left paren> <length> <right paren> ]
  5276.       | NATIONAL CHARACTER VARYING <left paren> <length> <right paren>
  5277.       | NATIONAL CHAR VARYING <left paren> <length> <right paren>
  5278.       | NCHAR VARYING <left paren> <length> <right paren>
  5279.  
  5280.   <bit string type> ::=
  5281.         BIT [ <left paren> <length> <right paren> ]
  5282.       | BIT VARYING <left paren> <length> <right paren>
  5283.  
  5284.   <numeric type> ::=
  5285.         <exact numeric type>
  5286.       | <approximate numeric type>
  5287.  
  5288.   <exact numeric type> ::=
  5289.         NUMERIC [ <left paren> <precision> [ <comma> <scale> ] <right paren> ]
  5290.       | DECIMAL [ <left paren> <precision> [ <comma> <scale> ] <right paren> ]
  5291.       | DEC [ <left paren> <precision> [ <comma> <scale> ] <right paren> ]
  5292.       | INTEGER
  5293.       | INT
  5294.       | SMALLINT
  5295.  
  5296.   <precision> ::= <unsigned integer>
  5297.  
  5298.   <scale> ::= <unsigned integer>
  5299.  
  5300.   <approximate numeric type> ::=
  5301.         FLOAT [ <left paren> <precision> <right paren> ]
  5302.       | REAL
  5303.       | DOUBLE PRECISION
  5304.  
  5305.   <datetime type> ::=
  5306.         DATE
  5307.       | TIME [ <left paren> <time precision> <right paren> ]
  5308.             [ WITH TIME ZONE ]
  5309.       | TIMESTAMP [ <left paren> <timestamp precision> <right paren> ]
  5310.             [ WITH TIME ZONE ]
  5311.  
  5312.   <time precision> ::= <time fractional seconds precision>
  5313.  
  5314.   <time fractional seconds precision> ::= <unsigned integer>
  5315.  
  5316.   <timestamp precision> ::= <time fractional seconds precision>
  5317.  
  5318.   <interval type> ::= INTERVAL <interval qualifier>
  5319.  
  5320.   <interval qualifier> ::=
  5321.         <start field> TO <end field>
  5322.       | <single datetime field>
  5323.  
  5324.   <start field> ::=
  5325.       <non-second datetime field>
  5326.           [ <left paren> <interval leading field precision> <right paren> ]
  5327.  
  5328.   <non-second datetime field> ::= YEAR | MONTH | DAY | HOUR
  5329.       | MINUTE
  5330.  
  5331.   <interval leading field precision> ::= <unsigned integer>
  5332.  
  5333.   <end field> ::=
  5334.         <non-second datetime field>
  5335.       | SECOND [ <left paren> <interval fractional seconds precision> <right paren> ]
  5336.  
  5337.   <interval fractional seconds precision> ::= <unsigned integer>
  5338.  
  5339.   <single datetime field> ::=
  5340.         <non-second datetime field>
  5341.             [ <left paren> <interval leading field precision> <right paren> ]
  5342.       | SECOND [ <left paren> <interval leading field precision>
  5343.             [ <comma> <interval fractional seconds precision> ] <right paren> ]
  5344.  
  5345.   <domain name> ::= <qualified name>
  5346.  
  5347.   <qualified name> ::=
  5348.       [ <schema name> <period> ] <qualified identifier>
  5349.  
  5350.   <default clause> ::=
  5351.         DEFAULT <default option>
  5352.  
  5353.   <default option> ::=
  5354.         <literal>
  5355.       | <datetime value function>
  5356.       | USER
  5357.       | CURRENT_USER
  5358.       | SESSION_USER
  5359.       | SYSTEM_USER
  5360.       | NULL
  5361.  
  5362.   <literal> ::=
  5363.         <signed numeric literal>
  5364.       | <general literal>
  5365.  
  5366.   <signed numeric literal> ::=
  5367.       [ <sign> ] <unsigned numeric literal>
  5368.  
  5369.   <general literal> ::=
  5370.         <character string literal>
  5371.       | <national character string literal>
  5372.       | <bit string literal>
  5373.       | <hex string literal>
  5374.       | <datetime literal>
  5375.       | <interval literal>
  5376.  
  5377.   <datetime literal> ::=
  5378.         <date literal>
  5379.       | <time literal>
  5380.       | <timestamp literal>
  5381.  
  5382.   <date literal> ::=
  5383.       DATE <date string>
  5384.  
  5385.   <time literal> ::=
  5386.       TIME <time string>
  5387.  
  5388.   <timestamp literal> ::=
  5389.       TIMESTAMP <timestamp string>
  5390.  
  5391.   <interval literal> ::=
  5392.       INTERVAL [ <sign> ] <interval string> <interval qualifier>
  5393.  
  5394.   <datetime value function> ::=
  5395.         <current date value function>
  5396.       | <current time value function>
  5397.       | <current timestamp value function>
  5398.  
  5399.   <current date value function> ::= CURRENT_DATE
  5400.  
  5401.   <current time value function> ::=
  5402.         CURRENT_TIME [ <left paren> <time precision> <right paren> ]
  5403.  
  5404.   <current timestamp value function> ::=
  5405.         CURRENT_TIMESTAMP [ <left paren> <timestamp precision> <right paren> ]
  5406.  
  5407.   <column constraint definition> ::=
  5408.       [ <constraint name definition> ]
  5409.       <column constraint>
  5410.         [ <constraint attributes> ]
  5411.  
  5412.   <constraint name definition> ::= CONSTRAINT <constraint name>
  5413.   <constraint name> ::= <qualified name>
  5414.  
  5415.   <column constraint> ::=
  5416.         NOT NULL
  5417.       | <unique specification>
  5418.       | <references specification>
  5419.       | <check constraint definition>
  5420.  
  5421.   <unique specification> ::=
  5422.       UNIQUE | PRIMARY KEY
  5423.  
  5424.   <references specification> ::=
  5425.       REFERENCES <referenced table and columns>
  5426.         [ MATCH <match type> ]
  5427.         [ <referential triggered action> ]
  5428.  
  5429.   <referenced table and columns> ::=
  5430.        <table name> [ <left paren> <reference column list> <right paren> ]
  5431.  
  5432.   <table name> ::=
  5433.         <qualified name>
  5434.       | <qualified local table name>
  5435.  
  5436.   <reference column list> ::= <column name list>
  5437.  
  5438.   <column name list> ::=
  5439.       <column name> [ ( <comma> <column name> )... ]
  5440.  
  5441.   <match type> ::=
  5442.         FULL
  5443.       | PARTIAL
  5444.  
  5445.   <referential triggered action> ::=
  5446.         <update rule> [ <delete rule> ]
  5447.       | <delete rule> [ <update rule> ]
  5448.  
  5449.   <update rule> ::= ON UPDATE <referential action>
  5450.  
  5451.   <referential action> ::=
  5452.         CASCADE
  5453.       | SET NULL
  5454.       | SET DEFAULT
  5455.       | NO ACTION
  5456.  
  5457.   <delete rule> ::= ON DELETE <referential action>
  5458.  
  5459.   <check constraint definition> ::=
  5460.       CHECK
  5461.           <left paren> <search condition> <right paren>
  5462.  
  5463.   <search condition> ::=
  5464.         <boolean term>
  5465.       | <search condition> OR <boolean term>
  5466.  
  5467.   <boolean term> ::=
  5468.         <boolean factor>
  5469.       | <boolean term> AND <boolean factor>
  5470.  
  5471.   <boolean factor> ::=
  5472.       [ NOT ] <boolean test>
  5473.  
  5474.   <boolean test> ::=
  5475.       <boolean primary> [ IS [ NOT ]
  5476.             <truth value> ]
  5477.  
  5478.   <boolean primary> ::=
  5479.         <predicate>
  5480.       | <left paren> <search condition> <right paren>
  5481.  
  5482.   <predicate> ::=
  5483.         <comparison predicate>
  5484.       | <between predicate>
  5485.       | <in predicate>
  5486.       | <like predicate>
  5487.       | <null predicate>
  5488.       | <quantified comparison predicate>
  5489.       | <exists predicate>
  5490.       | <unique predicate>
  5491.       | <match predicate>
  5492.       | <overlaps predicate>
  5493.  
  5494.   <comparison predicate> ::=
  5495.       <row value constructor> <comp op>
  5496.           <row value constructor>
  5497.  
  5498.   <row value constructor> ::=
  5499.          <row value constructor element>
  5500.       | <left paren> <row value constructor list> <right paren>
  5501.       | <row subquery>
  5502.  
  5503.   <row value constructor element> ::=
  5504.         <value expression>
  5505.       | <null specification>
  5506.       | <default specification>
  5507.  
  5508.   <value expression> ::=
  5509.         <numeric value expression>
  5510.       | <string value expression>
  5511.       | <datetime value expression>
  5512.       | <interval value expression>
  5513.  
  5514.   <numeric value expression> ::=
  5515.         <term>
  5516.       | <numeric value expression> <plus sign> <term>
  5517.       | <numeric value expression> <minus sign> <term>
  5518.  
  5519.   <term> ::=
  5520.         <factor>
  5521.       | <term> <asterisk> <factor>
  5522.       | <term> <solidus> <factor>
  5523.  
  5524.   <factor> ::=
  5525.       [ <sign> ] <numeric primary>
  5526.  
  5527.   <numeric primary> ::=
  5528.         <value expression primary>
  5529.       | <numeric value function>
  5530.  
  5531.   <value expression primary> ::=
  5532.         <unsigned value specification>
  5533.       | <column reference>
  5534.       | <set function specification>
  5535.       | <scalar subquery>
  5536.       | <case expression>
  5537.       | <left paren> <value expression> <right paren>
  5538.       | <cast specification>
  5539.  
  5540.   <unsigned value specification> ::=
  5541.         <unsigned literal>
  5542.       | <general value specification>
  5543.  
  5544.   <unsigned literal> ::=
  5545.         <unsigned numeric literal>
  5546.       | <general literal>
  5547.  
  5548.   <general value specification> ::=
  5549.         <parameter specification>
  5550.       | <dynamic parameter specification>
  5551.       | <variable specification>
  5552.       | USER
  5553.       | CURRENT_USER
  5554.       | SESSION_USER
  5555.       | SYSTEM_USER
  5556.       | VALUE
  5557.  
  5558.   <parameter specification> ::=
  5559.       <parameter name> [ <indicator parameter> ]
  5560.  
  5561.   <parameter name> ::= <colon> <identifier>
  5562.  
  5563.   <indicator parameter> ::=
  5564.       [ INDICATOR ] <parameter name>
  5565.  
  5566.   <dynamic parameter specification> ::= <question mark>
  5567.  
  5568.   <variable specification> ::=
  5569.       <embedded variable name> [ <indicator variable> ]
  5570.  
  5571.   <embedded variable name> ::=
  5572.       <colon><host identifier>
  5573.  
  5574.   <host identifier> ::=
  5575.         <Ada host identifier>
  5576.       | <C host identifier>
  5577.       | <COBOL host identifier>
  5578.       | <Fortran host identifier>
  5579.       | <MUMPS host identifier>
  5580.       | <Pascal host identifier>
  5581.       | <PL/I host identifier>
  5582.  
  5583.   <Ada host identifier> ::= !! <EMPHASIS>(See the Syntax Rules.)
  5584.  
  5585.   <C host identifier> ::=
  5586.       !! <EMPHASIS>(See the Syntax Rules.)
  5587.  
  5588.   <COBOL host identifier> ::= !! <EMPHASIS>(See the Syntax Rules.)
  5589.  
  5590.   <Fortran host identifier> ::= !! <EMPHASIS>(See the Syntax Rules.)
  5591.  
  5592.   <MUMPS host identifier> ::= !! <EMPHASIS>(See the Syntax Rules.)
  5593.  
  5594.   <Pascal host identifier> ::= !! <EMPHASIS>(See the Syntax Rules.)
  5595.  
  5596.   <PL/I host identifier> ::= !! <EMPHASIS>(See the Syntax Rules.)
  5597.  
  5598.   <indicator variable> ::=
  5599.       [ INDICATOR ] <embedded variable name>
  5600.  
  5601.   <column reference> ::= [ <qualifier> <period> ] <column name>
  5602.  
  5603.   <qualifier> ::=
  5604.         <table name>
  5605.       | <correlation name>
  5606.  
  5607.   <correlation name> ::= <identifier>
  5608.  
  5609.   <set function specification> ::=
  5610.         COUNT <left paren> <asterisk> <right paren>
  5611.       | <general set function>
  5612.  
  5613.   <general set function> ::=
  5614.         <set function type>
  5615.             <left paren> [ <set quantifier> ] <value expression> <right paren>
  5616.  
  5617.   <set function type> ::=
  5618.       AVG | MAX | MIN | SUM | COUNT
  5619.  
  5620.   <set quantifier> ::= DISTINCT | ALL
  5621.  
  5622.   <scalar subquery> ::= <subquery>
  5623.  
  5624.   <subquery> ::= <left paren> <query expression> <right paren>
  5625.  
  5626.   <query expression> ::=
  5627.         <non-join query expression>
  5628.       | <joined table>
  5629.  
  5630.   <non-join query expression> ::=
  5631.         <non-join query term>
  5632.       | <query expression> UNION  [ ALL ]
  5633.             [ <corresponding spec> ] <query term>
  5634.       | <query expression> EXCEPT [ ALL ]
  5635.             [ <corresponding spec> ] <query term>
  5636.  
  5637.   <non-join query term> ::=
  5638.         <non-join query primary>
  5639.       | <query term> INTERSECT [ ALL ]
  5640.             [ <corresponding spec> ] <query primary>
  5641.  
  5642.   <non-join query primary> ::=
  5643.         <simple table>
  5644.       | <left paren> <non-join query expression> <right paren>
  5645.  
  5646.   <simple table> ::=
  5647.         <query specification>
  5648.       | <table value constructor>
  5649.       | <explicit table>
  5650.  
  5651.   <query specification> ::=
  5652.       SELECT [ <set quantifier> ] <select list> <table expression>
  5653.  
  5654.   <select list> ::=
  5655.         <asterisk>
  5656.       | <select sublist> [ ( <comma> <select sublist> )... ]
  5657.  
  5658.   <select sublist> ::=
  5659.         <derived column>
  5660.       | <qualifier> <period> <asterisk>
  5661.  
  5662.   <derived column> ::= <value expression> [ <as clause> ]
  5663.  
  5664.   <as clause> ::= [ AS ] <column name>
  5665.  
  5666.   <table expression> ::=
  5667.       <from clause>
  5668.       [ <where clause> ]
  5669.       [ <group by clause> ]
  5670.       [ <having clause> ]
  5671.  
  5672.   <from clause> ::= FROM <table reference>
  5673.       [ ( <comma> <table reference> )... ]
  5674.  
  5675.   <table reference> ::=
  5676.         <table name> [ [ AS ] <correlation name>
  5677.             [ <left paren> <derived column list> <right paren> ] ]
  5678.       | <derived table> [ AS ] <correlation name>
  5679.             [ <left paren> <derived column list> <right paren> ]
  5680.       | <joined table>
  5681.  
  5682.   <derived column list> ::= <column name list>
  5683.  
  5684.   <derived table> ::= <table subquery>
  5685.  
  5686.   <table subquery> ::= <subquery>
  5687.  
  5688.   <joined table> ::=
  5689.         <cross join>
  5690.       | <qualified join>
  5691.       | <left paren> <joined table> <right paren>
  5692.  
  5693.   <cross join> ::=
  5694.       <table reference> CROSS JOIN <table reference>
  5695.  
  5696.   <qualified join> ::=
  5697.       <table reference> [ NATURAL ] [ <join type> ] JOIN
  5698.         <table reference> [ <join specification> ]
  5699.  
  5700.   <join type> ::=
  5701.         INNER
  5702.       | <outer join type> [ OUTER ]
  5703.       | UNION
  5704.  
  5705.   <outer join type> ::=
  5706.         LEFT
  5707.       | RIGHT
  5708.       | FULL
  5709.  
  5710.   <join specification> ::=
  5711.         <join condition>
  5712.       | <named columns join>
  5713.  
  5714.   <join condition> ::= ON <search condition>
  5715.  
  5716.   <named columns join> ::=
  5717.       USING <left paren> <join column list> <right paren>
  5718.  
  5719.   <join column list> ::= <column name list>
  5720.  
  5721.   <where clause> ::= WHERE <search condition>
  5722.  
  5723.   <group by clause> ::=
  5724.       GROUP BY <grouping column reference list>
  5725.  
  5726.   <grouping column reference list> ::=
  5727.       <grouping column reference>
  5728.           [ ( <comma> <grouping column reference> )... ]
  5729.  
  5730.   <grouping column reference> ::=
  5731.       <column reference> [ <collate clause> ]
  5732.  
  5733.   <collate clause> ::= COLLATE <collation name>
  5734.  
  5735.   <collation name> ::= <qualified name>
  5736.  
  5737.   <having clause> ::= HAVING <search condition>
  5738.  
  5739.   <table value constructor> ::=
  5740.       VALUES <table value constructor list>
  5741.  
  5742.   <table value constructor list> ::=
  5743.       <row value constructor> [ ( <comma> <row value constructor> )... ]
  5744.  
  5745.   <explicit table> ::= TABLE <table name>
  5746.  
  5747.   <query term> ::=
  5748.         <non-join query term>
  5749.       | <joined table>
  5750.  
  5751.   <corresponding spec> ::=
  5752.       CORRESPONDING [ BY <left paren> <corresponding column list> <right paren> ]
  5753.  
  5754.   <corresponding column list> ::= <column name list>
  5755.  
  5756.   <query primary> ::=
  5757.         <non-join query primary>
  5758.       | <joined table>
  5759.  
  5760.   <case expression> ::=
  5761.         <case abbreviation>
  5762.       | <case specification>
  5763.  
  5764.   <case abbreviation> ::=
  5765.         NULLIF <left paren> <value expression> <comma>
  5766.               <value expression> <right paren>
  5767.       | COALESCE <left paren> <value expression>
  5768.               ( <comma> <value expression> )... <right paren>
  5769.  
  5770.   <case specification> ::=
  5771.         <simple case>
  5772.       | <searched case>
  5773.  
  5774.   <simple case> ::=
  5775.       CASE <case operand>
  5776.         <simple when clause>...
  5777.         [ <else clause> ]
  5778.       END
  5779.  
  5780.   <case operand> ::= <value expression>
  5781.  
  5782.   <simple when clause> ::= WHEN <when operand> THEN <result>
  5783.  
  5784.   <when operand> ::= <value expression>
  5785.  
  5786.   <result> ::= <result expression> | NULL
  5787.  
  5788.   <result expression> ::= <value expression>
  5789.  
  5790.   <else clause> ::= ELSE <result>
  5791.  
  5792.   <searched case> ::=
  5793.       CASE
  5794.         <searched when clause>...
  5795.         [ <else clause> ]
  5796.       END
  5797.  
  5798.   <searched when clause> ::= WHEN <search condition> THEN <result>
  5799.  
  5800.   <cast specification> ::=
  5801.       CAST <left paren> <cast operand> AS
  5802.           <cast target> <right paren>
  5803.  
  5804.   <cast operand> ::=
  5805.         <value expression>
  5806.       | NULL
  5807.  
  5808.   <cast target> ::=
  5809.         <domain name>
  5810.       | <data type>
  5811.  
  5812.   <numeric value function> ::=
  5813.         <position expression>
  5814.       | <extract expression>
  5815.       | <length expression>
  5816.  
  5817.   <position expression> ::=
  5818.       POSITION <left paren> <character value expression>
  5819.           IN <character value expression> <right paren>
  5820.  
  5821.   <character value expression> ::=
  5822.         <concatenation>
  5823.       | <character factor>
  5824.  
  5825.   <concatenation> ::=
  5826.       <character value expression> <concatenation operator>
  5827.           <character factor>
  5828.  
  5829.   <character factor> ::=
  5830.       <character primary> [ <collate clause> ]
  5831.  
  5832.   <character primary> ::=
  5833.         <value expression primary>
  5834.       | <string value function>
  5835.  
  5836.   <string value function> ::=
  5837.         <character value function>
  5838.       | <bit value function>
  5839.  
  5840.   <character value function> ::=
  5841.         <character substring function>
  5842.       | <fold>
  5843.       | <form-of-use conversion>
  5844.       | <character translation>
  5845.       | <trim function>
  5846.  
  5847.   <character substring function> ::=
  5848.       SUBSTRING <left paren> <character value expression> FROM <start position>
  5849.                   [ FOR <string length> ] <right paren>
  5850.  
  5851.   <start position> ::= <numeric value expression>
  5852.  
  5853.   <string length> ::= <numeric value expression>
  5854.  
  5855.   <fold> ::= ( UPPER | LOWER )
  5856.        <left paren> <character value expression> <right paren>
  5857.  
  5858.   <form-of-use conversion> ::=
  5859.       CONVERT <left paren> <character value expression>
  5860.           USING <form-of-use conversion name> <right paren>
  5861.  
  5862.   <form-of-use conversion name> ::= <qualified name>
  5863.  
  5864.   <character translation> ::=
  5865.       TRANSLATE <left paren> <character value expression>
  5866.           USING <translation name> <right paren>
  5867.  
  5868.   <translation name> ::= <qualified name>
  5869.  
  5870.   <trim function> ::=
  5871.       TRIM <left paren> <trim operands> <right paren>
  5872.  
  5873.   <trim operands> ::=
  5874.       [ [ <trim specification> ] [ <trim character> ] FROM ] <trim source>
  5875.   <trim specification> ::=
  5876.         LEADING
  5877.       | TRAILING
  5878.       | BOTH
  5879.  
  5880.   <trim character> ::= <character value expression>
  5881.  
  5882.   <trim source> ::= <character value expression>
  5883.  
  5884.   <bit value function> ::=
  5885.       <bit substring function>
  5886.  
  5887.   <bit substring function> ::=
  5888.       SUBSTRING <left paren> <bit value expression> FROM <start position>
  5889.           [ FOR <string length> ] <right paren>
  5890.  
  5891.   <bit value expression> ::=
  5892.         <bit concatenation>
  5893.       | <bit factor>
  5894.  
  5895.   <bit concatenation> ::=
  5896.       <bit value expression> <concatenation operator> <bit factor>
  5897.  
  5898.   <bit factor> ::= <bit primary>
  5899.  
  5900.   <bit primary> ::=
  5901.         <value expression primary>
  5902.       | <string value function>
  5903.  
  5904.   <extract expression> ::=
  5905.       EXTRACT <left paren> <extract field>
  5906.           FROM <extract source> <right paren>
  5907.  
  5908.   <extract field> ::=
  5909.         <datetime field>
  5910.       | <time zone field>
  5911.  
  5912.   <datetime field> ::=
  5913.         <non-second datetime field>
  5914.       | SECOND
  5915.  
  5916.   <time zone field> ::=
  5917.         TIMEZONE_HOUR
  5918.       | TIMEZONE_MINUTE
  5919.  
  5920.   <extract source> ::=
  5921.         <datetime value expression>
  5922.       | <interval value expression>
  5923.  
  5924.   <datetime value expression> ::=
  5925.         <datetime term>
  5926.       | <interval value expression> <plus sign> <datetime term>
  5927.       | <datetime value expression> <plus sign> <interval term>
  5928.       | <datetime value expression> <minus sign> <interval term>
  5929.  
  5930.   <interval term> ::=
  5931.         <interval factor>
  5932.       | <interval term 2> <asterisk> <factor>
  5933.       | <interval term 2> <solidus> <factor>
  5934.       | <term> <asterisk> <interval factor>
  5935.  
  5936.   <interval factor> ::=
  5937.       [ <sign> ] <interval primary>
  5938.  
  5939.   <interval primary> ::=
  5940.         <value expression primary> [ <interval qualifier> ]
  5941.   <interval term 2> ::= <interval term>
  5942.  
  5943.   <interval value expression> ::=
  5944.         <interval term>
  5945.       | <interval value expression 1> <plus sign> <interval term 1>
  5946.       | <interval value expression 1> <minus sign> <interval term 1>
  5947.       | <left paren> <datetime value expression> <minus sign>
  5948.             <datetime term> <right paren> <interval qualifier>
  5949.  
  5950.   <interval value expression 1> ::= <interval value expression>
  5951.  
  5952.   <interval term 1> ::= <interval term>
  5953.  
  5954.   <datetime term> ::=
  5955.         <datetime factor>
  5956.  
  5957.   <datetime factor> ::=
  5958.         <datetime primary> [ <time zone> ]
  5959.  
  5960.   <datetime primary> ::=
  5961.         <value expression primary>
  5962.       | <datetime value function>
  5963.  
  5964.   <time zone> ::=
  5965.       AT <time zone specifier>
  5966.  
  5967.   <time zone specifier> ::=
  5968.         LOCAL
  5969.       | TIME ZONE <interval value expression>
  5970.  
  5971.   <length expression> ::=
  5972.         <char length expression>
  5973.       | <octet length expression>
  5974.       | <bit length expression>
  5975.  
  5976.   <char length expression> ::=
  5977.       ( CHAR_LENGTH | CHARACTER_LENGTH )
  5978.           <left paren> <string value expression> <right paren>
  5979.  
  5980.   <string value expression> ::=
  5981.         <character value expression>
  5982.       | <bit value expression>
  5983.  
  5984.   <octet length expression> ::=
  5985.       OCTET_LENGTH <left paren> <string value expression> <right paren>
  5986.  
  5987.   <bit length expression> ::=
  5988.       BIT_LENGTH <left paren> <string value expression> <right paren>
  5989.  
  5990.   <null specification> ::=
  5991.       NULL
  5992.  
  5993.   <default specification> ::=
  5994.       DEFAULT
  5995.  
  5996.   <row value constructor list> ::=
  5997.       <row value constructor element>
  5998.           [ ( <comma> <row value constructor element> )... ]
  5999.  
  6000.   <row subquery> ::= <subquery>
  6001.  
  6002.   <comp op> ::=
  6003.         <equals operator>
  6004.       | <not equals operator>
  6005.       | <less than operator>
  6006.       | <greater than operator>
  6007.       | <less than or equals operator>
  6008.       | <greater than or equals operator>
  6009.  
  6010.   <between predicate> ::=
  6011.       <row value constructor> [ NOT ] BETWEEN
  6012.         <row value constructor> AND <row value constructor>
  6013.  
  6014.   <in predicate> ::=
  6015.       <row value constructor>
  6016.         [ NOT ] IN <in predicate value>
  6017.  
  6018.   <in predicate value> ::=
  6019.         <table subquery>
  6020.       | <left paren> <in value list> <right paren>
  6021.  
  6022.   <in value list> ::=
  6023.       <value expression> ( <comma> <value expression> )...
  6024.  
  6025.   <like predicate> ::=
  6026.       <match value> [ NOT ] LIKE <pattern>
  6027.         [ ESCAPE <escape character> ]
  6028.  
  6029.   <match value> ::= <character value expression>
  6030.  
  6031.   <pattern> ::= <character value expression>
  6032.  
  6033.   <escape character> ::= <character value expression>
  6034.  
  6035.   <null predicate> ::= <row value constructor>
  6036.       IS [ NOT ] NULL
  6037.  
  6038.   <quantified comparison predicate> ::=
  6039.       <row value constructor> <comp op> <quantifier> <table subquery>
  6040.  
  6041.   <quantifier> ::= <all> | <some>
  6042.  
  6043.   <all> ::= ALL
  6044.  
  6045.   <some> ::= SOME | ANY
  6046.  
  6047.   <exists predicate> ::= EXISTS <table subquery>
  6048.  
  6049.   <unique predicate> ::= UNIQUE <table subquery>
  6050.  
  6051.   <match predicate> ::=
  6052.       <row value constructor> MATCH [ UNIQUE ]
  6053.           [ PARTIAL | FULL ] <table subquery>
  6054.  
  6055.   <overlaps predicate> ::=
  6056.       <row value constructor 1> OVERLAPS <row value constructor 2>
  6057.  
  6058.   <row value constructor 1> ::= <row value constructor>
  6059.  
  6060.   <row value constructor 2> ::= <row value constructor>
  6061.  
  6062.   <truth value> ::=
  6063.         TRUE
  6064.       | FALSE
  6065.       | UNKNOWN
  6066.  
  6067.   <constraint attributes> ::=
  6068.         <constraint check time> [ [ NOT ] DEFERRABLE ]
  6069.       | [ NOT ] DEFERRABLE [ <constraint check time> ]
  6070.  
  6071.   <constraint check time> ::=
  6072.         INITIALLY DEFERRED
  6073.       | INITIALLY IMMEDIATE
  6074.  
  6075.   <table constraint definition> ::=
  6076.       [ <constraint name definition> ]
  6077.       <table constraint> [ <constraint attributes> ]
  6078.  
  6079.   <table constraint> ::=
  6080.         <unique constraint definition>
  6081.       | <referential constraint definition>
  6082.       | <check constraint definition>
  6083.  
  6084.   <unique constraint definition> ::=
  6085.               <unique specification> even in SQL3)
  6086.       <unique specification>
  6087.         <left paren> <unique column list> <right paren>
  6088.  
  6089.   <unique column list> ::= <column name list>
  6090.  
  6091.   <referential constraint definition> ::=
  6092.       FOREIGN KEY
  6093.           <left paren> <referencing columns> <right paren>
  6094.         <references specification>
  6095.  
  6096.   <referencing columns> ::=
  6097.       <reference column list>
  6098.  
  6099.   <module contents> ::=
  6100.         <declare cursor>
  6101.       | <dynamic declare cursor>
  6102.       | <procedure>
  6103.  
  6104.   <declare cursor> ::=
  6105.       DECLARE <cursor name> [ INSENSITIVE ] [ SCROLL ] CURSOR
  6106.         FOR <cursor specification>
  6107.  
  6108.   <cursor name> ::= <identifier>
  6109.  
  6110.   <cursor specification> ::=
  6111.       <query expression> [ <order by clause> ]
  6112.         [ <updatability clause> ]
  6113.  
  6114.   <order by clause> ::=
  6115.       ORDER BY <sort specification list>
  6116.  
  6117.   <sort specification list> ::=
  6118.       <sort specification> [ ( <comma> <sort specification> )... ]
  6119.  
  6120.   <sort specification> ::=
  6121.       <sort key> [ <collate clause> ] [ <ordering specification> ]
  6122.  
  6123.   <sort key> ::=
  6124.         <column name>
  6125.       | <unsigned integer>
  6126.  
  6127.   <ordering specification> ::= ASC | DESC
  6128.  
  6129.   <updatability clause> ::=
  6130.       FOR
  6131.           ( READ ONLY |
  6132.             UPDATE [ OF <column name list> ] )
  6133.  
  6134.   <dynamic declare cursor> ::=
  6135.       DECLARE <cursor name> [ INSENSITIVE ] [ SCROLL ] CURSOR
  6136.           FOR <statement name>
  6137.  
  6138.   <statement name> ::= <identifier>
  6139.   <procedure> ::=
  6140.       PROCEDURE <procedure name>
  6141.           <parameter declaration list> <semicolon>
  6142.         <SQL procedure statement> <semicolon>
  6143.  
  6144.   <procedure name> ::= <identifier>
  6145.  
  6146.   <parameter declaration list> ::=
  6147.         <left paren> <parameter declaration>
  6148.             [ ( <comma> <parameter declaration> )... ] <right paren>
  6149.       | <parameter declaration>...
  6150.  
  6151.   <parameter declaration> ::=
  6152.         <parameter name> <data type>
  6153.       | <status parameter>
  6154.  
  6155.   <status parameter> ::=
  6156.       SQLCODE | SQLSTATE
  6157.  
  6158.   <SQL procedure statement> ::=
  6159.         <SQL schema statement>
  6160.       | <SQL data statement>
  6161.       | <SQL transaction statement>
  6162.       | <SQL connection statement>
  6163.       | <SQL session statement>
  6164.       | <SQL dynamic statement>
  6165.       | <SQL diagnostics statement>
  6166.  
  6167.   <SQL schema statement> ::=
  6168.         <SQL schema definition statement>
  6169.       | <SQL schema manipulation statement>
  6170.  
  6171.   <SQL schema definition statement> ::=
  6172.         <schema definition>
  6173.       | <table definition>
  6174.       | <view definition>
  6175.       | <grant statement>
  6176.       | <domain definition>
  6177.       | <character set definition>
  6178.       | <collation definition>
  6179.       | <translation definition>
  6180.       | <assertion definition>
  6181.  
  6182.   <schema definition> ::=
  6183.       CREATE SCHEMA <schema name clause>
  6184.         [ <schema character set specification> ]
  6185.         [ <schema element>... ]
  6186.  
  6187.   <schema name clause> ::=
  6188.         <schema name>
  6189.       | AUTHORIZATION <schema authorization identifier>
  6190.       | <schema name> AUTHORIZATION
  6191.             <schema authorization identifier>
  6192.  
  6193.   <schema authorization identifier> ::=
  6194.       <authorization identifier>
  6195.  
  6196.   <schema character set specification> ::=
  6197.       DEFAULT CHARACTER
  6198.           SET <character set specification>
  6199.  
  6200.   <schema element> ::=
  6201.         <domain definition>
  6202.       | <table definition>
  6203.       | <view definition>
  6204.       | <grant statement>
  6205.       | <assertion definition>
  6206.       | <character set definition>
  6207.       | <collation definition>
  6208.       | <translation definition>
  6209.  
  6210.   <domain definition> ::=
  6211.       CREATE DOMAIN <domain name>
  6212.           [ AS ] <data type>
  6213.         [ <default clause> ]
  6214.         [ <domain constraint>... ]
  6215.         [ <collate clause> ]
  6216.  
  6217.   <domain constraint> ::=
  6218.       [ <constraint name definition> ]
  6219.       <check constraint definition> [ <constraint attributes> ]
  6220.  
  6221.   <table definition> ::=
  6222.       CREATE [ ( GLOBAL | LOCAL ) TEMPORARY ] TABLE
  6223.           <table name>
  6224.         <table element list>
  6225.         [ ON COMMIT ( DELETE | PRESERVE ) ROWS ]
  6226.  
  6227.   <view definition> ::=
  6228.       CREATE VIEW <table name> [ <left paren> <view column list>
  6229.                                     <right paren> ]
  6230.         AS <query expression>
  6231.         [ WITH [ <levels clause> ] CHECK OPTION ]
  6232.  
  6233.   <view column list> ::= <column name list>
  6234.  
  6235.   <levels clause> ::=
  6236.       CASCADED | LOCAL
  6237.  
  6238.   <grant statement> ::=
  6239.      GRANT <privileges> ON <object name>
  6240.        TO <grantee> [ ( <comma> <grantee> )... ]
  6241.          [ WITH GRANT OPTION ]
  6242.  
  6243.   <privileges> ::=
  6244.         ALL PRIVILEGES
  6245.       | <action list>
  6246.  
  6247.   <action list> ::= <action> [ ( <comma> <action> )... ]
  6248.  
  6249.   <action> ::=
  6250.         SELECT
  6251.       | DELETE
  6252.       | INSERT [ <left paren> <privilege column list> <right paren> ]
  6253.       | UPDATE [ <left paren> <privilege column list> <right paren> ]
  6254.       | REFERENCES [ <left paren> <privilege column list> <right paren> ]
  6255.       | USAGE
  6256.  
  6257.   <privilege column list> ::= <column name list>
  6258.  
  6259.   <object name> ::=
  6260.         [ TABLE ] <table name>
  6261.       | DOMAIN <domain name>
  6262.       | COLLATION <collation name>
  6263.       | CHARACTER SET <character set name>
  6264.       | TRANSLATION <translation name>
  6265.  
  6266.   <grantee> ::=
  6267.         PUBLIC
  6268.       | <authorization identifier>
  6269.  
  6270.   <assertion definition> ::=
  6271.       CREATE ASSERTION <constraint name> <assertion check>
  6272.         [ <constraint attributes> ]
  6273.  
  6274.   <assertion check> ::=
  6275.       CHECK
  6276.           <left paren> <search condition> <right paren>
  6277.  
  6278.   <character set definition> ::=
  6279.       CREATE CHARACTER SET <character set name>
  6280.           [ AS ]
  6281.         <character set source>
  6282.         [ <collate clause> | <limited collation definition> ]
  6283.  
  6284.   <character set source> ::=
  6285.         GET <existing character set name>
  6286.  
  6287.   <existing character set name> ::=
  6288.         <standard character repertoire name>
  6289.       | <implementation-defined character repertoire name>
  6290.       | <schema character set name>
  6291.  
  6292.   <schema character set name> ::= <character set name>
  6293.  
  6294.   <limited collation definition> ::=
  6295.       COLLATION FROM <collation source>
  6296.  
  6297.   <collation source> ::=
  6298.         <collating sequence definition>
  6299.       | <translation collation>
  6300.  
  6301.   <collating sequence definition> ::=
  6302.         <external collation>
  6303.       | <schema collation name>
  6304.       | DESC <left paren> <collation name> <right paren>
  6305.       | DEFAULT
  6306.  
  6307.   <external collation> ::=
  6308.       EXTERNAL <left paren> <quote> <external collation name> <quote> <right paren>
  6309.  
  6310.   <external collation name> ::=
  6311.         <standard collation name>
  6312.       | <implementation-defined collation name>
  6313.  
  6314.   <standard collation name> ::= <collation name>
  6315.  
  6316.   <implementation-defined collation name> ::= <collation name>
  6317.  
  6318.   <schema collation name> ::= <collation name>
  6319.  
  6320.   <translation collation> ::=
  6321.       TRANSLATION <translation name>
  6322.           [ THEN COLLATION <collation name> ]
  6323.  
  6324.   <collation definition> ::=
  6325.       CREATE COLLATION <collation name> FOR
  6326.           <character set specification>
  6327.         FROM <collation source>
  6328.           [ <pad attribute> ]
  6329.  
  6330.   <pad attribute> ::=
  6331.         NO PAD
  6332.       | PAD SPACE
  6333.  
  6334.   <translation definition> ::=
  6335.       CREATE TRANSLATION <translation name>
  6336.         FOR <source character set specification>
  6337.           TO <target character set specification>
  6338.         FROM <translation source>
  6339.  
  6340.   <source character set specification> ::= <character set specification>
  6341.  
  6342.   <target character set specification> ::= <character set specification>
  6343.  
  6344.   <translation source> ::=
  6345.         <translation specification>
  6346.  
  6347.   <translation specification> ::=
  6348.         <external translation>
  6349.       | IDENTITY
  6350.       | <schema translation name>
  6351.  
  6352.   <external translation> ::=
  6353.       EXTERNAL <left paren> <quote> <external translation name> <quote> <right paren>
  6354.  
  6355.   <external translation name> ::=
  6356.         <standard translation name>
  6357.       | <implementation-defined translation name>
  6358.  
  6359.   <standard translation name> ::= <translation name>
  6360.  
  6361.   <implementation-defined translation name> ::= <translation name>
  6362.  
  6363.   <schema translation name> ::= <translation name>
  6364.  
  6365.   <SQL schema manipulation statement> ::=
  6366.         <drop schema statement>
  6367.       | <alter table statement>
  6368.       | <drop table statement>
  6369.       | <drop view statement>
  6370.       | <revoke statement>
  6371.       | <alter domain statement>
  6372.       | <drop domain statement>
  6373.       | <drop character set statement>
  6374.       | <drop collation statement>
  6375.       | <drop translation statement>
  6376.       | <drop assertion statement>
  6377.  
  6378.   <drop schema statement> ::=
  6379.       DROP SCHEMA <schema name> <drop behavior>
  6380.  
  6381.   <drop behavior> ::= CASCADE | RESTRICT
  6382.  
  6383.   <alter table statement> ::=
  6384.       ALTER TABLE <table name> <alter table action>
  6385.  
  6386.   <alter table action> ::=
  6387.         <add column definition>
  6388.       | <alter column definition>
  6389.       | <drop column definition>
  6390.       | <add table constraint definition>
  6391.       | <drop table constraint definition>
  6392.  
  6393.   <add column definition> ::=
  6394.       ADD [ COLUMN ] <column definition>
  6395.  
  6396.   <alter column definition> ::=
  6397.       ALTER [ COLUMN ] <column name> <alter column action>
  6398.  
  6399.   <alter column action> ::=
  6400.         <set column default clause>
  6401.       | <drop column default clause>
  6402.  
  6403.   <set column default clause> ::=
  6404.       SET <default clause>
  6405.  
  6406.   <drop column default clause> ::=
  6407.       DROP DEFAULT
  6408.  
  6409.   <drop column definition> ::=
  6410.       DROP [ COLUMN ] <column name> <drop behavior>
  6411.  
  6412.   <add table constraint definition> ::=
  6413.       ADD <table constraint definition>
  6414.  
  6415.   <drop table constraint definition> ::=
  6416.       DROP CONSTRAINT <constraint name> <drop behavior>
  6417.  
  6418.   <drop table statement> ::=
  6419.       DROP TABLE <table name> <drop behavior>
  6420.  
  6421.   <drop view statement> ::=
  6422.       DROP VIEW <table name> <drop behavior>
  6423.  
  6424.   <revoke statement> ::=
  6425.       REVOKE [ GRANT OPTION FOR ]
  6426.           <privileges>
  6427.           ON <object name>
  6428.         FROM <grantee> [ ( <comma> <grantee> )... ] <drop behavior>
  6429.  
  6430.   <alter domain statement> ::=
  6431.       ALTER DOMAIN <domain name> <alter domain action>
  6432.  
  6433.   <alter domain action> ::=
  6434.         <set domain default clause>
  6435.       | <drop domain default clause>
  6436.       | <add domain constraint definition>
  6437.       | <drop domain constraint definition>
  6438.  
  6439.   <set domain default clause> ::= SET <default clause>
  6440.  
  6441.   <drop domain default clause> ::= DROP DEFAULT
  6442.  
  6443.   <add domain constraint definition> ::=
  6444.       ADD <domain constraint>
  6445.  
  6446.   <drop domain constraint definition> ::=
  6447.       DROP CONSTRAINT <constraint name>
  6448.  
  6449.   <drop domain statement> ::=
  6450.       DROP DOMAIN <domain name> <drop behavior>
  6451.  
  6452.   <drop character set statement> ::=
  6453.       DROP CHARACTER SET <character set name>
  6454.  
  6455.   <drop collation statement> ::=
  6456.       DROP COLLATION <collation name>
  6457.  
  6458.   <drop translation statement> ::=
  6459.       DROP TRANSLATION <translation name>
  6460.  
  6461.   <drop assertion statement> ::=
  6462.       DROP ASSERTION <constraint name>
  6463.  
  6464.   <SQL data statement> ::=
  6465.         <open statement>
  6466.       | <fetch statement>
  6467.       | <close statement>
  6468.       | <select statement: single row>
  6469.       | <SQL data change statement>
  6470.  
  6471.   <open statement> ::=
  6472.       OPEN <cursor name>
  6473.  
  6474.   <fetch statement> ::=
  6475.       FETCH [ [ <fetch orientation> ] FROM ]
  6476.         <cursor name> INTO <fetch target list>
  6477.  
  6478.   <fetch orientation> ::=
  6479.         NEXT
  6480.       | PRIOR
  6481.       | FIRST
  6482.       | LAST
  6483.       | ( ABSOLUTE | RELATIVE ) <simple value specification>
  6484.  
  6485.   <simple value specification> ::=
  6486.         <parameter name>
  6487.       | <embedded variable name>
  6488.       | <literal>
  6489.  
  6490.   <fetch target list> ::=
  6491.       <target specification> [ ( <comma> <target specification> )... ]
  6492.  
  6493.   <target specification> ::=
  6494.         <parameter specification>
  6495.       | <variable specification>
  6496.  
  6497.   <close statement> ::=
  6498.       CLOSE <cursor name>
  6499.  
  6500.   <select statement: single row> ::=
  6501.       SELECT [ <set quantifier> ] <select list>
  6502.         INTO <select target list>
  6503.           <table expression>
  6504.  
  6505.   <select target list> ::=
  6506.       <target specification> [ ( <comma> <target specification> )... ]
  6507.  
  6508.   <SQL data change statement> ::=
  6509.         <delete statement: positioned>
  6510.       | <delete statement: searched>
  6511.       | <insert statement>
  6512.       | <update statement: positioned>
  6513.       | <update statement: searched>
  6514.  
  6515.   <delete statement: positioned> ::=
  6516.       DELETE FROM <table name>
  6517.         WHERE CURRENT OF <cursor name>
  6518.  
  6519.   <delete statement: searched> ::=
  6520.       DELETE FROM <table name>
  6521.         [ WHERE <search condition> ]
  6522.  
  6523.   <insert statement> ::=
  6524.       INSERT INTO <table name>
  6525.         <insert columns and source>
  6526.  
  6527.   <insert columns and source> ::=
  6528.         [ <left paren> <insert column list> <right paren> ]
  6529.               <query expression>
  6530.       | DEFAULT VALUES
  6531.  
  6532.   <insert column list> ::= <column name list>
  6533.  
  6534.   <update statement: positioned> ::=
  6535.       UPDATE <table name>
  6536.         SET <set clause list>
  6537.           WHERE CURRENT OF <cursor name>
  6538.  
  6539.   <set clause list> ::=
  6540.       <set clause> [ ( <comma> <set clause> )... ]
  6541.  
  6542.   <set clause> ::=
  6543.       <object column> <equals operator> <update source>
  6544.  
  6545.   <object column> ::= <column name>
  6546.  
  6547.   <update source> ::=
  6548.         <value expression>
  6549.       | <null specification>
  6550.       | DEFAULT
  6551.  
  6552.   <update statement: searched> ::=
  6553.       UPDATE <table name>
  6554.         SET <set clause list>
  6555.         [ WHERE <search condition> ]
  6556.  
  6557.   <SQL transaction statement> ::=
  6558.         <set transaction statement>
  6559.       | <set constraints mode statement>
  6560.       | <commit statement>
  6561.       | <rollback statement>
  6562.  
  6563.   <set transaction statement> ::=
  6564.       SET TRANSACTION <transaction mode>
  6565.           [ ( <comma> <transaction mode> )... ]
  6566.  
  6567.   <transaction mode> ::=
  6568.         <isolation level>
  6569.       | <transaction access mode>
  6570.       | <diagnostics size>
  6571.  
  6572.   <isolation level> ::=
  6573.       ISOLATION LEVEL <level of isolation>
  6574.  
  6575.   <level of isolation> ::=
  6576.         READ UNCOMMITTED
  6577.       | READ COMMITTED
  6578.       | REPEATABLE READ
  6579.       | SERIALIZABLE
  6580.  
  6581.   <transaction access mode> ::=
  6582.         READ ONLY
  6583.       | READ WRITE
  6584.  
  6585.   <diagnostics size> ::=
  6586.       DIAGNOSTICS SIZE <number of conditions>
  6587.  
  6588.   <number of conditions> ::= <simple value specification>
  6589.  
  6590.   <set constraints mode statement> ::=
  6591.       SET CONSTRAINTS <constraint name list>
  6592.           ( DEFERRED | IMMEDIATE )
  6593.  
  6594.   <constraint name list> ::=
  6595.         ALL
  6596.       | <constraint name> [ ( <comma> <constraint name> )... ]
  6597.  
  6598.   <commit statement> ::=
  6599.       COMMIT [ WORK ]
  6600.  
  6601.   <rollback statement> ::=
  6602.       ROLLBACK [ WORK ]
  6603.  
  6604.   <SQL connection statement> ::=
  6605.         <connect statement>
  6606.       | <set connection statement>
  6607.       | <disconnect statement>
  6608.  
  6609.   <connect statement> ::=
  6610.       CONNECT TO <connection target>
  6611.  
  6612.   <connection target> ::=
  6613.         <SQL-server name>
  6614.           [ AS <connection name> ]
  6615.             correspondence with Tony Gordon)
  6616.           [ USER <user name> ]
  6617.       | DEFAULT
  6618.  
  6619.   <SQL-server name> ::= <simple value specification>
  6620.  
  6621.   <connection name> ::= <simple value specification>
  6622.  
  6623.   <user name> ::= <simple value specification>
  6624.  
  6625.   <set connection statement> ::=
  6626.       SET CONNECTION <connection object>
  6627.  
  6628.   <connection object> ::=
  6629.         DEFAULT
  6630.       | <connection name>
  6631.  
  6632.   <disconnect statement> ::=
  6633.       DISCONNECT <disconnect object>
  6634.  
  6635.   <disconnect object> ::=
  6636.         <connection object>
  6637.       | ALL
  6638.       | CURRENT
  6639.  
  6640.   <SQL session statement> ::=
  6641.         <set catalog statement>
  6642.       | <set schema statement>
  6643.       | <set names statement>
  6644.       | <set session authorization identifier statement>
  6645.       | <set local time zone statement>
  6646.  
  6647.   <set catalog statement> ::=
  6648.       SET CATALOG <value specification>
  6649.  
  6650.   <value specification> ::=
  6651.         <literal>
  6652.       | <general value specification>
  6653.  
  6654.   <set schema statement> ::=
  6655.       SET SCHEMA <value specification>
  6656.  
  6657.   <set names statement> ::=
  6658.       SET NAMES <value specification>
  6659.  
  6660.   <set session authorization identifier statement> ::=
  6661.       SET SESSION AUTHORIZATION
  6662.           <value specification>
  6663.  
  6664.   <set local time zone statement> ::=
  6665.       SET TIME ZONE
  6666.           <set time zone value>
  6667.   <set time zone value> ::=
  6668.         <interval value expression>
  6669.       | LOCAL
  6670.  
  6671.   <SQL dynamic statement> ::=
  6672.         <system descriptor statement>
  6673.       | <prepare statement>
  6674.       | <deallocate prepared statement>
  6675.       | <describe statement>
  6676.       | <execute statement>
  6677.       | <execute immediate statement>
  6678.       | <SQL dynamic data statement>
  6679.  
  6680.   <system descriptor statement> ::=
  6681.         <allocate descriptor statement>
  6682.       | <deallocate descriptor statement>
  6683.       | <set descriptor statement>
  6684.       | <get descriptor statement>
  6685.  
  6686.   <allocate descriptor statement> ::=
  6687.       ALLOCATE DESCRIPTOR <descriptor name>
  6688.          [ WITH MAX <occurrences> ]
  6689.  
  6690.   <descriptor name> ::=
  6691.       [ <scope option> ] <simple value specification>
  6692.  
  6693.   <scope option> ::=
  6694.         GLOBAL
  6695.       | LOCAL
  6696.  
  6697.   <occurrences> ::= <simple value specification>
  6698.  
  6699.   <deallocate descriptor statement> ::=
  6700.       DEALLOCATE DESCRIPTOR <descriptor name>
  6701.  
  6702.   <set descriptor statement> ::=
  6703.       SET DESCRIPTOR <descriptor name>
  6704.           <set descriptor information>
  6705.  
  6706.   <set descriptor information> ::=
  6707.         <set count>
  6708.       | VALUE <item number>
  6709.           <set item information> [ ( <comma> <set item information> )... ]
  6710.  
  6711.   <set count> ::=
  6712.       COUNT <equals operator> <simple value specification 1>
  6713.  
  6714.   <simple value specification 1> ::= <simple value specification>
  6715.  
  6716.   <item number> ::= <simple value specification>
  6717.  
  6718.   <set item information> ::=
  6719.       <descriptor item name> <equals operator> <simple value specification 2>
  6720.  
  6721.   <descriptor item name> ::=
  6722.         TYPE
  6723.       | LENGTH
  6724.       | OCTET_LENGTH
  6725.       | RETURNED_LENGTH
  6726.       | RETURNED_OCTET_LENGTH
  6727.       | PRECISION
  6728.       | SCALE
  6729.       | DATETIME_INTERVAL_CODE
  6730.       | DATETIME_INTERVAL_PRECISION
  6731.       | NULLABLE
  6732.       | INDICATOR
  6733.       | DATA
  6734.       | NAME
  6735.       | UNNAMED
  6736.       | COLLATION_CATALOG
  6737.       | COLLATION_SCHEMA
  6738.       | COLLATION_NAME
  6739.       | CHARACTER_SET_CATALOG
  6740.       | CHARACTER_SET_SCHEMA
  6741.       | CHARACTER_SET_NAME
  6742.  
  6743.   <simple value specification 2> ::= <simple value specification>
  6744.  
  6745.   <item number> ::= <simple value specification>
  6746.  
  6747.   <get descriptor statement> ::=
  6748.       GET DESCRIPTOR <descriptor name> <get descriptor information>
  6749.  
  6750.   <get descriptor information> ::=
  6751.         <get count>
  6752.       | VALUE <item number>
  6753.           <get item information> [ ( <comma> <get item information> )... ]
  6754.  
  6755.   <get count> ::=
  6756.       <simple target specification 1> <equals operator>
  6757.            COUNT
  6758.  
  6759.   <simple target specification 1> ::= <simple target specification>
  6760.  
  6761.   <simple target specification> ::=
  6762.         <parameter name>
  6763.       | <embedded variable name>
  6764.  
  6765.   <get item information> ::=
  6766.       <simple target specification 2> <equals operator> <descriptor item name>>
  6767.  
  6768.   <simple target specification 2> ::= <simple target specification>
  6769.  
  6770.   <prepare statement> ::=
  6771.       PREPARE <SQL statement name> FROM <SQL statement variable>
  6772.  
  6773.   <SQL statement name> ::=
  6774.         <statement name>
  6775.       | <extended statement name>
  6776.  
  6777.   <extended statement name> ::=
  6778.       [ <scope option> ] <simple value specification>
  6779.  
  6780.   <SQL statement variable> ::= <simple value specification>
  6781.  
  6782.   <deallocate prepared statement> ::=
  6783.       DEALLOCATE PREPARE <SQL statement name>
  6784.  
  6785.   <describe statement> ::=
  6786.         <describe input statement>
  6787.       | <describe output statement>
  6788.  
  6789.   <describe input statement> ::=
  6790.       DESCRIBE INPUT <SQL statement name> <using descriptor>
  6791.  
  6792.   <using descriptor> ::=
  6793.       ( USING | INTO ) SQL DESCRIPTOR <descriptor name>
  6794.  
  6795.   <describe output statement> ::=
  6796.       DESCRIBE [ OUTPUT ] <SQL statement name> <using descriptor>
  6797.  
  6798.   <execute statement> ::=
  6799.       EXECUTE <SQL statement name>
  6800.         [ <result using clause> ]
  6801.         [ <parameter using clause> ]
  6802.  
  6803.   <result using clause> ::= <using clause>
  6804.  
  6805.   <using clause> ::=
  6806.         <using arguments>
  6807.       | <using descriptor>
  6808.  
  6809.   <using arguments> ::=
  6810.       ( USING | INTO ) <argument> [ ( <comma> <argument> )... ]
  6811.  
  6812.   <argument> ::= <target specification>
  6813.  
  6814.   <parameter using clause> ::= <using clause>
  6815.  
  6816.   <execute immediate statement> ::=
  6817.       EXECUTE IMMEDIATE <SQL statement variable>
  6818.  
  6819.   <SQL dynamic data statement> ::=
  6820.         <allocate cursor statement>
  6821.       | <dynamic open statement>
  6822.       | <dynamic fetch statement>
  6823.       | <dynamic close statement>
  6824.       | <dynamic delete statement: positioned>
  6825.       | <dynamic update statement: positioned>
  6826.  
  6827.   <allocate cursor statement> ::=
  6828.       ALLOCATE <extended cursor name> [ INSENSITIVE ]
  6829.           [ SCROLL ] CURSOR
  6830.         FOR <extended statement name>
  6831.  
  6832.   <extended cursor name> ::=
  6833.       [ <scope option> ] <simple value specification>
  6834.  
  6835.   <dynamic open statement> ::=
  6836.       OPEN <dynamic cursor name> [ <using clause> ]
  6837.  
  6838.   <dynamic cursor name> ::=
  6839.         <cursor name>
  6840.       | <extended cursor name>
  6841.  
  6842.   <dynamic fetch statement> ::=
  6843.       FETCH [ [ <fetch orientation> ] FROM ] <dynamic cursor name>
  6844.           <using clause>
  6845.  
  6846.   <dynamic close statement> ::=
  6847.       CLOSE <dynamic cursor name>
  6848.  
  6849.   <dynamic delete statement: positioned> ::=
  6850.       DELETE FROM <table name>
  6851.         WHERE CURRENT OF
  6852.             <dynamic cursor name>
  6853.  
  6854.   <dynamic update statement: positioned> ::=
  6855.       UPDATE <table name>
  6856.         SET <set clause>
  6857.             [ ( <comma> <set clause> )... ]
  6858.           WHERE CURRENT OF
  6859.               <dynamic cursor name>
  6860.  
  6861.   <SQL diagnostics statement> ::=
  6862.       <get diagnostics statement>
  6863.  
  6864.   <get diagnostics statement> ::=
  6865.       GET DIAGNOSTICS <sql diagnostics information>
  6866.  
  6867.   <sql diagnostics information> ::=
  6868.         <statement information>
  6869.       | <condition information>
  6870.  
  6871.   <statement information> ::=
  6872.       <statement information item> [ ( <comma> <statement information item> )... ]
  6873.  
  6874.   <statement information item> ::=
  6875.       <simple target specification> <equals operator> <statement information item name>
  6876.  
  6877.   <statement information item name> ::=
  6878.         NUMBER
  6879.       | MORE
  6880.       | COMMAND_FUNCTION
  6881.       | DYNAMIC_FUNCTION
  6882.       | ROW_COUNT
  6883.  
  6884.   <condition information> ::=
  6885.       EXCEPTION <condition number>
  6886.         <condition information item> [ ( <comma> <condition information item> )... ]
  6887.  
  6888.   <condition number> ::= <simple value specification>
  6889.  
  6890.   <condition information item> ::=
  6891.       <simple target specification> <equals operator> <condition information item name>
  6892.  
  6893.   <condition information item name> ::=
  6894.         CONDITION_NUMBER
  6895.       | RETURNED_SQLSTATE
  6896.       | CLASS_ORIGIN
  6897.       | SUBCLASS_ORIGIN
  6898.       | SERVER_NAME
  6899.       | CONNECTION_NAME
  6900.       | CONSTRAINT_CATALOG
  6901.       | CONSTRAINT_SCHEMA
  6902.       | CONSTRAINT_NAME
  6903.       | CATALOG_NAME
  6904.       | SCHEMA_NAME
  6905.       | TABLE_NAME
  6906.       | COLUMN_NAME
  6907.       | CURSOR_NAME
  6908.       | MESSAGE_TEXT
  6909.       | MESSAGE_LENGTH
  6910.       | MESSAGE_OCTET_LENGTH
  6911.  
  6912.   <embedded SQL host program> ::=
  6913.         <embedded SQL Ada program>
  6914.       | <embedded SQL C program>
  6915.       | <embedded SQL COBOL program>
  6916.       | <embedded SQL Fortran program>
  6917.       | <embedded SQL MUMPS program>
  6918.       | <embedded SQL Pascal program>
  6919.       | <embedded SQL PL/I program>
  6920.  
  6921.   <embedded SQL Ada program> ::= !! <EMPHASIS>(See the Syntax Rules.)
  6922.  
  6923.   <embedded SQL C program> ::=
  6924.         !! <EMPHASIS>(See the Syntax Rules.)
  6925.  
  6926.   <embedded SQL COBOL program> ::= !! <EMPHASIS>(See the Syntax Rules.)
  6927.  
  6928.   <embedded SQL Fortran program> ::=
  6929.       !! <EMPHASIS>(See the Syntax Rules.)
  6930.  
  6931.   <embedded SQL MUMPS program> ::= !! <EMPHASIS>(See the Syntax Rules.)
  6932.  
  6933.   <embedded SQL Pascal program> ::=
  6934.       !! <EMPHASIS>(See the Syntax Rules.)
  6935.  
  6936.   <embedded SQL PL/I program> ::= !! <EMPHASIS>(See the Syntax Rules.)
  6937.  
  6938.   <embedded SQL declare section> ::=
  6939.         <embedded SQL begin declare>
  6940.           [ <embedded character set declaration> ]
  6941.           [ <host variable definition>... ]
  6942.         <embedded SQL end declare>
  6943.       | <embedded SQL MUMPS declare>
  6944.  
  6945.   <embedded SQL begin declare> ::=
  6946.       <SQL prefix> BEGIN DECLARE SECTION
  6947.           [ <SQL terminator> ]
  6948.  
  6949.   <SQL prefix> ::=
  6950.         EXEC SQL
  6951.       | <ampersand>SQL<left paren>
  6952.  
  6953.   <SQL terminator> ::=
  6954.         END-EXEC
  6955.       | <semicolon>
  6956.       | <right paren>
  6957.  
  6958.   <embedded character set declaration> ::=
  6959.       SQL NAMES ARE <character set specification>
  6960.  
  6961.   <host variable definition> ::=
  6962.         <Ada variable definition>
  6963.       | <C variable definition>
  6964.       | <COBOL variable definition>
  6965.       | <Fortran variable definition>
  6966.       | <MUMPS variable definition>
  6967.       | <Pascal variable definition>
  6968.       | <PL/I variable definition>
  6969.  
  6970.   <Ada variable definition> ::=
  6971.       <Ada host identifier> [ ( <comma> <Ada host identifier> )... ] :
  6972.       <Ada type specification> [ <Ada initial value> ]
  6973.  
  6974.   <Ada type specification> ::=
  6975.         <Ada qualified type specification>
  6976.       | <Ada unqualified type specification>
  6977.  
  6978.   <Ada qualified type specification> ::=
  6979.         SQL_STANDARD.CHAR [ CHARACTER SET
  6980.            [ IS ] <character set specification> ]
  6981.             <left paren> 1 <double period> <length> <right paren>
  6982.       | SQL_STANDARD.BIT
  6983.             <left paren> 1 <double period> <length> <right paren>
  6984.       | SQL_STANDARD.SMALLINT
  6985.       | SQL_STANDARD.INT
  6986.       | SQL_STANDARD.REAL
  6987.       | SQL_STANDARD.DOUBLE_PRECISION
  6988.       | SQL_STANDARD.SQLCODE_TYPE
  6989.       | SQL_STANDARD.SQLSTATE_TYPE
  6990.       | SQL_STANDARD.INDICATOR_TYPE
  6991.  
  6992.   <Ada unqualified type specification> ::=
  6993.         CHAR
  6994.             <left paren> 1 <double period> <length> <right paren>
  6995.       | BIT
  6996.             <left paren> 1 <double period> <length> <right paren>
  6997.       | SMALLINT
  6998.       | INT
  6999.       | REAL
  7000.       | DOUBLE_PRECISION
  7001.       | SQLCODE_TYPE
  7002.       | SQLSTATE_TYPE
  7003.       | INDICATOR_TYPE
  7004.  
  7005.   <Ada initial value> ::=
  7006.       <Ada assignment operator> <character representation>...
  7007.  
  7008.   <Ada assignment operator> ::= <colon><equals operator>
  7009.  
  7010.   <C variable definition> ::=
  7011.         [ <C storage class> ]
  7012.         [ <C class modifier> ]
  7013.         <C variable specification>
  7014.       <semicolon>
  7015.  
  7016.   <C storage class> ::=
  7017.         auto
  7018.       | extern
  7019.       | static
  7020.  
  7021.   <C class modifier> ::= const | volatile
  7022.  
  7023.   <C variable specification> ::=
  7024.         <C numeric variable>
  7025.       | <C character variable>
  7026.       | <C derived variable>
  7027.  
  7028.   <C numeric variable> ::=
  7029.       ( long | short | float | double )
  7030.         <C host identifier> [ <C initial value> ]
  7031.               [ ( <comma> <C host identifier> [ <C initial value> ] )... ]
  7032.  
  7033.   <C initial value> ::=
  7034.       <equals operator> <character representation>...
  7035.  
  7036.   <C character variable> ::=
  7037.       char [ CHARACTER SET
  7038.                [ IS ] <character set specification> ]
  7039.         <C host identifier>
  7040.           <C array specification> [ <C initial value> ]
  7041.           [ ( <comma> <C host identifier>
  7042.             <C array specification>
  7043.                    [ <C initial value> ] )... ]
  7044.  
  7045.   <C array specification> ::=
  7046.       <left bracket> <length> <right bracket>
  7047.  
  7048.   <C derived variable> ::=
  7049.         <C VARCHAR variable>
  7050.       | <C bit variable>
  7051.  
  7052.   <C VARCHAR variable> ::=
  7053.       VARCHAR [ CHARACTER SET [ IS ]
  7054.           <character set specification> ]
  7055.           <C host identifier>
  7056.               <C array specification> [ <C initial value> ]
  7057.             [ ( <comma> <C host identifier>
  7058.                 <C array specification>
  7059.                         [ <C initial value> ] )... ]
  7060.  
  7061.   <C bit variable> ::=
  7062.       BIT <C host identifier>
  7063.           <C array specification> [ <C initial value> ]
  7064.         [ ( <comma> <C host identifier>
  7065.           <C array specification>
  7066.                      [ <C initial value> ] )... ]
  7067.  
  7068.   <COBOL variable definition> ::=
  7069.       (01|77) <COBOL host identifier> <COBOL type specification>
  7070.         [ <character representation>... ] <period>
  7071.  
  7072.   <COBOL type specification> ::=
  7073.         <COBOL character type>
  7074.       | <COBOL bit type>
  7075.       | <COBOL numeric type>
  7076.       | <COBOL integer type>
  7077.  
  7078.   <COBOL character type> ::=
  7079.       [ CHARACTER SET [ IS ]
  7080.             <character set specification> ]
  7081.       ( PIC | PICTURE ) [ IS ] ( X [ <left paren> <length> <right paren> ] )...
  7082.  
  7083.   <COBOL bit type> ::=
  7084.       ( PIC | PICTURE ) [ IS ]
  7085.           ( B [ <left paren> <length> <right paren> ] )...
  7086.  
  7087.   <COBOL numeric type> ::=
  7088.       ( PIC | PICTURE ) [ IS ]
  7089.         S <COBOL nines specification>
  7090.       [ USAGE [ IS ] ] DISPLAY SIGN LEADING SEPARATE
  7091.  
  7092.   <COBOL nines specification> ::=
  7093.         <COBOL nines> [ V [ <COBOL nines> ] ]
  7094.       | V <COBOL nines>
  7095.  
  7096.   <COBOL nines> ::= ( 9 [ <left paren> <length> <right paren> ] )...
  7097.  
  7098.   <COBOL integer type> ::=
  7099.         <COBOL computational integer>
  7100.       | <COBOL binary integer>
  7101.  
  7102.   <COBOL computational integer> ::=
  7103.       ( PIC | PICTURE ) [ IS ] S<COBOL nines>
  7104.         [ USAGE [ IS ] ] ( COMP | COMPUTATIONAL )
  7105.  
  7106.   <COBOL binary integer> ::=
  7107.       ( PIC | PICTURE ) [ IS ] S<COBOL nines>
  7108.         [ USAGE [ IS ] ] BINARY
  7109.  
  7110.   <Fortran variable definition> ::=
  7111.       <Fortran type specification>
  7112.       <Fortran host identifier>
  7113.           [ ( <comma> <Fortran host identifier> )... ]
  7114.  
  7115.   <Fortran type specification> ::=
  7116.         CHARACTER [ <asterisk> <length> ]
  7117.             [ CHARACTER SET [ IS ]
  7118.                   <character set specification> ]
  7119.       | BIT [ <asterisk> <length> ]
  7120.       | INTEGER
  7121.       | REAL
  7122.       | DOUBLE PRECISION
  7123.  
  7124.   <MUMPS variable definition> ::=
  7125.       ( <MUMPS numeric variable> | <MUMPS character variable> )
  7126.           <semicolon>
  7127.  
  7128.   <MUMPS numeric variable> ::=
  7129.       <MUMPS type specification>
  7130.         <MUMPS host identifier> [ ( <comma> <MUMPS host identifier> )... ]
  7131.  
  7132.   <MUMPS type specification> ::=
  7133.         INT
  7134.       | DEC
  7135.             [ <left paren> <precision> [ <comma> <scale> ] <right paren> ]
  7136.       | REAL
  7137.  
  7138.   <MUMPS character variable> ::=
  7139.       VARCHAR <MUMPS host identifier> <MUMPS length specification>
  7140.         [ ( <comma> <MUMPS host identifier> <MUMPS length specification> )... ]
  7141.  
  7142.   <MUMPS length specification> ::=
  7143.       <left paren> <length> <right paren>
  7144.  
  7145.   <Pascal variable definition> ::=
  7146.       <Pascal host identifier> [ ( <comma> <Pascal host identifier> )... ] <colon>
  7147.         <Pascal type specification> <semicolon>
  7148.  
  7149.   <Pascal type specification> ::=
  7150.         PACKED ARRAY
  7151.             <left bracket> 1 <double period> <length> <right bracket>
  7152.           OF CHAR
  7153.             [ CHARACTER SET [ IS ]
  7154.                   <character set specification> ]
  7155.       | PACKED ARRAY
  7156.             <left bracket> 1 <double period> <length> <right bracket>
  7157.           OF BIT
  7158.       | INTEGER
  7159.       | REAL
  7160.       | CHAR [ CHARACTER SET
  7161.                                   [ IS ] <character set specification> ]
  7162.       | BIT
  7163.  
  7164.   <PL/I variable definition> ::=
  7165.       (DCL | DECLARE)
  7166.           (   <PL/I host identifier>
  7167.             | <left paren> <PL/I host identifier>
  7168.                   [ ( <comma> <PL/I host identifier> )... ] <right paren> )
  7169.       <PL/I type specification>
  7170.       [ <character representation>... ] <semicolon>
  7171.  
  7172.   <PL/I type specification> ::=
  7173.         ( CHAR | CHARACTER ) [ VARYING ]
  7174.             <left paren><length><right paren>
  7175.             [ CHARACTER SET
  7176.                   [ IS ] <character set specification> ]
  7177.       | BIT [ VARYING ] <left paren><length><right paren>
  7178.       | <PL/I type fixed decimal> <left paren> <precision>
  7179.             [ <comma> <scale> ] <right paren>
  7180.       | <PL/I type fixed binary> [ <left paren> <precision> <right paren> ]
  7181.       | <PL/I type float binary> <left paren> <precision> <right paren>
  7182.  
  7183.   <PL/I type fixed decimal> ::=
  7184.         ( DEC | DECIMAL ) FIXED
  7185.       | FIXED ( DEC | DECIMAL )
  7186.  
  7187.   <PL/I type fixed binary> ::=
  7188.         ( BIN | BINARY ) FIXED
  7189.       | FIXED ( BIN | BINARY )
  7190.  
  7191.   <PL/I type float binary> ::=
  7192.         ( BIN | BINARY ) FLOAT
  7193.       | FLOAT ( BIN | BINARY )
  7194.  
  7195.   <embedded SQL end declare> ::=
  7196.       <SQL prefix> END DECLARE SECTION
  7197.           [ <SQL terminator> ]
  7198.  
  7199.   <embedded SQL MUMPS declare> ::=
  7200.       <SQL prefix>
  7201.         BEGIN DECLARE SECTION
  7202.           [ <embedded character set declaration> ]
  7203.           [ <host variable definition>... ]
  7204.         END DECLARE SECTION
  7205.       <SQL terminator>
  7206.  
  7207.   <embedded SQL statement> ::=
  7208.       <SQL prefix>
  7209.         <statement or declaration>
  7210.       [ <SQL terminator> ]
  7211.  
  7212.   <statement or declaration> ::=
  7213.         <declare cursor>
  7214.       | <dynamic declare cursor>
  7215.       | <temporary table declaration>
  7216.       | <embedded exception declaration>
  7217.       | <SQL procedure statement>
  7218.  
  7219.   <embedded exception declaration> ::=
  7220.       WHENEVER <condition> <condition action>
  7221.  
  7222.   <condition> ::=
  7223.       SQLERROR | NOT FOUND
  7224.  
  7225.   <condition action> ::=
  7226.       CONTINUE | <go to>
  7227.  
  7228.   <go to> ::=
  7229.       ( GOTO | GO TO ) <goto target>
  7230.  
  7231.   <goto target> ::=
  7232.         <host label identifier>
  7233.       | <unsigned integer>
  7234.       | <host PL/I label variable>
  7235.  
  7236.   <host label identifier> ::= !!<EMPHASIS>(See the Syntax Rules.)
  7237.  
  7238.   <host PL/I label variable> ::= !!<EMPHASIS>(See the Syntax Rules.)
  7239.  
  7240.   <preparable statement> ::=
  7241.         <preparable SQL data statement>
  7242.       | <preparable SQL schema statement>
  7243.       | <preparable SQL transaction statement>
  7244.       | <preparable SQL session statement>
  7245.       | <preparable implementation-defined statement>
  7246.  
  7247.   <preparable SQL data statement> ::=
  7248.         <delete statement: searched>
  7249.       | <dynamic single row select statement>
  7250.       | <insert statement>
  7251.       | <dynamic select statement>
  7252.       | <update statement: searched>
  7253.       | <preparable dynamic delete statement: positioned>
  7254.       | <preparable dynamic update statement: positioned>
  7255.  
  7256.   <dynamic single row select statement> ::= <query specification>
  7257.  
  7258.   <dynamic select statement> ::= <cursor specification>
  7259.  
  7260.   <preparable dynamic delete statement: positioned> ::=
  7261.      DELETE [ FROM <table name> ]
  7262.         WHERE CURRENT OF <cursor name>
  7263.  
  7264.   <preparable dynamic update statement: positioned> ::=
  7265.      UPDATE [ <table name> ]
  7266.         SET <set clause list>
  7267.         WHERE CURRENT OF <cursor name>
  7268.  
  7269.   <preparable SQL schema statement> ::=
  7270.         <SQL schema statement>
  7271.  
  7272.   <preparable SQL transaction statement> ::=
  7273.         <SQL transaction statement>
  7274.  
  7275.   <preparable SQL session statement> ::=
  7276.         <SQL session statement>
  7277.  
  7278.   <preparable implementation-defined statement> ::=
  7279.       !! <EMPHASIS>(See the Syntax Rules.)
  7280.  
  7281.   <direct SQL statement> ::=
  7282.       <directly executable statement> <semicolon>
  7283.  
  7284.   <directly executable statement> ::=
  7285.         <direct SQL data statement>
  7286.       | <SQL schema statement>
  7287.       | <SQL transaction statement>
  7288.       | <SQL connection statement>
  7289.       | <SQL session statement>
  7290.       | <direct implementation-defined statement>
  7291.  
  7292.   <direct SQL data statement> ::=
  7293.         <delete statement: searched>
  7294.       | <direct select statement: multiple rows>
  7295.       | <insert statement>
  7296.       | <update statement: searched>
  7297.       | <temporary table declaration>
  7298.  
  7299.   <direct select statement: multiple rows> ::=
  7300.       <query expression> [ <order by clause> ]
  7301.  
  7302.   <direct implementation-defined statement> ::=
  7303.       !!<EMPHASIS>(See the Syntax Rules)
  7304.  
  7305.   <SQL object identifier> ::=
  7306.       <SQL provenance> <SQL variant>
  7307.  
  7308.   <SQL provenance> ::= <arc1> <arc2> <arc3>
  7309.  
  7310.   <arc1> ::= iso | 1 | iso <left paren> 1 <right paren>
  7311.  
  7312.   <arc2> ::= standard | 0 | standard <left paren> 0 <right paren>
  7313.  
  7314.   <arc3> ::= 9075
  7315.  
  7316.   <SQL variant> ::= <SQL edition> <SQL conformance>
  7317.  
  7318.   <SQL edition> ::= <1987> | <1989> | <1992>
  7319.  
  7320.   <1987> ::= 0 | edition1987 <left paren> 0 <right paren>
  7321.  
  7322.   <1989> ::= <1989 base> <1989 package>
  7323.  
  7324.   <1989 base> ::= 1 | edition1989 <left paren> 1 <right paren>
  7325.  
  7326.   <1989 package> ::= <integrity no> | <integrity yes>
  7327.   <integrity no> ::= 0 | IntegrityNo <left paren> 0 <right paren>
  7328.  
  7329.   <integrity yes> ::= 1 | IntegrityYes <left paren> 1 <right paren>
  7330.  
  7331.   <1992> ::= 2 | edition1992 <left paren> 2 <right paren>
  7332.  
  7333.   <SQL conformance> ::= <low> | <intermediate> | <high>
  7334.  
  7335.   <low> ::= 0 | Low <left paren> 0 <right paren>
  7336.  
  7337.   <intermediate> ::= 1 | Intermediate <left paren> 1 <right paren>
  7338.  
  7339.   <high> ::= 2 | High <left paren> 2 <right paren>
  7340.  
  7341.  
  7342.  
  7343.  
  7344.   AF.  Appendix B - SQL Tutorial for beginners
  7345.  
  7346.  
  7347.   AF.1.  Tutorial for PostgreSQL
  7348.  
  7349.   SQL tutorial is also distributed with PostgreSQL. The SQL tutorial
  7350.   scripts is in the directory src/tutorial
  7351.  
  7352.   AF.2.  Internet URL pointers
  7353.  
  7354.   The SQL tutorial for beginners can be found at
  7355.  
  7356.   ∑  <http://w3.one.net/~jhoffman/sqltut.htm>
  7357.  
  7358.      Comments or suggestions? Mail to
  7359.  
  7360.   ∑  Jim Hoffman jhoffman@one.net
  7361.  
  7362.      The following are the sites suggested by John Hoffman:
  7363.  
  7364.   ∑  SQL Reference  <http://www.contrib.andrew.cmu.edu/~shadow/sql.html>
  7365.  
  7366.   ∑  Ask the SQL Pro  <http://www.inquiry.com/techtips/thesqlpro/>
  7367.  
  7368.   ∑  SQL Pro's Relational DB Useful Sites
  7369.      <http://www.inquiry.com/techtips/thesqlpro/usefulsites.html>
  7370.  
  7371.   ∑  Programmer's Source  <http://infoweb.magi.com/~steve/develop.html>
  7372.  
  7373.   ∑  DBMS Sites  <http://info.itu.ch/special/wwwfiles> Go here and see
  7374.      file comp_db.html
  7375.  
  7376.   ∑  DB Ingredients  <http://www.compapp.dcu.ie/databases/f017.html>
  7377.  
  7378.   ∑  Web Authoring  <http://www.stars.com/Tutorial/CGI/>
  7379.  
  7380.   ∑  Computing Dictionary  <http://wfn-shop.princeton.edu/cgi-
  7381.      bin/foldoc>
  7382.  
  7383.   ∑  DBMS Lab/Links  <http://www-ccs.cs.umass.edu/db.html>
  7384.  
  7385.   ∑  SQL FAQ
  7386.      <http://epoch.CS.Berkeley.EDU:8000/sequoia/dba/montage/FAQ> Go here
  7387.      and see file SQL_TOC.html
  7388.  
  7389.   ∑  SQL Databases  <http://chaos.mur.csu.edu.au/itc125/cgi/sqldb.html>
  7390.  
  7391.   ∑  RIT Database Design Page
  7392.      <http://www.it.rit.edu/~wjs/IT/199602/icsa720/icsa720postings.html>
  7393.   ∑  Database Jump Site  <http://www.pcslink.com/~ej/dbweb.html>
  7394.  
  7395.   ∑  Programming Tutorials on the Web
  7396.      <http://www.eng.uc.edu/~jtilley/tutorial.html>
  7397.  
  7398.   ∑  Development Resources
  7399.      <http://www.ndev.com/ndc2/support/resources.htp>
  7400.  
  7401.   ∑  Query List  <http://ashok.pair.com/sql.htm>
  7402.  
  7403.   ∑  IMAGE SQL Miscellaneous
  7404.      <http://jazz.external.hp.com/training/sqltables/main.html>
  7405.  
  7406.   ∑  Internet Resource List  <http://www.eit.com/web/netservices.html>
  7407.  
  7408.  
  7409.  
  7410.  
  7411.  
  7412.  
  7413.  
  7414.  
  7415.  
  7416.  
  7417.  
  7418.  
  7419.  
  7420.  
  7421.  
  7422.  
  7423.  
  7424.  
  7425.  
  7426.  
  7427.  
  7428.  
  7429.  
  7430.  
  7431.  
  7432.  
  7433.  
  7434.  
  7435.  
  7436.  
  7437.  
  7438.  
  7439.  
  7440.  
  7441.  
  7442.  
  7443.  
  7444.  
  7445.  
  7446.  
  7447.  
  7448.  
  7449.  
  7450.  
  7451.  
  7452.  
  7453.  
  7454.  
  7455.  
  7456.  
  7457.  
  7458.  
  7459.