Home

Getting Started

Utilities

Indexing

Omnidex

Development

Tutorials

Quick Links

 

SQL Reference

Commands

Syntax

Options

Example

 

SQL Reference

Joins

Nested Queries

Set Operations

ON CURSOR | INSTANCE

WITH Options

Commands

Functions

 

ATTACH

ATTACH is used to attach an Omnidex Standalone Table (OST) file. This table will then be made available for manipulation the same as any other table in the environment, for the duration of the Omnidex application or until it is detached.

OST's are created using the Omnidex EXPORT statement.

export company, contact, state, status from customers, orders where customers.customer_no=orders.customer_no and status='cncl' to cncl.ost with ost

attach ost 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. The .ost file extension is optional.

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.

 

Options

 

 

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 ost /users/test/cncl as CANCELED

>export company, contact, state, status from customers, orders where customers.customer_no=orders.customer_no and status='back' to cncl 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