This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
admin:features:rollups:create [2012/02/17 16:35] doc |
admin:features:rollups:create [2016/06/28 22:38] (current) |
||
---|---|---|---|
Line 14: | Line 14: | ||
A rollup table is quite easy to create. The rollup tables are first created in the Omnidex Environment File, complete with the SQL statement that represents the rollup data. Then the UPDATE ROLLUPS statement is issued in ODXSQL to populate the rollup tables. Here is a simple example of declaring a regular table, followed by the creation of two rollup tables: | A rollup table is quite easy to create. The rollup tables are first created in the Omnidex Environment File, complete with the SQL statement that represents the rollup data. Then the UPDATE ROLLUPS statement is issued in ODXSQL to populate the rollup tables. Here is a simple example of declaring a regular table, followed by the creation of two rollup tables: | ||
- | <code sql> | + | <code> |
create table "INDIVIDUALS" | create table "INDIVIDUALS" | ||
physical "dat/individuals.dat" | physical "dat/individuals.dat" | ||
( | ( | ||
- | "INDIVIDUAL" CHARACTER(12) omnidex, | + | "INDIVIDUAL" CHARACTER(12), |
- | "HOUSEHOLD" CHARACTER(12) omnidex, | + | "HOUSEHOLD" CHARACTER(12), |
- | "NAME" CHARACTER(50) quicktext, | + | "NAME" CHARACTER(50), |
- | "GENDER" CHARACTER(1) omnidex bitmap, | + | "GENDER" CHARACTER(1), |
- | "BIRTHDATE" ANSI DATE omnidex, | + | "BIRTHDATE" ANSI DATE, |
- | "PHONE" CHARACTER(14) omnidex, | + | "PHONE" CHARACTER(14), |
- | "EMAIL" CHARACTER(60) quicktext, | + | "EMAIL" CHARACTER(60), |
constraint INDIVIDUALS_INDIVIDUAL_PK primary ("INDIVIDUAL"), | constraint INDIVIDUALS_INDIVIDUAL_PK primary ("INDIVIDUAL"), | ||
constraint INDIVIDUALS_HOUSEHOLD_FK foreign ("HOUSEHOLD") references "HOUSEHOLDS", | constraint INDIVIDUALS_HOUSEHOLD_FK foreign ("HOUSEHOLD") references "HOUSEHOLDS", | ||
Line 34: | Line 34: | ||
physical "dat/individuals_by_household.dat" | physical "dat/individuals_by_household.dat" | ||
( | ( | ||
- | "HOUSEHOLD" CHARACTER(12) omnidex, | + | "HOUSEHOLD" CHARACTER(12), |
- | "GENDER" CHARACTER(1) omnidex bitmap, | + | "GENDER" CHARACTER(1), |
- | "BIRTHDATE" ANSI DATE omnidex, | + | "BIRTHDATE" ANSI DATE, |
"NUM_INDIVIDUALS" UNSIGNED INTEGER, | "NUM_INDIVIDUALS" UNSIGNED INTEGER, | ||
constraint INDIVIDUALS_HOUSEHOLD_FK foreign ("HOUSEHOLD") references "HOUSEHOLDS", | constraint INDIVIDUALS_HOUSEHOLD_FK foreign ("HOUSEHOLD") references "HOUSEHOLDS", | ||
Line 55: | Line 55: | ||
physical "dat/individuals_by_demo.dat" | physical "dat/individuals_by_demo.dat" | ||
( | ( | ||
- | "GENDER" CHARACTER(1) omnidex bitmap, | + | "GENDER" CHARACTER(1), |
- | "BIRTHDATE" ANSI DATE omnidex, | + | "BIRTHDATE" ANSI DATE, |
"NUM_INDIVIDUALS" UNSIGNED INTEGER, | "NUM_INDIVIDUALS" UNSIGNED INTEGER, | ||
constraint INDIVIDUALS_GENDER_FK foreign ("GENDER") references "GENDERS", | constraint INDIVIDUALS_GENDER_FK foreign ("GENDER") references "GENDERS", | ||
Line 75: | Line 75: | ||
In ODXSQL, ODBC or JDBC, the following statement will populate the rollup tables in the Omnidex Environment: | In ODXSQL, ODBC or JDBC, the following statement will populate the rollup tables in the Omnidex Environment: | ||
- | <code sql> | + | <code> |
> update rollups | > update rollups | ||
Database | Database |