This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
|
dev:sql:statements:create_table:examples [2010/07/06 19:58] els |
dev:sql:statements:create_table:examples [2016/06/28 22:38] (current) |
||
|---|---|---|---|
| Line 6: | Line 6: | ||
| ====== Omnidex SQL: CREATE TABLE ====== | ====== Omnidex SQL: CREATE TABLE ====== | ||
| - | [[dev:sql:statements:create_table:home|Description]] -> [[dev:sql:statements:create_table:syntax|Syntax]] -> [[dev:sql:statements:create_table:topics|Topics]] -> | + | [[dev:sql:statements:create_table:home|Description]] | [[dev:sql:statements:create_table:syntax|Syntax]] | [[dev:sql:statements:create_table:topics|Topics]] | |
| **[[dev:sql:statements:create_table:examples|Examples]]** | **[[dev:sql:statements:create_table:examples|Examples]]** | ||
| Line 18: | Line 18: | ||
| Parent tables should be declared before children tables. | Parent tables should be declared before children tables. | ||
| - | |||
| ===== Typical Example ===== | ===== Typical Example ===== | ||
| Line 32: | Line 31: | ||
| city CHARACTER(30) QUICKTEXT, | city CHARACTER(30) QUICKTEXT, | ||
| state CHARACTER(2) OMNIDEX | state CHARACTER(2) OMNIDEX | ||
| - | ); | + | ) |
| + | in "simple.xml"; | ||
| </code> | </code> | ||
| Line 39: | Line 39: | ||
| <code> | <code> | ||
| create table "HOUSEHOLDS" | create table "HOUSEHOLDS" | ||
| - | physical "dat\households*.dat" | + | physical "dat/households*.dat" |
| ( | ( | ||
| "HOUSEHOLD" character(12), | "HOUSEHOLD" character(12), | ||
| Line 61: | Line 61: | ||
| <code> | <code> | ||
| create table "HOUSEHOLDS" | create table "HOUSEHOLDS" | ||
| - | physical "dat\households*.dat" | + | physical "dat/households*.dat" |
| ( | ( | ||
| "HOUSEHOLD" character(12) omnidex, | "HOUSEHOLD" character(12) omnidex, | ||
| Line 83: | Line 83: | ||
| <code> | <code> | ||
| create table "HOUSEHOLDS" | create table "HOUSEHOLDS" | ||
| - | physical "dat\households*.dat" | + | physical "dat/households*.dat" |
| ( | ( | ||
| "HOUSEHOLD" character(12) omnidex, | "HOUSEHOLD" character(12) omnidex, | ||
| Line 127: | Line 127: | ||
| | CHARACTER(//n//) | Space-filled character string of //n// characters | | | CHARACTER(//n//) | Space-filled character string of //n// characters | | ||
| | CHAR(//n//) | Synonym for CHARACTER(//n//) | | | CHAR(//n//) | Synonym for CHARACTER(//n//) | | ||
| - | | C STRING(//n//) | Null-terminated character string of //n// characters | | + | | STRING(//n//) | Null-terminated character string of //n// characters | |
| | VARCHAR(//n//)* | String of max //n// characters, with length variable | | | VARCHAR(//n//)* | String of max //n// characters, with length variable | | ||
| | CLOB(//n//)* | Character large object of max //n// characters, with length variable | | | CLOB(//n//)* | Character large object of max //n// characters, with length variable | | ||
| Line 154: | Line 154: | ||
| | OMNIDEX TIME(//n//) | Omnidex proprietary time supporting //n// digits of HHMMSSNN | | | OMNIDEX TIME(//n//) | Omnidex proprietary time supporting //n// digits of HHMMSSNN | | ||
| | OMNIDEX DATETIME(//n//) | Omnidex proprietary datetime supporting //n// digits of YYYYMMDDHHMMSSNN | | | OMNIDEX DATETIME(//n//) | Omnidex proprietary datetime supporting //n// digits of YYYYMMDDHHMMSSNN | | ||
| - | | * Omnidex recommends use of the CHARACTER and C STRING datatypes rather than VARCHAR and CLOB due to the requirement of a length variable. || | + | | * Omnidex recommends use of the CHARACTER and STRING datatypes rather than VARCHAR and CLOB due to the requirement of a length variable. || |
| === National Character Datatypes === | === National Character Datatypes === | ||
| Line 166: | Line 166: | ||
| | NATIONAL CHARACTER(//n//) | Space-filled character string of //n// characters | | | NATIONAL CHARACTER(//n//) | Space-filled character string of //n// characters | | ||
| | NATIONAL CHAR(//n//) | Synonym for CHARACTER(//n//) | | | NATIONAL CHAR(//n//) | Synonym for CHARACTER(//n//) | | ||
| - | | NATIONAL C STRING(//n//) | Null-terminated character string of //n// characters | | + | | NATIONAL STRING(//n//) | Null-terminated character string of //n// characters | |
| | NATIONAL VARCHAR(//n//)* | String of max //n// characters, with length variable | | | NATIONAL VARCHAR(//n//)* | String of max //n// characters, with length variable | | ||
| | NATIONAL CLOB(//n//)* | Character large object of max //n// characters, with length variable | | | NATIONAL CLOB(//n//)* | Character large object of max //n// characters, with length variable | | ||
| - | | * Omnidex recommends use of the NATIONAL CHARACTER and NATIONAL C STRING datatypes rather than NATIONAL VARCHAR and NATIONAL CLOB due to the requirement of a length variable. || | + | | * Omnidex recommends use of the NATIONAL CHARACTER and NATIONAL STRING datatypes rather than NATIONAL VARCHAR and NATIONAL CLOB due to the requirement of a length variable. || |
| ==== Indexing Recommendations ==== | ==== Indexing Recommendations ==== | ||