This Oracle tutorial explains how to use literals (text, integer, and number) in Oracle with examples.
In Oracle, a literal is the same as a constant. We'll cover four types of literals - text literals, integer literals, number, and date/time literals.
Text literals are always surrounded by single quotes (').
For example:
Integer literals can be up to 38 digits. Integer literals can be either positive numbers or negative numbers. If you do not specify a sign, then a positive number is assumed. Here are some examples of valid integer literals:
Number literals can be up to 38 digits. Number literals can be either positive or negative numbers. If you do not specify a sign, then a positive number is assumed. Here are some examples of valid number literals:
Date and time are enclosed in single quotes (').
For example:
When dealing with date/time values, you will want to use the TO_DATE function to convert a literal to a date.
For example:
This example will take a literal value of '2015/04/30' and convert it to a date.