91-9990449935 0120-4256464 |
PL/SQL ConstantsA constant is a value used in a PL/SQL block that remains unchanged throughout the program. It is a user-defined literal value. It can be declared and used instead of actual values. Let's take an example to explain it well: Suppose, you have to write a program which will increase the salary of the employees upto 30%, you can declare a constant and use it throughout the program. Next time if you want to increase the salary again you can change the value of constant than the actual value throughout the program. Syntax to declare a constant:
Example of PL/SQL constantLet's take an example to explain it well: After the execution of the above code at SQL prompt, it will produce the following result:. PL/SQL LiteralsLiterals are the explicit numeric, character, string or boolean values which are not represented by an identifier. For example: TRUE, NULL, etc. are all literals of type boolean. PL/SQL literals are case-sensitive. There are following kinds of literals in PL/SQL:
Example of these different types of Literals:
Next TopicPL/SQL If
|