13.01.2013 Views

OpenEdge Data Management: DataServer for Microsoft SQL Server

OpenEdge Data Management: DataServer for Microsoft SQL Server

OpenEdge Data Management: DataServer for Microsoft SQL Server

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Initial Programming Considerations<br />

2–4<br />

Naming conventions<br />

When planning <strong>for</strong> maximum transparency across <strong>OpenEdge</strong> databases and MS <strong>SQL</strong> <strong>Server</strong><br />

data sources, be sure to consider the restrictions that each places on naming data source objects<br />

when you per<strong>for</strong>m a <strong>OpenEdge</strong> DB to MS <strong>SQL</strong> <strong>Server</strong> conversion. Table 2–2 describes these<br />

restrictions, and the notes that follow discuss how the <strong>Data</strong><strong>Server</strong> resolves differences between<br />

<strong>OpenEdge</strong> and MS <strong>SQL</strong> <strong>Server</strong> database naming conventions.<br />

Table 2–2: <strong>Data</strong>base naming restrictions<br />

Category <strong>OpenEdge</strong> MS <strong>SQL</strong> <strong>Server</strong><br />

Alphanumeric characters A–Z or a–z<br />

0–9<br />

Special characters Allows $, &, #, %, –, and<br />

_ 1<br />

All alphanumeric characters from<br />

the character set that you defined<br />

<strong>for</strong> your MS <strong>SQL</strong> <strong>Server</strong><br />

Allows @, $, #, _, ¥, and £ 2<br />

Initial character Alphabetic only Alphabetic only<br />

Maximum length of object<br />

name<br />

Keywords Not allowed 4<br />

Unique table names Required 5<br />

32 characters 24 characters 3<br />

Not allowed 4<br />

Required 6<br />

1. Although <strong>OpenEdge</strong> allows you to use the ampersand (&) in database-object names, the <strong>OpenEdge</strong> development<br />

tools use this character internally to denote preprocessor directives.<br />

2. When the <strong>Data</strong><strong>Server</strong> encounters characters not supported by <strong>OpenEdge</strong> in a sequence, table, index, or field name,<br />

it converts them to underscores ( _ ) in the data source. For example, the data source table name emp@status<br />

becomes emp_status in the schema holder. If the unsupported character is at the beginning of an object name, the<br />

<strong>Data</strong><strong>Server</strong> substitutes a lowercase z. Also, the <strong>Data</strong><strong>Server</strong> strips @ symbols from stored procedure parameter<br />

names.<br />

3. Object names are limited to 32 characters. When you use the <strong>OpenEdge</strong> DB to MS <strong>SQL</strong> <strong>Server</strong> utility to per<strong>for</strong>m a<br />

database conversion, however, the utility truncates object names to 24 characters in order to accommodate the suffix<br />

characters that it appends when it finds nonunique names, reused <strong>OpenEdge</strong> keywords, array fields, sequences,<br />

triggers, and so <strong>for</strong>th. If you intend to use the <strong>OpenEdge</strong> DB to MS <strong>SQL</strong> <strong>Server</strong> utility, be sure to limit object names<br />

to 24 characters to accommodate this name resolution during conversion.<br />

4. <strong>OpenEdge</strong> and MS <strong>SQL</strong> <strong>Server</strong> databases contain restrictions against using keywords as database object names. If a<br />

data source object name consists of an <strong>OpenEdge</strong> keyword, the <strong>Data</strong><strong>Server</strong> appends an underscore character ( _ ) to<br />

the name. For example, an object named “each” becomes “each_”<br />

5. MS <strong>SQL</strong> <strong>Server</strong> qualifies nonunique table names to make them unique (see your data source documentation <strong>for</strong><br />

details); however, <strong>OpenEdge</strong> still regards these qualified names as nonunique. The <strong>Data</strong><strong>Server</strong> resolves nonunique<br />

table names <strong>for</strong> you as follows: when <strong>OpenEdge</strong> encounters matching table names while creating or updating a<br />

schema holder, it names the second and subsequent tables table-1, table-2, etc. For example, if <strong>OpenEdge</strong><br />

encounters a table named lee.employee (the employee table owned by the user lee) that is the second instance of the<br />

name in the data source, it names the corresponding table in the schema holder employee-1. Keep in mind that when<br />

resolving naming conventions, the <strong>Data</strong><strong>Server</strong> can append up to three characters to an object name: two in the case<br />

of a nonunique name and one in the case of an <strong>OpenEdge</strong> keyword. There<strong>for</strong>e, you should limit your object names<br />

to 29 characters so that you do not exceed the <strong>OpenEdge</strong> 32-character limit <strong>for</strong> object names in the schema holder.<br />

6. MS <strong>SQL</strong> <strong>Server</strong> allows you to qualify an object name by adding the database name, the owner’s name, or the table<br />

name (<strong>for</strong> columns).

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!