
Installation
------------

	Copy the main program sqldb/db to a directory in your executable path.
	Copy the files in sqldb/libs to your libs: directory.
	Add the assignment SQLDB: to your startup-sequence and have it point
		to a central location for your tables.
 
Getting Started
---------------

	Command-line options to SQLdb:

	Option	Arguments	Default		Meaning
	------	---------	-------		-------
	-t	'd' or 'r'	'r'		Temporary table storage
	-s	none		NA		Server mode


	Temporary Tables

	Temporary table are created whenever you give SQL a select query to
	perform.  The -t option allows you to specify where you wish the 
	temporary tables to be stored.

	The 'r' argument specifies that temporary tables are to be stored in
	main memory.

	The 'd' argument specifies that temporary table are to be stored in
	the current directory from which SQLdb was started from.

	Server Mode

	When started up in Server Mode, SQLdb will open up an ARexx port and
	await commands from the port.

Using the Command Shell
-----------------------

	The command shell is a line oriented user interface.  Commands are
	typed and the results are displayed on the screen.  The commands shell
	is similar in operation to the Unix csh(1) program.

	Commands may span physical lines.  Commands MUST be terminated with a
	semi-colon ';'.

	Upon startup, the command shell will attempt to execute commands in
	the file '.dbcshrc'.  If this file does not exist in the current
	directory, the command shell will give an error message saying so, and
	will continue.
	
	The following variables have special meaning to the command shell:

	Name		Default		Meaning
	----		-------		-------

	EDITOR		'z'		Editor to be used with EDIT COMMAND

	PROMPT		'dbcsh>'	Command shell prompt string

	HISTORY		25		Number of commands in history buffer

	
	Commands in the command shell

	EDIT COMMAND

	FORMAT: EDIT COMMAND history-number

	DESCRIPTION:
	The edit command command lets you edit the specified command using your
	favorite editor.


	EXIT

	FORMAT: EXIT

	DESCRIPTION:
	The exit command will exit you from the command shell.  All non-system
	table must be closed before you may exit.


	HISTORY

	FORMAT: HISTORY

	DESCRIPTION:
	The history command displays a list of the history buffer.  Each entry
	consists of the history number and the command text.


	SET

	FORMAT: SET [ variable-name = variable-value ]

	DESCRIPTION:
	The set command lets you store values in command shell variables that
	can be used later.  If the arguments to set are omitted, a listing of
	all variables and values is produced.


	SYSTEM

	FORMAT: SYSTEM 'system-command'

	DESCRIPTION:
	The system command allow you to execute a system command, such as
	'dir' or 'll', without having to leave SQLdb.


	VERSION

	FORMAT: VERSION

	DESCRIPTION:
	The version command displays the current version and any other
	pertinent information.


ARexx
-----

	The ARexx port created is called 'SQLserver'.

	The Arexx variable result will contain a valid value only when a row
	of query results has been FETCHed with ExecSQL.

	The ARexx variable sqlca.sqlcode will be non-zero if an error has
	occured in the processing of an SQL statement.  The error message will
	be placed in the ARexx variable sqlca.sqlerrmsg.


	ARexx commands

	ExecSQL

	FORMAT: 'ExecSQL' 'SQL-Command-string;'

	DESCRIPTION:
	ExecSQL will send the given command to the interpreter to be executed.


	ShutdownSQL

	FORMAT: 'ShutdownSQL'

	DESCRIPTION:
	Shutdown will tell SQLdb to close the ARexx port and quit.


SQL Language
------------

	This section will detail any differences/omissions/enhancements to
	the ANSI standard of SQL.  This section will NOT teach you about the
	language.  I would suggest the book:

			Using SQL
			by James R. Groff & Paul N. Weinberg
			Osborne McGraw-Hill
			ISBN 0-07-881524-X


	Omissions:  ( I plan to implement most if not all, eventually )


	Not all datatypes in standard have been implemented

	Indexes are not implemented

	ORDER BY in SELECT query not implemented

	All features associated with multiple concurrent users not implemented

	INSERT INTO with subquery not implemented

	Views are not implemented

	Primary and foreign keys not implemented

	Domains are not implemented

	UNION, INTERSECT, etc not implemented

	

	Differences:

	subquerys delimited with '[]' instead of '()'

	Built-in functions only allow expressions inside parentheses


	Enhancements: (Your favorite section :-)


	SELECT has an additional clause called OUTPUT TO 'filename'.  This
	will send the results of the query to the specified filename.


	Missing values:
	ANSI SQL has the concept of NULL values.  This is a three-valued logic
	system.  When data is missing, it has the value NULL.

	SQLdb has the concept of NULL values as well.  As described by the 
	Relational Model, Version 2, SQLdb has a four-valued logic system:
	TRUE,FALSE,AMARK,IMARK.  The AMARK indicates an applicable missing
	value.  Meaning, a value that should be there, but isn't.  The IMARK
	indicates an inapplicable missing value.  NULLs in ANSI SQL would be
	semantically equivalent to AMARKs in SQLdb.

	Boolean expressions now have four qualifiers:
	  NOT, MAYBE_I, MAYBE_A, MAYBE

	P |NOT P   P | MAYBE_I P   P | MAYBE_A P   P | MAYBE P
	--------   -------------   -------------   -----------
	t | f	   t | f	   t | f	   t | f
	a | a      a | f           a | t	   a | t
	i | i      i | t 	   i | f	   i | t
  	f | t      f | f 	   f | f	   f | f


	In query results, AMARKs are display as -AM-, and IMARKs are displayed
	as -IM-.
