| 0 comments ]

A literal and constant value are synonyms to one another and refer to a fixed data value.
The types of literals recognized by oracle are
  • Text literals
  • Integer literals
  • Number literals
  • Interval literals
Text Literals :
It specifies a text or character literal.
It is used to specify values whenever text or char appear in
  • Expressions
  • Conditions
  • Sql function
  • Sql statements
Text literal should be enclosed in single quotes.
They have properties of both char and varchar2 data types.
A text literal can have a maximum length of 4000 bytes.

Example :
'Employee Information'
'Manager''s Specification'
N'nchar literal'

Using Literal Character Strings :  
A literal that is declared in a select list can be character, a number, or a date.
A literal is not a column name or a column alias.
A literal is printed for each row, that is retrieved by the select statement.
Literal strings of free form text can be included in the query as per the requirement.
Date and character literals must be enclosed within the single quotation marks.
Literals increase the readability of the output.

0 comments

AddThis

| More
Widget By Devils Workshop