[ Pobierz całość w formacie PDF ]
.SQL*Loader extracts data from a field in the input file, guided by the datatypespecification in the control file.SQL*Loader then sends the field to the serverto be stored in the appropriate column (as part of an array of row inserts).Theserver does any necessary data conversion to store the data in the properinternal format.The  Data Conversion and Datatype Specification onpage 3-11 contains diagrams that illustrate these points.The datatype of the data in the file does not necessarily have to be the same asthe datatype of the column in the Oracle table.Oracle automatically performsconversions, but you need to ensure that the conversion makes sense anddoes not generate errors.For instance, when a datafile field with datatypeCHAR is loaded into a database column with datatype NUMBER, you mustmake sure that the contents of the character field represent a valid number.Note: SQL*Loader does not contain datatype specifications for Oracle internaldatatypes such as NUMBER or VARCHAR2.SQL*Loader s datatypesdescribe data that can be produced with text editors (character datatypes) andwith standard programming languages (native datatypes).However,although SQL*Loader does not recognize datatypes like NUMBER andVARCHAR2, any data that Oracle is capable of converting may be loaded intothese or other database columns.5-54 Oracle8 Server Utilities Native DatatypesSome datatypes consist entirely of binary data or contain binary data in theirimplementation.See page 3-10 for a discussion of binary vs.character data.These non-character datatypes are the native datatypes:INTEGER ZONEDSMALLINT VARCHARFLOAT GRAPHICDOUBLE GRAPHIC EXTERNALBYTEINT VARGRAPHIC(packed) DECIMAL RAWSince these datatypes contain binary data, most of them do not readilytransport across operating systems.(See  Loading Data Across DifferentOperating Systems on page 5-68.) RAW data and GRAPHIC data is theexceptions.SQL*Loader does not attempt to interpret these datatypes, butsimply stores them  as is.Additional Information: Native datatypes cannot be specified withdelimiters.The size of the native datatypes INTEGER, SMALLINT,FLOAT, and DOUBLE are determined by the host operating system.Their size is fixed  it cannot be overridden in the control file.(Refer toyour Oracle operating system-specific documentation for moreinformation.) The sizes of the other native datatypes may be specified inthe control file.INTEGERThe data is a full-word binary integer.If you specify start:end in thePOSITION clause, end is ignored.The length of the field is the length of a full-word integer on your system.(Datatype LONG INT in C.) This length cannotbe overridden in the control file.INTEGERSMALLINTThe data is a half-word binary integer.If you specify start:end in thePOSITION clause, end is ignored.The length of the field is a half-word integeris on your system.SMALLINTAdditional Information: This is the SHORT INT datatype in the Cprogramming language.One way to determine its length is to make a smallSQL*Loader Control File Reference 5-55 control file with no data and look at the resulting log file.This length cannotbe overridden in the control file.See your Oracle operating system-specificdocumentation for details.FLOATThe data is a single-precision, floating-point, binary number.If you specifyend in the POSITION clause, it is ignored.The length of the field is the lengthof a single-precision, floating-point binary number on your system.(DatatypeFLOAT in C.) This length cannot be overridden in the control file.DOUBLEThe data is a double-precision, floating-point binary number.If you specifyend in the POSITION clause, it is ignored.The length of the field is the lengthof a double-precision, floating-point binary number on your system.(Datatype DOUBLE or LONG FLOAT in C.) This length cannot be overriddenin the control file.DOUBLEBYTEINTThe decimal value of the binary representation of the byte is loaded.Forexample, the input character x 1C is loaded as 28.The length of a BYTEINTfield is always 1 byte.If POSITION(start:end) is specified, end is ignored.The syntax for this datatype isBYTEINTAn example is(column1 position(1) BYTEINT,column2 BYTEINT,.)ZONEDZONED data is in zoned decimal format: a string of decimal digits, one perbyte, with the sign included in the last byte.(In COBOL, this is a SIGNTRAILING field.) The length of this field is equal to the precision (number ofdigits) that you specify.The syntax for this datatype is:)ZONED ( precision, scale5-56 Oracle8 Server Utilities where precision is the number of digits in the number, and scale (if given) isthe number of digits to the right of the (implied) decimal point.For example:sal POSITION(32) ZONED(8),specifies an 8-digit integer starting at position 32.DECIMALDECIMAL data is in packed decimal format: two digits per byte, except forthe last byte which contains a digit and sign.DECIMAL fields allow thespecification of an implied decimal point, so fractional values can berepresented.The syntax for the this datatype is:DECIMAL ( )precision, scalewhere:precision Is the number of digits in the value.The character length ofthe field, as computed from digits, is (digits + 2) / 2,rounded down.scale Is the scaling factor, or number of digits to the right of thedecimal point.Default is zero (indicating an integer).Maybe greater than the number of digits but may not benegative.For example,sal DECIMAL (7,2)would load a number equivalent to +12345.67.In the data record, this fieldwould take up 4 bytes, as shown in Figure 5-1.(The byte length of aDECIMAL field is equivalent to (N+1)/2, rounded up, where N is the numberof digits in the value, and one is added for the sign.)Figure 5-1: Packed Decimal Representation of +12345.6712 34 56 7CSQL*Loader Control File Reference 5-57 RAWThe data is raw, binary data loaded  as is.It does not undergo character setconversion [ Pobierz całość w formacie PDF ]
  • zanotowane.pl
  • doc.pisz.pl
  • pdf.pisz.pl
  • agnieszka90.opx.pl