Table name - Lower, upper case
Hi,
Thank you for reading my post.
--------------------------------------------------------------------------------------------------------------------------------
1) I created a table:
CREATE TABLE radios(name varchar2(20), frequency varchar2(20));
Notice that the table name is lower case ("radios").
--------------------------------------------------------------------------------------------------------------------------------
2) I added a constraint on the "name" column:
ALTER TABLE radios ADD CONSTRAINT name_pk PRIMARY KEY(name);
--------------------------------------------------------------------------------------------------------------------------------
3) Now I want to list the existing constraints for the table "radios".
3.a) If I use the lower case table name, the result is empty:
SQL> SELECT constraint_name, constraint_type
FROM user_constraints
WHERE table_name = 'radios';
no rows selected
3.b) Now, if I use the upper case table name, I get what I am looking for:
SQL> SELECT constraint_name, constraint_type
FROM user_constraints
WHERE table_name = 'RADIOS';
CONSTRAINT_NAME C
NAME_PK P
--------------------------------------------------------------------------------------------------------------------------------
Can you explain me that phenomenon?
I mean: I created a table name lower case so why does it work
only with the upper case formulation?
Do we have to create upper case table names consistently?
How do you create table names: do you create them upper case?
Thank you for your help.
Sincerely,
--
Lmhelp