Re: How to get all columns only of a table in Oracle?
Originally posted by Richard2003
I have 2 questions that need your kind help.
1. In MySQL, we can use:
show columns from tableName
to show all columns.
How to do it in Oracle?
I used desc tableName, but it show Type and Nullable as well. Here I only need the column names as return, since I want to use it in Java Resultset to process it.
2. BTW, in MySQL, we use:
to show all the databases
what is the corresponding SQL in Oracle?
For you query No.1, You can use SYSTEM view for the tables in your current schema. The View name is "USER_TAB_COLUMS" . Pass the table name in your query & get the details about the columns.
Query No.2: There is nothing like different databases in Oracle like we use to have in SYbase. Here, in oracle, architecture is different. Here we have one database INstance & that u can treat it as Sybase Server sort of thing.
And we have different tablespaces in Oracle whcih u may understand like database in Sybase. So, for deatils about tablespaces, you may user SYSTEM view "USERs_TABLESPACE"
Hope, it will be helpful to you. See one thing, In Oracle virtually every thing is possible what we used to do it for SQL etc. Here, Check for SYSTEM Views & this gives good info. about all in Oracle.