The oracle SUBSTR functions return a portion of string, beginning at a specified position in the string.This functions allows to extract a substring from a string.To know the position of a string in a string you can use INSTR function.
The oracle INSTR function returns the location of a sub string in a string.The search is case sensitive.If the specified string is not found, then the instr Oracle function will return 0.
To_timestamp method in oracle is used with string (varchar2 or similar) or character sequences to convert it into timestamp type.The function requires the input string of timestamp and the format string as parameters.
A to_char function is useful while displaying oracle date value to a required string format.This is particularly useful for displaying the dates in the most suitable format required.Few examples of using this method with different formats given below.
The EXTRACT function extracts and returns the value of a specified datetime field from a datetime.It can also be used for extracting specified value from an interval value expression.
The DATE type is stored in a special internal format that includes not just the month, day, and year, but also the hour, minute, and second.There are a number of key words and functions provided by oracle to use the date and timestamp data types in much flexible ways.
The purpose of TO_DATE in Oracle pl/sql is to convert char of CHAR, VARCHAR2, NCHAR, or NVARCHAR2 data type to a value of DATE datatype.Or more generically the Oracle to_date function is used to change a test string (or variable) into an internal date format.
In Oracle Date data is stored in fixed-length fields of seven bytes each, corresponding to century, year, month, day, hour, minute, and second. (Also Read Formatting date in SQL (Oracle) -Simple date forma…) .
Formatting date in SQL (Oracle) -Simple date formatting.Here is few simple SQL date formatting examples that can be useful while displaying dates in different formats.There are a number of formatting techniques available for dates and timestamps.