NoSQL: a non-SQL RDBMS
Recent Pages

Commands at a glance
edittable: trivial tabl ...
indextable: generate ta ...
NoSQL Utilities
Text Formatting Rules
Site SandBox
Change Management
Wiki Editor's How-To
Site Terms of Use
Site Copyright

Links

NoSQL Home
Table of Contents
Wiki Editor's How-To
Text Formatting Rules
Wiki SandBox

www.strozzi.it on Twitter


GeoURL

Google Ads

Please Support NoSQL !


Session

User ID
Password



Campaigns

stopsoftwarepatents.eu petition banner

Creating new tables

Any editor may be used to construct or modify a table, since it is a regular UNIX file. This 'direct editing' method is occasionally used, especially for small amounts of data. Avoid, however, using an editor that destroys TAB or SOH characters.

To generate a new table the best plan (and usually the safest one) is first to generate a cross reference (xref) file, then convert it to table format and add the rows of data. Any convenient editor may be used to generate an xref file. Next convert the xref to an empty table wth the command 'maketable'. Finally, use the 'edittable' utility to manually enter rows of data.

A typical xref file is shown below:

       # These are lines of table documentation. They can be of any length,
       # and any number of such lines may exist.
       # Each line must start correctly, e.g. with "#" surrounded by any
       # number of spaces and/or TABs.

       Name      Name of item
       Type      Type: 1,2,3,7,9,A,B,X
       Count     Number of items
       K         Constant modifier
       SS7       Special status for type 7
       Size      In Kilobytes
The above xref file contains the necessary elements to describe a table of six columns: table documentation (the comment lines that each start with a sharp sign '#'), column names ("Name", "Type", "Count", ...), and column documentation for each column (the text at the end of each column line).

To build the final table header, use the command:

       maketable < table.xref

where table.xref is the xref file described above. The command will produce the correct table header to STDOUT, (that can be redirected to a file as usual) :

                 Name    Type    Count   K   SS7 Size

The uneven spacing between output column names depends on the tabular settings of your terminal.


Trackbacks (1) | New trackback | Comments (0) | Print

This Web Site is Copyright © 2007,2008,2009,2010 Carlo Strozzi, Some Rights Reserved
site map | recent changes | terms of use