The TO_DATE function converts a string to a DATE variable. Syntax: TO_DATE(source_string, Format, NLS_LANGUAGE); --The last parameter NLS_LANGUAGE (which I understand to be for setting the encoding) has never been useful to me. Examples: SQL> sel…
The TO_NUMBER function converts a string value to a numeric (NUMBER) value. Syntax: TO_NUMBER(source_string, Format, NLS_LANGUAGE); --The last parameter NLS_LANGUAGE (as I understand, for setting the encoding) has never been useful to me. Examples:…
The TO_CHAR function converts a date or number to a string. Syntax: TO_CHAR(original_value, Format, NLS_LANGUAGE); --The original value can be either a date (DATE) or a number (NUMBER). --The last parameter NLS_LANGUAGE (such as AMERICAN_AMERICA or RUSSIAN_RUSSIA) is used to specify the language for the date and time format. For example, if you want to display the date in Russian, you would use NLS_LANGUAGE = RUSSIAN_RUSSIA.
A function for calculating the check digit of the EAN13 barcode based on the first 12 digits. Input: a string (12-digit number). Output: the check digit. function GetControlNumber(p_code varchar2) return number is v…