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


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


Google Ads

Please Support NoSQL !


User ID

Campaigns petition banner

Frequently Asked Questions

How do I modify existing tables?

There are several ways:

  • Do it manually with the 'edittable' operator.
  • Simply append the new record(s) (table2) to the old table (table1):
  tail +2 < table2 >> table1
  • On large, indexed tables you can apply the changes to a smaller journalling table (edit buffer) and then use the 'update' operator. See page Big tables for more details on this method.
  • Use the old table header to build a valid new record, modify the fields of the latter, and write the modified table back to disk:
  addrow < table | 
  compute 'if($0 ~ /^\t+$/) Column1="value1"; Column2="value2"; ...' \ 
     > table.tmp 
  mv table.tmp table
  • To delete records, use the 'getrow' operator to select only those records that you want to retain:
  getrow 'selection expression' < table > table.tmp 
  mv table.tmp table
  • Use the 'update' operator. The two tables are assumed to have the respective primary key fields in their leftmost columns.

Will NoSQL ever provide record-level locking and update facilities?

NoSQL assumes that tables are collections of variable-length records. Strictly speaking, record-level updates require fixed-length records. They can be done by right-padding the records with blanks to 'make room' for updates, but that is a bit of a kludge, IMHO. If you need such facilities you should use either /rdb or Starbase, or resort to a more usual SQL DBMS, either free or commercial. See also the workaround outlined in page Big tables. In fact I am thinking of a mechanism to provide some form of record-level facilities, but in a way that is in accordance with the underlying paradigm of variable-length records.

Trackbacks (2) | 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