Oracle precompiler program




















ORA file. RECENT means that if the object has been selected into the object cache in the current transaction, then that object is returned. For transactions running in serializable mode, this option has the same effect as LATEST without incurring as many network roundtrips.

LATEST means that if the object does not reside in the object cache, it is retrieved from the database. If It does reside in the object cache, it is refreshed from the server. Use LATEST only when it is imperative that the object cache is kept as coherent as possible with the server buffer cache. ANY means that if the object already resides in the object cache, return that object. If not, retrieve the object from the server. ANY incurs the fewest network roundtrips. Use in applications that access read-only objects or when a user will have exclusive access to the objects.

Conditional precompilation includes or excludes sections of code in your C program based on certain conditions. Conditional precompiling lets you write programs that can run in different environments. Conditional sections of code are marked by statements that define the environment and actions to take. The following statements let you exercise conditional control over precompilation:.

Cursor names are SQL identifiers, whose scope is the precompilation unit. Hence, cursor operations cannot span precompilation units files. So, when doing a separate precompilation, make sure all definitions and references to a given cursor are in one file. If you want to use just one SQLCA, you must declare it as global in one of the program modules and as external in the other modules.

Use the extern storage class, and the following define in your code:. Note: All source files in an application must be uniquely named. To get an executable program, you must compile the output. The linker resolves symbolic references in the object modules. If these references conflict, the link fails. This can happen when you try to link third-party software into a precompiled program.

Not all third-party software is compatible with Oracle. So, linking your program shared might cause an obscure problem. In some cases, linking stand-alone or two-task might solve the problem. Compiling and linking are system dependent. See your system-specific Oracle documentation.

Precompiler Options Many useful options are available at precompile time. For example, for the option For example, the option Default Values Many of the options have default values. Determining Current Values You can interactively determine the current value for one or more options by using a question mark on the command line.

For example, if you issue the command proc? Entering: proc will give a short summary which resembles Table Case Sensitivity In general, you can use either uppercase or lowercase for precompiler option names and values. Configuration Files A configuration file is a text file that contains precompiler options. What Occurs during Precompilation?

On the Command Line You enter precompiler options in the command line using the following syntax For example, you might enter the following Usage Notes Most C compilers expect a default extension of ".

DBMS Purpose Specifies whether Oracle follows the semantic and syntactic rules of Oracle8, Oracle7, or the native version of Oracle that is, the version to which the application is connected. For more information, see Appendix C When a SQL data manipulation statement is executed, its associated cursor is linked to an entry in the cursor cache.

Usage Notes Can be entered inline or on the command line. A host variable is a scalar or aggregate variable declared in C and shared with Oracle, meaning that both your program and Oracle can reference its value. Your program uses input host variables to pass data to Oracle. Oracle uses output host variables to pass data and status information to your program. The program assigns values to input host variables; Oracle assigns values to output host variables.

Host variables can be used anywhere a SQL expression can be used. You can also use a C struct to contain a number of host variables. When you name the structure in an embedded SQL statement, prefixed with a colon, Oracle uses each of the components of the struct as a host variable.

You can associate any host variable with an optional indicator variable. An indicator variable is a short integer variable that "indicates" the value or condition of its host variable. A NULL is a missing, unknown, or inapplicable value. In SQL statements, an indicator variable must be prefixed with a colon and immediately follow its associated host variable.

If the host variables are packaged in a struct, and you want to use indicator variables, you simply create a struct that has an indicator variable for each host variable in the host structure, and name the indicator struct in the SQL statement, immediately following the host variable struct, and prefixed with a colon. Typically, a host program inputs data to Oracle, and Oracle outputs data to the program.

Oracle stores input data in database tables and stores output data in program host variables. To store a data item, Oracle must know its datatype , which specifies a storage format and valid range of values.

Oracle recognizes two kinds of datatypes: internal and external. Internal datatypes specify how Oracle stores data in database columns. Oracle also uses internal datatypes to represent database pseudocolumns, which return specific data items but are not actual columns in a table. External datatypes specify how data is stored in host variables.

When your host program inputs data to Oracle, if necessary, Oracle converts between the external datatype of the input host variable and the internal datatype of the target database column. When Oracle outputs data to your host program, if necessary, Oracle converts between the internal datatype of the source database column and the external datatype of the output host variable.

You can also use host arrays inside a host variable struct. That means you can customize the way Oracle interprets input data and formats output data. On a variable-by-variable basis, you can equivalence supported C datatypes to the Oracle external datatypes. You can also equivalence user-defined datatypes to Oracle external datatypes. An identifier called a cursor lets you name a SQL statement, access the information in its private SQL area, and, to some extent, control its processing.

For static SQL statements, there are two types of cursors: implicit and explicit. Oracle implicitly declares a cursor for all data definition and data manipulation statements, including SELECT statements queries that return only one row. However, for queries that return more than one row, to process beyond the first row, you must explicitly declare a cursor or use host arrays. The set of rows returned is called the active set ; its size depends on how many rows meet the query search condition.

You use an explicit cursor to identify the row currently being processed, called the current row. Imagine the set of rows being returned to a terminal screen. A screen cursor can point to the first row to be processed, then the next row, and so on. In the same way, an explicit cursor "points" to the current row in the active set. The HP and Tru64 linkers are one-pass linkers. If you add your own library to the link line, add it to the beginning or to the end of the link line. Do not place user libraries between the Oracle libraries.

If you choose to use a make utility such as nmake or GNU make , be aware of how macro and suffix processing differs from the make utility provided with the platform. Oracle make files are tested and are supported with the make utility for your platform. Oracle library names and the contents of Oracle libraries are subject to change between releases. Correcting Undefined Symbols Solaris Only Oracle provides the symfind utility to assist you in locating a library or object file where a symbol is defined.

When linking a program, undefined symbols are a common error that produce an error message similar to the following:. The error occurs when the linker cannot find a definition for a referenced symbol. If this error message occurs, ensure that the library or object file containing the definition exists on the link line and that the linker is searching the correct directories for the file. The following example shows the output from the symfind utility, used to locate the sqlcex symbol:.

The Oracle libraries provided with this release are thread safe, allowing support for multi-threaded applications.

Oracle9 i uses signals for two-task communication. Signals are installed in a user process when you connect to the database and are removed when you disconnect.

Table describes the signals that Oracle9 i uses for two-task communication. The signal handler uses the wait routine to determine whether a server process died. With this information, you can tweak program parameters for maximum performance.

Although precompiling adds a step to the application development process, it saves time because the precompiler, not you, translates each embedded SQL statement into several calls to the Oracle runtime library SQLLIB.

If you want to access and manipulate Oracle data, you need SQL. SQL has become the database language of choice because it is flexible, powerful, and easy to learn. Being non-procedural, it lets you specify what you want done without specifying how to do it. A few English-like statements make it easy to manipulate Oracle data one row or many rows at a time. For example, you can. Usually, only minor changes are required to switch from interactive to embedded SQL. This reduces network traffic and processing overhead.

SQL has become the standard language for relational database management systems. ANSI standard X3. For a copy of the NIST standard, write to. Specifically, the programs tested for conformance to the C embedded SQL standard. According to FIPS PUB , "an implementation that provides additional facilities not specified by this standard shall also provide an option to flag nonconforming SQL language or conforming SQL language that may be processed in a nonconforming manner.

There are several semantic changes in database operations between Oracle7 and Oracle8. The answers are more informal than the documentation in the rest of this Guide, but do provide references to places where you can find the reference material. A kind of column in the database that contains variable-length character data. This is what Oracle calls an "internal datatype", because it's a possible column type. An Oracle "external datatype" datatype code 9.

You use this only if you're doing dynamic SQL Method 4, or datatype equivalencing. If you need to do low-level coding, use the OCI. It is supported, and Oracle is committed to supporting it.



0コメント

  • 1000 / 1000