This shows you the differences between two versions of the page.
dev:odxsql:commands:extract:home [2010/07/04 17:57] tdo |
dev:odxsql:commands:extract:home [2016/06/28 22:38] |
||
---|---|---|---|
Line 1: | Line 1: | ||
- | {{page>:top_add&nofooter&noeditbtn}} | ||
- | <html><div align="center"><span style="color:red">DRAFT</span></div></html> | ||
- | ====== Omnidex SQL: EXTRACT DDL ====== | ||
- | {{page>:sql_bar&nofooter&noeditbtn}} | ||
- | ===== Description ===== | ||
- | The OdxSQL EXTRACT command will Extract DDL statements (CREATE ENVIRONMENT, CREATE DATABASE, CREATE TABLE, CREATE INDEX and CREATE INDEX GROUP) from the currently connected Omnidex Environment to a file. The extracted file can then be modified with an editor and used to build another Omnidex Environment. | ||
- | The EXTRACT command can also be used to generate INSERT, DELETE, and UPDATE statements from the existing data. This would typically be used in a testing environment. | ||
- | |||
- | ===== Syntax ===== | ||
- | |||
- | EXTRACT DDL [FOR <ENVIRONMENT [environment] | DATABASE database>] | ||
- | [TO filespec] [ON [INSTANCE] instance] [WITH options] | ||
- | | ||
- | EXTRACT [CLUSTERED] <INSERTS | UPDATES | DELETE_WHERES | DELETE_EXCEPTS> | ||
- | FROM tables [WHERE criteria] [TO filename] | ||
- | [ON [INSTANCE] instance] [WITH options] | ||
- | ===== Discussion ===== | ||
- | |||
- | If the TO filespec clause is omitted, then the file will be written to extract.sql in the current working directory. | ||
- | |||
- | The CLUSTERED option requires tables to be one parent table and any number of linked children. | ||
- | ===== Examples ===== | ||
- | |||
- | connect myenv.xml; | ||
- | extract ddl to myenvnew.sql; | ||
- | |||
- | extract ddl to myenv.sql with delete; | ||
- | |||
- | |||
- | |||
- | {{page>:bottom_add&nofooter&noeditbtn}} |