DETAILED SPECIFICATION OF PL/SQL DATA TYPES:
a) They let the programmer to store Numeric data, represent quantities and apply calculations.
BINARY_INTEGER:
a) It is used to store signed integers.
b) Its magnitude range is -2power31.....2power31.
c) They occupy less storage space than Number values.
d) Arithmetic operations on Binary_Integer values are more faster than Number Arithmetic.
BINARY_INTEGER SUBTYPES:
a) A base type is the data type from which a subtype is derived.
b) A subtype associates a base type with a constraint and hence defines a subset of values.
c) The subtypes available are
*NATURAL *NATURAIN *POSITIVE *POSITIVEN *SIGNTYPE
Natural and Positive: They restrict an integer variable to Non-Negative or Positive values.
Naturain and Positiven: Prevent the assigning of NULLs' to an integer variables.
Signtype: Lets you restrict an integer variable to the values -1, 0, 1, used in programming to state logic.
BINARY_FLOAT and BINARY_DOUBLE:
a) These datatypes are used primarily for high-speed Scientific computation.
b) Literals of these types will end with f(for Binary_Float) or ( for Binary_Double).
c) Computations involving these datatypes produce special values, rather than raising exceptions.
d) Need special functions to deal with overflow, underflow and other conditions.
NUMBER:
a) This datatype is used to store Fixed_Point of Floating_Point Numbers.
b) The magnitude range is 1*10power-130...... 10*10power125 , above this range numeric overflow or underflow error is generated.
c)Precision can be specified, for total number of digits and scale.
Syntax: NUMBER(P,S);
NUMBER SUBTYPES:
a) These subtypes are used for more descriptive name.
b) The NUMBER subtypes are used for compatibility with ANSI/ISO and IBM types.
c) The subtypes available are
*DEC *DECIMAL *DOUBLE PRECISION *FLOAT *INTEGER
*INT *NUMBER *REAL *SMALL INT
d) The subtypes DEC, DECIMAL and NUMBER are used to declare fixed point numbers with a maximum precision of 38 decimal digits.
e) The subtypes DOUBLE PRECISION and FLOAT are used to declare floating point number with a maximum precision of 126 binary digits.
f) The REAL subtypes is used to declare floating point number with a maximum precision of 63 binary digits, roughly equivalent to 18 decimal digits.
g) The subtypes INTEGER,INT and SMALL INT are used to declare integers with a maximum precision of 38 Decimal Digits.
PLS_INTEGER:
a) PLS_INTEGER datatypes is used to store signed integers.
b) The magnitude range is -2power31.....2power31.
c)PLS_INTEGER value requires less storage than NUMBER values.
d) They use Machine Arithmetic, hence result in faster calculation.
PL/SQL Character and String Types:
a) Character types let you store alphanumeric data, represent words and test, and also manipulate character strings.
CHAR:
a) It is used to store fixed length character data.
b) The maximum size is 32767 Bytes.
Syntax: CHAR[Max_Size[CHAR/BYTE])]
c) If the maximum size is not specified then it defaults to 1.
CHAR SUBTYPE(Character):
a) It has the same range of values as its base type.
b) CHARACTER is just another name for CHAR, having compatibility with ANSI/ISO and IBM types
LONG and LONG RAW:
a)It is used to store variable length character strings.
b) The maximum size of LONG is 32760 Bytes.
c) LONG RAW is used to store Binary Data or Binary Strings, it is not interpreted by PL/SQL.
RAW:
a) It is used to store binary data or byte strings.
b) It can store a sequence of graphics characters or a digitized picture.
c) It cannot be interpreted by PL/SQL.
d) The maximum size is 32767 Bytes.
VARCHAR2:
a) It is used to store variable length character data.
b) The maximum size is up to 32767 bytes.
Syntax: VARCHAR2(MaxSize[CHAR/BYTE]);
VARCHAR2 SUBTYPES:
a) The subtypes available are
* STRING * VARCHAR
b) Used for compatibility with ANSI/ISO and IBM types.
BOOLEAN TYPES:
a) It is used to represent Boolean values TRUE and FALSE.
b) It is used to store high logical values TRUE, FALSE and NULL.
c) It takes no parameters, INSERTS & SELECTS not accepted.
DATE:
a) It is used to store fixed length date times.
b) The data portion defaults to the first day of the current month, and time portion defaults to mid night.
c) Valid Range January 1 4712 BC to December 31 9999 A.D.
[7:42 PM
|
0
comments
]



0 comments
Post a Comment
Do comment to make this blog better