Oracle SQL Queries
Sep 22, 2013 · 0 Commentscodedatabase sql
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |