Integration: Relational Databases

SQL Server

Environments

The Omnidex Environment File contains metadata that describes the SQL Server database and the Omnidex configuration. This includes the following connection and schema information:

  • SQL Server system, user, or file datasource
  • SQL Server user and password
  • SQL Server schema information tables, columns, and datatypes
  • SQL Server primary and foreign key constraints
  • SQL Server native indexes

Automatically Generating an Omnidex Environment File

Omnidex can automatically generate the CREATE ENVIRONMENT, CREATE DATABASE, CREATE TABLE, and CREATE INDEX statements needed for an Omnidex Environment File. The EXTRACT statement is used to connect to the SQL Server database, query the underlying schema information, and generate the appropriate statements. This statement can be issued through OdxSQL, or through any ODBC or JDBC application.

extract       DDL
  for         SQLSERVER
  to          "simple.sql"
  with        DSN="simple"
              VERSION="9"
              USER="simple"
              PASSWORD="simple"
              DATABASE="simple"
              INDEX_DIRECTORY="idx"


The following options from the EXTRACT SQL statement are used to provide SQL Server connection information and control the output of the statement. These options also correlate with the options of the CREATE DATABASE statement.

DSN or FILEDSN

The DSN option references a system or user datasource for the database, and the FILEDSN option references a file datasource for the database. These datasources are created within SQL Server to access the native SQL Server database.

USER

The user to be used when accessing SQL Server. One user and password is used when connecting to the SQL Server database. That login determines the security access to the database and the visibility of the underlying database objects. This option is required unless a user and password is included in the datasource.

PASSWORD

The password to be used when accessing SQL Server. This password must correspond to the user referenced in the USER option. This option is required unless a user and password is included in the datasource, or unless the user does not require a password.

DATABASE

The DATABASE option controls the logical database name to be recorded in the Omnidex Environment File for this database. This is not a SQL Server setting, but rather a logical name given to the database for use in Omnidex statements. This option is required.

TABLES

The TABLES option controls the table schema information to be extracted from SQL Server. The TABLES option can include a comma-separated list of tables or โ€œ*โ€ to extract all tables. If this option is omitted, then all available tables are extracted.

INDEX_DIRECTORY

The INDEX_DIRECTORY option declares the directory to contain the Omnidex indexes. This is not a SQL Server setting, but rather a path designation where indexes should be built. This directory can include either absolute or relative path designations. If this option is omitted, then the indexes will be built in the same directory as the Omnidex Environment File.

Limitations of the Omnidex EXTRACT statement

The extracted CREATE statements represent the best translations that can be automatically generated from SQL Server; however, these statements may require edits by the administrator. Edits that may be required include:

  • SQL Server object names, such as tables, columns, constraints or indexes, are reduced to 32 bytes in length for use in Omnidex.
  • SQL Server National Character datatypes, which are commonly used to store Unicode data, are shown as CHARACTER or STRING datatype, as these are the most universal datatypes in an Omnidex application. If necessary, these can be changed to Omnidex NCHARACTER or NSTRING datatypes.
  • Depending on the configuration of the SQL Server database, some constraint information may not be available and must be added manually.โ€

Manually Creating an Omnidex Environment File

An Omnidex Environment File can also be created by manually issuing CREATE ENVIRONMENT, CREATE DATABASE, CREATE TABLE, and CREATE INDEX statements in OdxSQL or using ODBC or JDBC. If these statements are written to a text batch file, then that file can be submitted to OdxSQL using the USE command.

Additional Resources

See also:

 
Back to top
integration/rdbms/sqlserver/environments.txt ยท Last modified: 2016/06/28 22:38 (external edit)
 
 
chimeric.de = chi`s home Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0