This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
dev:sql:statements:create_table:examples [2010/07/06 17:39] els created |
dev:sql:statements:create_table:examples [2016/06/28 22:38] (current) |
||
---|---|---|---|
Line 1: | Line 1: | ||
{{page>:top_add&nofooter&noeditbtn}} | {{page>:top_add&nofooter&noeditbtn}} | ||
<html><div align="center"><span style="color:red">DRAFT</span></div></html> | <html><div align="center"><span style="color:red">DRAFT</span></div></html> | ||
+ | |||
+ | {{page>:sql_bar&nofooter&noeditbtn}} | ||
====== 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:examples|Examples]] | + | [[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]]** | ||
===== Examples ===== | ===== Examples ===== | ||
Line 15: | Line 18: | ||
Parent tables should be declared before children tables. | Parent tables should be declared before children tables. | ||
- | |||
===== Typical Example ===== | ===== Typical Example ===== | ||
Line 29: | Line 31: | ||
city CHARACTER(30) QUICKTEXT, | city CHARACTER(30) QUICKTEXT, | ||
state CHARACTER(2) OMNIDEX | state CHARACTER(2) OMNIDEX | ||
- | ); | + | ) |
+ | in "simple.xml"; | ||
</code> | </code> | ||
Line 36: | 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 58: | 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 80: | 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 124: | 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 151: | 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 163: | 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 ==== |