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

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

OTT Utility Reference<br />

The Pro*C/<strong>C++</strong> application that uses the OTT-generated structures uses the types<br />

sam.Company, joe.Dept, and Person. Person without a schema name refers to<br />

the Person type in the schema to which the application is connected.<br />

If the OTT utility and the application both connect to schema joe, then the<br />

application uses the same type (joe.Person) that the OTT utility uses. If the OTT<br />

utility connects to schema joe but the application connects to schema mary, then<br />

the application uses the type mary.Person. This behavior is appropriate only if<br />

the same CREATE TYPE Person statement has been executed in schema joe and<br />

schema mary.<br />

On the other hand, the application uses type joe.Dept regardless of which schema<br />

the application is connected to. If this is the behavior you want, then be sure to<br />

include schema names with your type names in the INTYPE file.<br />

In some cases, the OTT utility translates a type that the user did not explicitly name.<br />

For example, consider the following SQL declarations:<br />

CREATE TYPE Address AS OBJECT<br />

(<br />

street VARCHAR2(40),<br />

city VARCHAR(30),<br />

state CHAR(2),<br />

zip_code CHAR(10)<br />

);<br />

CREATE TYPE Person AS OBJECT<br />

(<br />

name CHAR(20),<br />

age NUMBER,<br />

addr ADDRESS<br />

);<br />

Suppose that the OTT utility connects to schema joe, SCHEMA_NAMES=FROM_<br />

INTYPE is specified, and the user’s INTYPE files include either<br />

TYPE Person<br />

or<br />

TYPE joe.Person<br />

The INTYPE file does not mention the type joe.Address, which is used as a<br />

nested object type in type joe.Person.<br />

How to Use the Object Type Translator Utility 7-133

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

Saved successfully!

Ooh no, something went wrong!