w3resource

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:

Flowchart: PL/SQL Fundamentals Exercise - PL/SQL block to show a valid case-insensitivity

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?



Become a Patron!

Follow us on Facebook and Twitter for latest update.

It will be nice if you may share this link in any developer community or anywhere else, from where other developers may find this content. Thanks.

https://www.w3resource.com/plsql-exercises/fundamentals/plsql-fundamentals-exercise-9.php