PL/SQL DataType: Block to learn how to declare a character type variable
PL/SQL DataType: Exercise-1 with Solution
Write a PL/SQL block to learn how to declare a character type variable.
Sample Solution:
PL/SQL Code:
or can also be declare like this-
if you declare like this and used to insert too long data, see an error message will appear.
Sample Output:
DECLARE * ERROR at line 1: ORA-06502: PL/SQL: numeric or value error: character string buffer too small ORA-06512: at line 4
Flowchart:



or also the error message will appear if you declare like this at the time of inserting too long data -
Sample Output:
DECLARE * ERROR at line 1: ORA-06502: PL/SQL: numeric or value error: character string buffer too small ORA-06512: at line 4
Flowchart:

Improve this sample solution and post your code through Disqus
Previous: PL/SQL DataType Exercises Home.
Next: Write a PL/SQL block to insert data to a table using character type variable.
What is the difficulty level of this exercise?
Based on 5848 votes, average difficulty level of this exercise is Easy
.