Pages

Monday, June 23, 2014

SQL Function – Len ( )

The LEN functions return the length of char. LEN calculates length using characters as defined by the input character set. LENB uses bytes instead of characters. char can be any of the data types CHAR, VARCHAR2, NCHAR, NVARCHAR2, CLOB, or NCLOB. The return value is of data type NUMBER. If char has data type CHAR, then the length includes all trailing blanks. If char is null, then this function returns null.

Restriction on LENB the LENB function is supported for single-byte LOBs only. It cannot be used with CLOB and NCLOB data in a multibyte character set

SQL Function Len( ) Syntax:

Sunday, June 22, 2014

SQL Function - Round ( )

ROUND returns n rounded to integer places to the right of the decimal point. If you omit integer, then n is rounded to 0 places. The argument integer can be negative to round off digits left of the decimal point.

n can be any numeric data type or any nonnumeric data type that can be implicitly converted to a numeric data type. The argument integer must be an integer. If you omit integer, then the function returns the same data type as the numeric data type of the argument. If you include integer, then the function returns NUMBER.

Monday, June 2, 2014

SQL Function - Now( )

The Now ( ) Function returns the current date and time as a value in 'YYYY-MM-DD HH:MM:SS' or YYYYMMDDHHMMSS format, based where the function is used, whether the function is used in a string or numeric context. The value is expressed in the current time zone of the server where the database has nested.

SQL Function NOW( ) Syntax:

SELECT NOW() FROM table_name;

SQL Function NOW( ) Example: