summaryrefslogtreecommitdiff
path: root/docs/html/xbc6.html
diff options
context:
space:
mode:
Diffstat (limited to 'docs/html/xbc6.html')
-rwxr-xr-xdocs/html/xbc6.html220
1 files changed, 90 insertions, 130 deletions
diff --git a/docs/html/xbc6.html b/docs/html/xbc6.html
index 094545f..aa38ad4 100755
--- a/docs/html/xbc6.html
+++ b/docs/html/xbc6.html
@@ -2,152 +2,112 @@
<HTML>
<TITLE>Xbase DBMS Chapter 6</TITLE>
<BODY BGCOLOR=#FFFFFF>
-<H1><p align="center">Index Overview</p></H1>
-<p align="center">Chapter Updated 12/09/22</p><hr>
+<H2><p align="center">SQL Support</p></H2>
+<p align="center">Chapter Updated 04/28/23</p><hr>
-The objective of this chapter is to provide information regarding
-the basic concepts of index processing for the Xbase library.<br><br>
-
-
-<h2>Overview</h2>
-
-The Xbase library is designed to support multiple index types simultaneously.
-Dbase, Clipper and Foxbase each had their own index formats and ultimately the
-goal is to provide support for all the legacy index file formats.
+<h3>SQL Command Status</h3>
+Development of SQL support is still underway and very preliminary. As of the 4.0.3 version, the following SQL commands
+are available.<br><br>
+The SQL commands are modeled after industry standard SQL specifications and do what you would expect an SQL command to do.
+<br>
+Use of <em>[brackets]</em> in this chapter identifies optional components of a given command.
<br><br>
-The 4.0.x rewrite includes the NDX and MDX formats. Earlier versions of the
-library included NTX and CDX formats which will be brought forward into the
-library rewrite at some point in the future.
-
-
-<h2>Tags</h2>
-
-Each index file contains one or more tags depending on the file type. Each tag is a sort order
-and has characteristics: Sort order (ASC or DESC), unique or not unique and some formats support filtering.
-Each open table (dbf file) has an "active tag" for database operations.
-
-<h2>Index processing design</h2>
+<hr>
+<h3>ALTER TABLE</h3>
+Expected format:<br>
+ALTER TABLE tablename.DBF RENAME TO newtablename.DBF
+<br><br>
+<hr>
+<h3>CREATE INDEX</h3>
+Expected format to create an Dbase 3, NDX index:<br>
+CREATE INDEX ixname.NDX ON tablename.dbf ( EXPRESSION ) [ASSOCIATE]
-The library is construcuted to handle index files with multiple tags per file. Single tag files like the NDX indices
-are treated as a multi tag file, but there is only one tag. This allows for maximum flexibility for future
-additional index types.
+<br><br>
+Expected format to create an Dbase 4, tag on an MDX index:<br>
+CREATE [UNIQUE] INDEX tagname ON tablename.DBF ( EXPRESSION ) [DESC] [FILTER .NOT. DELETED()]
+<br><br>
+The ASSOCIATE parameter is specific to Xbase64 library, it is used to associate non production (NDX) index file to a dbf
+file so it will be automatically opened with the dbf file whenever the dbf file is opened by the xbase64 routines.
+<br><br>
+The [ASSOCIATE] parameter is not used with MDX production indices
+<br><br>
+Xbase first looks for ".NDX" in the file name to determine if an NDX index should be created.
+If .NDX is not in the filename, it looks in the uda for "IXTYPE" for either NDX or MDX to
+detmermine the index type to create. if IXTYPE is not found, it creates an MDX tag.
+<br><br>
+The optional DESC parameter defines an entire index key as descending. This is
+different than other SQL implementations where specific fields can be descending.
+<br><br>
+The optional FILTER parameter is specific to the XBASE64 library, is it used to assign a filter to a tag in an
+MDX style index. Everything to the right of the keyword FILTER is considered part of the filter.
+<br><br>
+The original DBASE indices used to '+' to create an index on more than one field
+<br>ie: FIELD1+FIELD2+FIELD3
+<br><brSQL uses commas: ie: FIELD1, FIELD2, FIELD3
+<br>
+The Xbase library supports either '+' or ',' when creating mutli field indices.
+<br><br>
+<hr>
-<h2>Index updates</h2>
-The library automatically updates all tags in all open index files.
+<h3>CREATE TABLE</h3>
+Expected format:<br>
+CREATE TABLE tablename.dbf (Field1 CHAR(10), INTFLD1 INTEGER, ... )
+<br><br>
+<table border=1>
+<tr><th>SQL TYPE</th><th>XBASE Field Type</th></tr>
+<tr><td>SMALLINT</td><td>NUMERIC(6,0)</td></tr>
+<tr><td>INTEGER</td><td>NUMERIC(11,0)</td></tr>
+<tr><td>DECIMAL(x,y)</td><td>NUMERIC(x+1,y)</td></tr>
+<tr><td>NUMERIC(x,y)</td><td>NUMERIC(x,y)</td></tr>
+<tr><td>FLOAT(x,y)</td><td>FLOAT(x,y)</td></tr>
+<tr><td>CHAR(n)</td><td>CHARACTER(n)</td></tr>
+<tr><td>DATE</td><td>DATE</td></tr>
+<tr><td>VARCHAR</td><td>MEMO</td></tr>
+<tr><td>LOGICAL</td><td>LOGICAL</td></tr>
+</table>
+<br>
+<hr>
+<h3>DELETE</h3>
+Expected format:<br>
+DELETE FROM tablename.DBF [WHERE expression]
<br><br>
-<h2>Index File Types</h2>
+<hr>
-<table border=1>
-<tr><th>File<br>Type</th><th>Source</th><th>Max Tags<br>Per File</th><th>Auto Opened</th><th>Sort Order</th><th>Unique Keys</th>
- <th>Reclaimed Nodes</th><th>Filter Support</th><th>Status</th></tr>
-<tr>
- <td>NDX</td><td>dBase</td>
- <td><center>1</center></td>
- <td><center>Optional</center></td>
- <td>ASC only</td>
- <td><center>Y</center></td>
- <td><center>N</center></td>
- <td><center>N</center></td>
- <td><center>Available in 4.0.1</center></td>
-</tr>
-<tr>
- <td>MDX</td><td>dBase</td>
- <td><center>47</center></td>
- <td><center>Yes</center></td>
- <td><center>ASC or DESC</center></td>
- <td><center>Y</center></td>
- <td><center>Y</center></td>
- <td><center>Y</center></td>
- <td><center>Available in 4.0.1</center></td>
-</tr>
-<tr>
- <td>NTX</td>
- <td>Clipper</td>
- <td><center>1</center></td>
- <td><center>Optional</center></td>
- <td><center>?</center></td>
- <td><center>?</center></td>
- <td><center>?</center></td>
- <td><center>?</center></td>
- <td><center>Pending upgrades</center></td>
-</tr>
-<tr>
- <td>CDX</td>
- <td>Fox Pro</td>
- <td><center>?</center></td>
- <td><center>?</center></td>
- <td><center>?</center></td>
- <td><center>?</center></td>
- <td><center>?</center></td>
- <td><center>?</center></td>
- <td><center>Pending upgrades</center></td>
-<tr>
-<tr>
- <td>IDX</td><td>Fox Pro</td><td></td><td></td><td></td><td></td><td></td><td></td><td>Undeveloped</td>
-<tr>
-</table>
+<h3>DROP INDEX</h3>
+Expected format:<br>
+DROP INDEX [IF EXISTS] ixname.NDX ON tablename.DBF<br>
+DROP INDEX [IF EXISTS] tagname ON tablename.DBF<br>
+<br>
-<br><br>
-<h2>Index/Tag Methods</h2>
-<table border=1>
-<tr><th>Method</th><th>Description</th></tr>
-
-<tr>
- <td>xbDbf::CheckTagIntegrity</td><td>Checks a tag for missing or duplicate entries. Available if XB_DEBUG_SUPPORT is on.</td>
-</tr>
-<tr>
- <td>xbDbf::CreateTag</td><td>Create a new tag.</td>
-</tr>
-<tr>
- <td>xbDbf::DeleteTag</td><td>Delete existing tag.</td>
-</tr>
-<tr>
- <td>xbDbf::Find</td><td>Find key value for the active tag.</td>
-</tr>
-<tr>
- <td>xbDbf::GetFirsKey</td><td>Retrieve the first key for the active tag.</td>
-</tr>
-<tr>
- <td>xbDbf::GetLastKey</td><td>Retrieve the last key for the active tag.</td>
-</tr>
-<tr>
- <td>xbDbf::GetNextKey</td><td>Retrieve the next key for the active tag.</td>
-</tr>
-<tr>
- <td>xbDbf::GetPrevKey</td><td>Retrieve the previous key for the active tag.</td>
-</tr>
-<tr>
- <td>xbDbf::GetCurTag</td><td>Retrieve the tag name key for the active tag.</td>
-</tr>
-<tr>
- <td>xbDbf::OpenIndex</td><td>Open an index file. Only used for index files that aren't automatically opened.</td>
-</tr>
-<tr>
- <td>xbDbf::Reindex</td><td>Rebuild a tag. Available if XB_DEBUG_SUPPORT is on.</td>
-</tr>
-<tr>
- <td>xbDbf::SetCurTag</td><td>Set current tag.</td>
-</tr>
-</table>
-<br><br>
-<h2>Internal Data Storage</h2>
-<table border=1>
-<tr><th>Type<th>Stored in DBF as</th><th>Stored in NDX as</th><th>Stored in MDX as</th></tr>
-<tr><td>C</td><td>Character data</td><td>Character data</td><td>Character data</td></tr>
-<tr><td>F</td><td>Text numbers</td><td>xbDouble</td><td>xbBcd</td></tr>
-<tr><td>N</td><td>Text numbers</td><td>xbDouble</td><td>xbBcd</td></tr>
-<tr><td>D</td><td>Text YYYYMMDD</td><td>xbDouble Julian</td><td>xbDouble Julian</td></tr>
-</table>
+<hr>
+<h3>DROP TABLE</h3>
+Expected format:<br>
+DROP TABLE [IF EXISTS] tablename.DBF
+<br>
+<hr>
+<h3>INSERT</h3>
+Expexted format:<br>
+INSERT INTO tablename (field1, field2, field3,...) VALUES ( 'charval', numval, 'what is the correct odbc date format to use? CCYYMMDD');
<br><br>
<hr>
-<p><img src="xbase.jpg"><br><hr>
+<h3>SET</h3>
+Used to set a variable name<br>
+Expected format:<br>
+SET ATTRIBUTE = DATAVALUE<br>
+SET ATTRIBUTE = ^ (to delete an entry) <br>
+<br>
+<hr><br><br>
+<p><img src=xbase.jpg><br><hr>
+
</BODY>
</HTML>
+
+