I am trying to write a query that returns the size of a column in a particular table in my database
I am using SQL Developer environment and I am new to it
I have tried this simple code to which I applied what I found in the Internet :
CREATE TABLE tab1 (
col1 VARCHAR2(15) PRIMARY KEY,
col2 Number(4) NOT NULL)
select data_type, data_length
from user_tab_columns
where table_name = 'tab1'
and column_name = 'col1';
I expect for my second query to get this: VARCHAR2 and 15
But I get this :
no data found
Do you have any idea of what I'm doing wrong?
'TAB1'and'COL1'(using capital letters). Unless table and/or column names are given in double-quotes (which is a bad practice), names are case insensitive. However, when written to the dictionary tables, they are written in upper case letters, and that's how you must use them when you query the dictionary tables.