10.12.2012 Views

Oracle C++ Call Interface Programmer's Guide

Oracle C++ Call Interface Programmer's Guide

Oracle C++ Call Interface Programmer's Guide

SHOW MORE
SHOW LESS

Create successful ePaper yourself

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

Overview of the INTYPE File<br />

The lines that begin with the TYPE keyword specify which types in the database<br />

should be translated. In this case, the EMPLOYEE, ADDRESS, ITEM, PERSON, and<br />

PURCHASE_ORDER types are set to be translated.<br />

The TRANSLATE ... AS keywords specify that the name of an object attribute<br />

should be changed when the type is translated into a C structure. In this case, the<br />

SALARY$ attribute of the employee type is translated to salary.<br />

The AS keyword in the final line specifies that the name of an object type should be<br />

changed when it is translated into a structure. In this case, the purchase_order<br />

database type is translated into a structure called p_o.<br />

If you do not use AS to translate a type or attribute name, then the database name of<br />

the type or attribute will be used as the C identifier name, except that the CASE<br />

parameter will be observed, and any characters that cannot be mapped to a legal C<br />

identifier character will be replaced by an underscore character (_). Consider the<br />

following reasons for translating a type or attribute:<br />

■ The name contains characters other than letters, digits, and underscores<br />

■ The name conflicts with a C keyword<br />

■ The type name conflicts with another identifier in the same scope. This can<br />

happen, for example, if the program uses two types with the same name from<br />

different schemas.<br />

■ The programmer prefers a different name<br />

The OTT utility may need to translate additional types that are not listed in the<br />

INTYPE file. This is because the OTT utility analyzes the types in the INTYPE file<br />

for type dependencies before performing the translation, and it translates other<br />

types as necessary. For example, if the ADDRESS type were not listed in the INTYPE<br />

file, but the Person type had an attribute of type ADDRESS, then the OTT utility<br />

would still translate ADDRESS because it is required to define the Person type.<br />

Note: As of release 1 (9.0.1), you may indicate whether the OTT<br />

utility is to generate required object types that are not specified in<br />

the INTYPE file. Set TRANSITIVE=FALSE so the OTT utility will<br />

not to generate required object types. The default is<br />

TRANSITIVE=TRUE.<br />

A normal case insensitive SQL identifier can be spelled in any combination of<br />

uppercase and lowercase in the INTYPE file, and is not quoted.<br />

How to Use the Object Type Translator Utility 7-15

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

Saved successfully!

Ooh no, something went wrong!