Select column_name, data_type, data_length, data_precision, data_scale The following creates a table with various numeric data types: create table numeric_data ( Oracle Database also supports ANSI numeric types, which map back to built-in types. These also allow you to store the special values infinity and NaN (not a number). The limits for these data types are: Value Binary_double is a 64-bit, double-precision floating-point. They can have any number of digits after the decimal point.īinary_float is a 32-bit, single-precision floating-point number. But we recommend that you use binary_float or binary_double instead. You can use it to store floating-point numbers. If you omit the precision and scale, the number defaults to the maximum range and precision. The database rounds values that exceed the scale. Scale determines the digits from the decimal point. The precision states the number of significant figures allowed.
The format of it is: number ( precision, scale ) This is the most common numeric data type.
You use these to store numeric values, such as prices, weights, etc. The built-in numeric data types for Oracle Database are: Select column_name, data_type, data_lengthĮach of these types also has an N variation nchar, nvarchar2, and nclob. The following statement creates a table with various character columns: create table character_data ( In a default Oracle Database installation this is 32Tb! It can store data up to (4 gigabytes - 1) * (database block size). If you need to store text larger than the upper limit of a varchar2, use a clob. In the vast majority of cases, you should use varchar2 for short strings. Only use char if you need fixed-width data. If the text you insert is shorter than the max length for the column, the database right pads it with spaces. From 12.1 you can increase this length to 32,767.
In Oracle Database 11.2 and before, the maximum you can specify is 4,000 bytes. You need to specify an upper limit for the size of these strings. You use these to store general purpose text. Oracle Database has three key character types: