日期:2014-05-16  浏览次数:20533 次

Oracle外部表ORACLE_LOADER类型的创建语法详解

This chapter describes the access parameters for the default external tables access driver, ORACLE_LOADER . You specify these access parameters when you create the external table.

To use the information in this chapter, you must have some knowledge of the file format and record format (including character sets and field datatypes) of the datafiles on your platform. You must also know enough about SQL to be able to create an external table and perform queries against it.

The following topics are discussed in this chapter:

  • access_parameters Clause

  • record_format_info Clause

  • field_definitions Clause

  • column_transforms Clause

  • Reserved Words for the ORACLE_LOADER Access Driver

You may find it helpful to use the EXTERNAL_TABLE =GENERATE_ONLY parameter in SQL*Loader to get the proper access parameters for a given SQL*Loader control file. When you specify GENERATE_ONLY , all the SQL statements needed to do the load using external tables, as described in the control file, are placed in the SQL*Loader log file. These SQL statements can be edited and customized. The actual load can be done later without the use of SQL*Loader by executing these statements in SQL*Plus.


See Also:

EXTERNAL_TABLE


Notes:

  • It is sometimes difficult to describe syntax without using other syntax that is not documented until later in the chapter. If it is not clear what some syntax is supposed to do, you might want to skip ahead and read about that particular element.

  • Many examples in this chapter show a CREATE TABLE...ORGANIZATION EXTERNAL statement followed by a sample of contents of the datafile for the external table. These contents are not part of the CREATE TABLE statement, but are shown to help complete the example.

  • When identifiers (for example, column or table names) are specified in the external table access parameters, certain values are considered to be reserved words by the access parameter parser. If a reserved word is used as an identifier, it must be enclosed in double quotation marks. See Reserved Words for the ORACLE_LOADER Access Driver .


access_parameters Clause

The access parameters clause contains comments, record formatting, and field formatting information.

The description of the data in the data source is separate from the definition of the external table. This means that:

  • The source file can contain more or fewer fields than there are columns in the external table

  • The datatypes for fields in the data source can be different from the columns in the external table

As stated earlier, the access driver ensures that data from the data source is processed so that it matches the definition of the external table.

The syntax for the access_parameters clause is as follows:

Description of et_access_param.gif follows
Description of the illustration et_access_param.gif

comments

Comments are lines that begin with two hyphens followed by text. Comments must be placed before any access parameters, for example: