ORACLE - Conversion Functions : To_Number

The to_number function converts a string to a number.

The syntax is:
to_number( string1, [ format_mask ], [ nls_language ] )
string1 is the string that will be converted to a number.
format_mask is optional. This is the format that will be used to convert string1 to a number.
nls_language is optional. This is the nls language used to convert string1 to a number.

For example:
to_number('981.53', 9999.99') would return the number 981.53
to_number('225', '999') would return the number 225
to_number('23', '99') would return the number 23

Since the format_mask and nls_language parameters are optional, you can simply convert a text string to a numeric value as follows:
to_number('1210.73'') would return the number 1210.73

ORACLE - Date Functions : Months_Between

The months_between function returns the number of months between date1 and date2.

The syntax is:
months_between( dateA, dateB )
dateA and dateB are the dates used to calculate the number of months.
If a fractional month is calculated, the months_between function calculates the fraction based on a 31-day month.

Example :
months_between (to_date ('2008/01/01', 'yyyy/mm/dd'), to_date ('2008/03/14', 'yyyy/mm/dd') )
would return -2.41935483870968
months_between (to_date ('2008/10/18', 'yyyy/mm/dd'), to_date ('2008/8/18', 'yyyy/mm/dd') )
would return 2

Applies To:
*Oracle 10g
*Oracle 11g

ORACLE - Date Functions : Add_Months

The add_months function returns a date plus number months.
The syntax is:
add_months( date, number )

date : is the starting date (before the n months have been added).
number : is the number of months to add to date.

Example:
add_months('10-Feb-08', 1) would return '10-Mar-08'
add_months('01-Aug-03', 3) would return '01-Nov-03'
add_months('01-Sep-08', -3) would return '01-Jun-08'

Applies To:
* Oracle 8i
* Oracle 9i
* Oracle 10g
* Oracle 11g

Oracle - Tuning

Tuning Goals

  1. Response time
  2. Database availability
  3. Database hit percentages
  4. Memory utilization