Oracle SQL Queries

Recently I found myself in a situation where I had to view all the tables in the Oracle Server.

I did some digging and came up with these helpful queries.

Query Remarks
Select * from All_Tables View all the tables in the Oracle Server
Select * from all_Views View all the views in the Oracle Server
DESC table View all the columns of a given table. This function is used instead of the previous one mostly, but when this one doesn’t work make sure you try the other one - I bet it will work.

Here’s a short code for viewing all the columns of a given table.

SELECT
column_name "Name",
nullable "Null?",
concat(concat(concat(data_type,'('),data_length),')') "Type"
FROM user_tab_columns
WHERE table_name='ASGDLX_TBLBRAND'
where "ASGDLX_TBLBRAND" is the table name.
view raw gistfile1.sql hosted with ❤ by GitHub