This is an old revision of the document!
Overview | File Types | Environments | Queries | Updates | Creating Raw Data Files | Implementation Details
There are many ways to create raw data files. Omnidex is especially versatile at accessing data files from many different sources. Here are some of the approaches that can be used to generate raw data files:
Omnidex SQL statements can be used to generate different types of raw data files. The EXPORT statement can be used to convert the results of any SQL statement into any of the types raw data files supported by Omnidex. These EXPORT statements can be as simple as exporting all of the columns from a table, or as complex as joining multiple tables with complex aggregations and expressions.
This example exports all of the columns and rows from a table.
export (select *
from INDIVIDUALS)
to individuals.dat
with DELETE;
This example joins two tables and exports specific columns, applying criteria to restrict the rows returned. It also uses SQL functions to create new columns.
export (select I.NAME,
H.ADDRESS,
H.CITY,
H.STATE,
H.ZIP,
I.PHONE,
I.EMAIL,
$compare_dates(I.BIRTHDAY, current_date, 'YEARS') AGE
from INDIVIDUALS I
join HOUSEHOLDS H on I.HOUSEHOLD = H.HOUSEHOLD
where H.STATE = 'CA')
to CA_individuals.dat
with DELETE;
This example joins two tables and exports aggregations to form a summary table.
export (select H.STATE,
H.ZIP,
count(distinct H.HOUSEHOLD),
count(*)
from INDIVIDUALS I
join HOUSEHOLDS H on I.HOUSEHOLD = H.HOUSEHOLD
group by H.STATE,
H.ZIP)
to individuals_summary.dat
with DELETE;
See also: