Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

ANYDATA introduction

2025-01-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

ANYDATA special column, which belongs to the Oracle built-in column, for the Oracle database, each value is a data type. When users create tables or clusters, they need to specify the corresponding data type for each column. Even when you create a stored procedure or function, you still need to specify the appropriate data type for the parameter.

A data type can be scalar or non-scalar, a scalar contains an atomic value, and a non-scalar (sometimes a set) contains a set value. LOB (Large Object) is a special form of scalar data type that represents large amounts of scalar, binary, or character data.

Oracle built-in data types can be divided into the following categories:

Oracle refers to the corresponding data type through Code code, as shown in the following table:

Table 2-1 Built-in Data Type Summary

CodeData TypeDescription

one

VARCHAR2 (size [BYTE | CHAR])

Variable-length character string having maximum length size bytes or characters. You must specify size for VARCHAR2. Minimum size is 1 byte or 1 character. Maximum size is:

32767 bytes or characters ifMAX_STRING_SIZE = EXTENDED

4000 bytes or characters ifMAX_STRING_SIZE = STANDARD

Refer to "Extended Data Types" for more information on the MAX_STRING_SIZEinitialization parameter.

BYTE indicates that the column will have byte length semantics. CHAR indicates that the column will have character semantics.

one

NVARCHAR2 (size)

Variable-length Unicode character string having maximum length size characters. You must specify size for NVARCHAR2. The number of bytes can be up to two timessize for AL16UTF16 encoding and three timessize for UTF8 encoding. Maximumsize is determined by the national character set definition, with an upper limit of:

32767 bytes if MAX_STRING_SIZE = EXTENDED

4000 bytes if MAX_STRING_SIZE = STANDARD

Refer to "Extended Data Types" for more information on the MAX_STRING_SIZEinitialization parameter.

two

NUMBER [(p [, s])]

Number having precision p and scale s. The precision p can range from 1 to 38. The scale s can range from-84 to 127,127. Both precision and scale are in decimal digits. ANUMBER value requires from 1 to 22 bytes.

two

FLOAT [(p)]

A subtype of the NUMBER data type having precision p. A FLOAT value is represented internally as NUMBER. The precision p can range from 1 to 126 binary digits. A FLOATvalue requires from 1 to 22 bytes.

eight

LONG

Character data of variable length up to 2 gigabytes, or 231-1 bytes. Provided for backward compatibility.

twelve

DATE

Valid date range from January 1, 4712 BC, to December 31, 9999 AD. The default format is determined explicitly by theNLS_DATE_FORMAT parameter or implicitly by theNLS_ TERRITORY parameter. The size is fixed at 7 bytes. This data type contains the datetime fields YEAR, MONTH, DAY, HOUR,MINUTE, and SECOND. It does not have fractional seconds or a time zone.

one hundred

BINARY_FLOAT

32-bit floating point number. This data type requires 4 bytes.

one hundred and one

BINARY_DOUBLE

64-bit floating point number. This data type requires 8 bytes.

one hundred and eighty

TIMESTAMP [(fractional_seconds_precision)]

Year, month, and day values of date, as well as hour, minute, and second values of time, where fractional_seconds_precision is the number of digits in the fractional part of the SECOND datetime field. Accepted values of fractional_seconds_precision are 0 to 9. The default is 6. The default format is determined explicitly by theNLS_TIMESTAMP_FORMAT parameter or implicitly by theNLS_ TERRITORY parameter. The size is 7 or 11 bytes, depending on the precision. This data type contains the datetime fields YEAR, MONTH, DAY, HOUR,MINUTE, and SECOND. It contains fractional seconds but does not have a time zone.

one hundred and eighty one

TIMESTAMP [(fractional_seconds_precision)] WITHTIME ZONE

All values of TIMESTAMP as well as time zone displacement value, wherefractional_seconds_precision is the number of digits in the fractional part of theSECOND datetime field. Accepted values are 0 to 9. The default is 6. The default format is determined explicitly by theNLS_TIMESTAMP_FORMAT parameter or implicitly by theNLS_ TERRITORY parameter. The size is fixed at 13 bytes. This data type contains the datetime fields YEAR, MONTH,DAY, HOUR, MINUTE, SECOND,TIMEZONE_HOUR, and TIMEZONE_MINUTE. It has fractional seconds and an explicit time zone.

two hundred and thirty one

TIMESTAMP [(fractional_seconds_precision)] WITHLOCAL TIME ZONE

All values of TIMESTAMP WITH TIME ZONE, with the following exceptions:

Data is normalized to the database time zone when it is stored in the database.

When the data is retrieved, users see the data in the session time zone.

The default format is determined explicitly by the NLS_TIMESTAMP_FORMAT parameter or implicitly by the NLS_TERRITORYparameter. The size is 7 or 11 bytes, depending on the precision.

one hundred and eighty two

INTERVAL YEAR [(year_precision)] TOMONTH

Stores a period of time in years and months, where year_precision is the number of digits in the YEAR datetime field. Accepted values are 0 to 9. The default is 2. The size is fixed at 5 bytes.

one hundred and eighty three

INTERVAL DAY [(day_precision)] TOSECOND [(fractional_seconds_precision)]

Stores a period of time in days, hours, minutes, and seconds, where

Day_precision is the maximum number of digits in the DAY datetime field. Accepted values are 0 to 9. The default is 2.

Fractional_seconds_precisionis the number of digits in the fractional part of the SECOND field. Accepted values are 0 to 9. The default is 6.

The size is fixed at 11 bytes.

twenty-three

RAW (size)

Raw binary data of length size bytes. You must specify size for a RAW value. Maximum size is:

32767 bytes if MAX_STRING_SIZE = EXTENDED

2000 bytes if MAX_STRING_SIZE = STANDARD

Refer to "Extended Data Types" for more information on the MAX_STRING_SIZEinitialization parameter.

twenty-four

LONG RAW

Raw binary data of variable length up to 2 gigabytes.

sixty-nine

ROWID

Base64 string representing the unique address of a row in its table. This data type is primarily for values returned by the ROWIDpseudocolumn.

two hundred and eight

UROWID [(size)]

Base64 string representing the logical address of a row of an index-organized table. The optional size is the size of a column of type UROWID. The maximum size and default is 4000 bytes.

ninety-six

CHAR [(size [BYTE | CHAR])]

Fixed-length character data of length sizebytes or characters. Maximum size is 2000 bytes or characters. Default and minimumsize is 1 byte.

BYTE and CHAR have the same semantics as for VARCHAR2.

ninety-six

NCHAR [(size)]

Fixed-length character data of length sizecharacters. The number of bytes can be up to two times size for AL16UTF16 encoding and three times size for UTF8 encoding. Maximum size is determined by the national character set definition, with an upper limit of 2000 bytes. Default and minimum size is 1 character.

one hundred and twelve

CLOB

A character large object containing single-byte or multibyte characters. Both fixed-width and variable-width character sets are supported, both using the database character set. Maximum size is (4 gigabytes-1) * (database block size).

one hundred and twelve

NCLOB

A character large object containing Unicode characters. Both fixed-width and variable-width character sets are supported, both using the database national character set. Maximum size is (4 gigabytes-1) * (database block size). Stores national character set data.

one hundred and thirteen

BLOB

A binary large object. Maximum size is (4 gigabytes-1) * (database block size).

one hundred and fourteen

BFILE

Contains a locator to a large binary file stored outside the database. Enables byte stream I/O access to external LOBs residing on the database server. Maximum size is 4 gigabytes.

Any Types

The Any type is used to handle unknown procedure parameters and the actual types of table columns. This data type allows you to dynamically encapsulate and access type descriptions, data instances, and instance datasets of any SQL class, which are constructed and accessed by OCI and PL/SQL interfaces

ANYTYPE

This type contains a type description of the name or unnamed temporary type of any SQL type.

ANYDATA

This type contains an instance of a given type, the data type is described, and ANYDATA can be used like the data type of a column in a table, and various mixed values are stored in that column. These values can be SQL built-in types and user-defined types.

ANYDATASET

This type contains a given type description plus type instance set, and ANYDATASET can be flexibly used for process parameter data types, and these values can also be SQL built-in types and user-defined types.

Introduction to data types:

Http://docs.oracle.com/database/121/SQLRF/sql_elements001.htm#SQLRF0021

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report