List of articles   choose language


Displaying of table 3x100 of DBMS
as table 10x10



Agreements

tagattributecharacteristicstyle
new html-keywordslinealingpointdefault
values of new html-keywordssideromb
old html-keywordstdidlist
values of old html-keywordscircle
communication xmlsoundsyncpower
values of communication xmlnouser
keyboard and mouser commandenter

3 database tables into 1 browser table

Situation

Let's consider a typical table (we shall name such "wide" tables as multi-dimensional).

  home horse car yacht
Smith 250 70 50 180
Tomson 340 90 100
Johnson 100 10 210

Multi-dimensional table is stored in a database as three tables (we shall name them as relational). One (here - table "cost") contains records with three fields: column number, row number (primary key consist of two fields) and cell value. Two others (here - "things" and "family" tables) contains records with two fields: serial number (primary key) and column (or row) name.

cost
who what many
1 1 250
1 2 70
1 3 50
1 4 180
2 1 340
2 3 90
2 4 100
3 1 100
3 3 10
3 4 210
things
pk what
1 home
2 horse
3 car
4 yacht
family
pk who
1 Smith
2 Tomson
3 Johnson

Usual pair of cycles (one inside another) is used for transformation of relational table into multi-dimensional. It's would be convenient to have standard operator of this transformation! Because "multi-dimensional" is visual property of table, the operator should be made in a browser, instead of in SQL.

Concept

Let's transfer rational tables into a browser as textual files: one string - one records, fields are separated by blanks (spaces), first fields is primary key, string rest is part of last field (i.e. last field can contain blanks).

Textual file for "cost" table has row number in the first field, column number in second field to according with mathematical designations (last index, then first run a range of values).

I offer to use tags link inside tag table-dim (origin of designations: dim = dimentional), and browser does not sort rows and columns of multi-dimensional table, and they get names in way, how the names follow in the appropriate files.

<table-dim>
 <link src="./things.txt" type="row">
 <link src="./family.txt" type="column">
 <link src="./cost.txt"   type="cell">
</table-dim>

Form sending

If

then browser sends following XML-text ("row" and "col" contain primary keys)
<money row="1" col="2" v="80">
<money row="3" col="1" v="110">

Resume

Attributes
tag attribute list of possible values
link type row, column, cell



html60author



List of articles   choose language


Используются технологии uCoz