PL/SQL Fundamentals Exercises: PL/SQL block to show a valid case-insensitivity
PL/SQL Fundamentals: Exercise-9 with Solution
Write a PL/SQL block to show a valid case-insensitive reference to a quoted and without quoted user-defined identifier.
When identifier is enclosing with double quotation and reference to the identifier is without quoted:
DECLARE
"WELCOME" varchar2(10) := 'welcome'; -- identifier with quotation
BEGIN
DBMS_Output.Put_Line(Welcome); --reference to the identifier without quotation
END;
/
Sample Output:
welcome Statement processed. 0.00 seconds
When identifier is enclosing without double quotation and reference to the identifier is without quoted:
DECLARE
WELCOME varchar2(10) := 'welcome'; -- identifier without quotation
BEGIN
DBMS_Output.Put_Line(Welcome);-- reference to the identifier without quotation
END;
/
Sample Output:
welcome Statement processed. 0.00 seconds
Flowchart:
Improve this sample solution and post your code through Disqus
Previous: Write PL/SQL blocks to show the scope and visibility of local and global identifiers.
Next: Write a PL/SQL block to adjust the salary of the employee whose ID 122.
What is the difficulty level of this exercise?
- Weekly Trends and Language Statistics
- Weekly Trends and Language Statistics