This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision | |||
|
admin:basics:rawdata:delimited:files [2011/03/02 20:50] els |
— (current) | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | ~~NOTOC~~ | ||
| - | {{page>:top_add&nofooter&noeditbtn}} | ||
| - | |||
| - | ====== Administration: Omnidex Fundamentals ====== | ||
| - | |||
| - | ===== Raw Data Files: Delimited Files ===== | ||
| - | |||
| - | [[admin:basics:rawdata:delimited:home|Overview]] | | ||
| - | **[[admin:basics:rawdata:delimited:files|Declaring Files]]** | | ||
| - | [[admin:basics:rawdata:delimited:options|Options]] | | ||
| - | [[admin:basics:rawdata:delimited:layout|Record Layouts]] | | ||
| - | [[admin:basics:rawdata:delimited:ofx|Offset Indexes]] | | ||
| - | [[admin:basics:rawdata:delimited:limitations|Limitations]] | ||
| - | |||
| - | ---- | ||
| - | |||
| - | ==== Declaring a Delimited File ==== | ||
| - | |||
| - | Delimited files are accessed by creating a table definition in Omnidex that points to the data file. Just like with fixed-length files, applications can then use SQL statements to access the table. Omnidex will parse and read the data in the delimited file just like it would when accessing a relational table. | ||
| - | |||
| - | In the [[dev:sql:statements:create_table:home|CREATE TABLE]] statement, the [[admin:basics:rawdata:delimited:options|OPTIONS clause]] is used to identify this as a delimited file and indicate which delimiters to use. The DELIMITED option indicates that this is a delimited file. The remaining options govern the specific delimiters and behavior to use when parsing the file. | ||
| - | |||
| - | The PHYSICAL clause points to the physical location of the delimited file. This PHYSICAL clause can contain a relative path name (relative to the location of the Omnidex Environment File) such as "dat/states.csv", or an absolute path name such as "d:/class/lab1/dat/states.csv". This PHYSICAL clause can also contain wildcard as described below, and can also reference [[appendix:reference:envvar|environment variables]] using a special syntax. | ||
| - | |||
| - | <code sql> | ||
| - | create table "STATES" | ||
| - | options "DELIMITED COLUMN=',' RECORD='\r\n'" | ||
| - | physical "dat/states.csv" | ||
| - | ... | ||
| - | </code> | ||
| - | |||
| - | ==== Declaring Filesets ==== | ||
| - | |||
| - | In the example above, a single file was used as the source of data for a table. It is also possible for multiple files to be used as the source of data for a table. As long as the files all share the same record layout and options, they will all be processed when reading the table. Filesets can be declared as a comma-separated list of files, or they can be declared using wildcards in the filename. In this example, three files are declared individually in the PHYSICAL clause: | ||
| - | |||
| - | <code sql> | ||
| - | create table "STATES" | ||
| - | options "DELIMITED COLUMN=',' RECORD='\r\n'" | ||
| - | physical "c:/class/lab1/dat/states1.csv, | ||
| - | c:/class/lab1/dat/states2.csv, | ||
| - | d:/class/lab1/dat/states3.csv" | ||
| - | ... | ||
| - | </code> | ||
| - | |||
| - | In this second example, wildcards are used to declare these files: | ||
| - | |||
| - | <code sql> | ||
| - | create table "STATES" | ||
| - | options "DELIMITED COLUMN=',' RECORD='\r\n'" | ||
| - | physical "c:/class/lab1/dat/states*.csv, | ||
| - | d:/class/lab1/dat/states*.csv" | ||
| - | ... | ||
| - | </code> | ||
| - | |||
| - | Files can reside in multiple directories and in multiple drives or volumes to allow a table to span multiple storage devices. Files may also reside on a Storage Area Network (SAN); in fact, this is one of the most common implementations of Omnidex. Files may also reside on simple mapped drives; however, users should expect performance degradation to occur in this scenario. | ||
| - | |||
| - | Wildcards provide a great flexibility since they allow more data to be added to a table by simply moving another file into place. Care should be taken with this approach, though, since the table must be reindexed as soon as new data is in place. | ||
| - | |||
| - | ===== ===== | ||
| - | |||
| - | **[[admin:basics:rawdata:delimited:home|Prev]]** | | ||
| - | **[[admin:basics:rawdata:delimited:options|Next]]** | ||
| - | |||
| - | ====== Additional Resources ====== | ||
| - | |||
| - | See also: | ||
| - | |||
| - | {{page>:admin:basics:see_also&nofooter&noeditbtn}} | ||
| - | |||
| - | {{page>:bottom_add&nofooter&noeditbtn}} | ||