Database Reference
In-Depth Information
Convert CTT Structure to VET Structure Algorithm: This subsidiary algorithm is
used to convert the retrieved data from a CTT into VET structure that consists of two-
dimensional array, the number of array rows represents a number of retrieved rows, and
the number of array columns represents a number of retrieved columns of a CTT. The
column names are stored in the
rst element of the two-dimensional array, and the data
in these columns are stored in the rest of the array elements. The details of this
algorithm are outlined in Algorithm 4.
Denition 4 (Convert CTT to VET Structure Algorithm).
CCVS
rowList
denotes a set
of retrieved rows from a CTT where each row is denoted as
CCVS
row
. Each
CCVS
row
is
a set of columns and each column is denoted by
CCVS
col
.
CCVS
rown
(
CCVS
colm
) denotes
a value stored in the
CCVS
colm
of the
CCVS
rown
.
CCVS
rowListSize
denotes the size of
CCVS
rowList
, and the size of each
CCVS
row
in the
CCVS
rowList
is denoted by
CCV
S
rowSize
.
CCVS
colNames
denotes a set of a CTT columns
names.
CCVS
colNamesSize
denotes the size of the
CCVS
colNames
.
CCVS
array
denotes a two dimensional array that
stores the retrieved row s from a CTT.
'
.
5.2 One-to-Many Query Algorithm
This algorithm retrieves table rows from two CTTs, two VETs, or one VET and one
CTT. These two tables may have any of the following database relationships between
them: One-to-One, One-to-Many, Many-to-One, Many-to-Many, or Self-referencing.
In this section, a sample algorithm of the One-to-Many relationship is presented as
outlined in Algorithm 5.
Denition 5 (One-to-Many Query Algorithm).
OTMQ
master
denotes the master table
of the One-to-Many relationship.
OTMQ
details
denotes the details table of the One-to-
Many relationship.
OTMQ
masterPK
denotes a row matrix with 2 rows and n columns.
The
rst row stores
OTMQ
masterPK
0
;
i
that denotes a primary key column name of a table.
The second row stores
OTMQ
masterPK
1
;
i
that denotes a table primary key value of the
Search WWH ::
Custom Search