TREAT allows you to change the declared type of the expr argument. This function comes in handy when you have a subtype that is more specific to your data and you want to convert the parent type to the more
Sysdate – Oracle SQL Function
SYSDATE returns a DATE that represents the date and time set on the operating system of the machine Oracle is installed on. The format of SYSDATE is controlled by the NLS_DATE_FORMAT session parameter. Example: SELECT SYSDATE FROM DUAL; SYSDATE ——————-
Power – Oracle SQL Function
POWER returns the first argument raised to the power of the second. The arguments can be a numeric value or any type that can be implicitly converted to a number. Using POWER is a good way of turning a LOG
Trim – Oracle SQL Function
TRIM returns a VARCHAR2 string with either the leading, trailing, or both the leading and trailing characters char trimmed from source. TRIM([LEADING] [TRAILING] [BOTH] char FROM SOURCE) IF you specify TRAILING then the trailing characters that match char will be
Systimestamp – Oracle SQL Function
SYSTIMESTAMP returns a TIMESTAMP WITH TIME ZONE result from the underlying operating system date, timestamp, fractional seconds and time zone. Example: SELECT SYSTIMESTAMP FROM DUAL; SYSTIMESTAMP ————————————- 13-SEP-05 10.40.32.818000 PM -05:00
Remainder – Oracle SQL Function
REMAINDER returns the remainder of the 1st argument divided by the 2nd argument. Remainder is similar to MOD except thaqt REMAINDER uses ROUND in its calculations, whereas MOD uses FLOOR. Example: SELECT REMAINDER(10,3) as remainder_value from dual; REMAINDER_VALUE ——————————– 1
Upper – Oracle SQL Function
UPPER returns a VARCHAR2 string that contains all the characters of argument1 in uppercase. The argument1 can be a CHAR, VARCHAR2,NCHAR,NVARCHAR2,CLOB or NCLOB data type. Example: SELECT UPPER(‘oracle rocks’) as RESULT from DUAL; RESULT —————— ORACLE ROCKS
Asciistr – Oracle SQL Function
ASCIISTR takes a string argument and returns the ASCII equivalent. If any of the characters in the string are non ASCII, they are converted to the UTF-16xxxx format. Syntax: ASCIISTR(string) Example: SELECT ASCIISTR(‘a non-ascii char ŷ’ as RESULT FROM DUAL;
Sign – Oracle SQL Function
SIGN returns a NUMBER that specifies the sign of the 1st argument. The possible return values are: -1 if the number is 0 -1 if the number is aBINARY_FLOAT or BINARY_DOUBLE and is = 0 or is Nan Example: SELECT
ADD_MONTHS – Oracle SQL Function
ADD_MONTHS returns a DATE which is argument1 plus num, or number of months. The argument1 can be a DATE or any type that can be implicitly converted to a DATE. The num argument can be a NUMBER, or any type
