export company, contact, state, status from customers,
orders where customers.customer_no=orders.customer_no and
status='cncl' to cncl.ost with ost
attach /users/test/cncl.ost as CANCELED
select company, contact from customers where state='CO'
Because Omnidex indexes are not installed on the OST, queries
are performed by a serial read.
Detach the attached OST from the open environment using the
DETACH command.
Syntax
ATTACH OST filespec AS table [ON [INSTANCE] instance][WITH
options]
ATTACH OST
Required
filespec
Required - The filespec of the OST file to be attached.
AS table
Required - Assign a table name to the OST as it will be referred
to in all subsequent queries.
[ON [INSTANCE] instance]
Optional - Specify which instance the OST will be assigned
to. Default is the current instance. The "INSTANCE"
keyword is optional.
[WITH options]
Optional - Specify options to be used for this command.
top
OdxSQL Example
This example creates an OST that contains customers who have
canceled their order. Then customers whose orders are on back
order, are added to the OST.
>export company, contact, state, status from
customers, orders where customers.customer_no=orders.customer_no
and status='cncl' to cncl.ost with ost
79 rows exported to cncl.ost
>attach /users/test/cncl.ost as CANCELED
>export company, contact, state, status from
customers, orders where customers.customer_no=orders.customer_no
and status='back' to cncl.ost with ost, append
621 rows exported to cncl.ost
>select company, contact from customers where
state='CO'
...
22 rows returned
>detach ost canceled
table CANCELED detached
top
|