Prepare for your Next Interview
|
Welcome to the Geeks Talk forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact contact us. |
This is a discussion on Query to find structure of a table within the SQL forums, part of the Databases category; Please give me the query.. How to findout the structure of a table? Question asked by visitor Mahesh.Mk...
|
|||||||
|
|||
|
Query to find structure of a table
Please give me the query.. How to findout the structure of a table?
Question asked by visitor Mahesh.Mk |
| The Following 2 Users Say Thank You to Geek_Guest For This Useful Post: | ||
| Sponsored Links |
|
|||
|
Re: Query to find structure of a table
All the answers given above are correct. But, as far as I know,
DESC /tablename/ is not a query. It is an SQL-Plus command. Because only SELECT statements can be called as a query.
__________________
Lack of WILL POWER has caused more failure than lack of INTELLIGENCE or ABILITY. -sutnarcha- |
|
|||
|
Re: Query to find structure of a table
desc Table Name;
|
|
|||
|
Re: Query to find structure of a table
You can either describe the table using DESC command or you can use data dictionary views "ALL TABLE and ALL TABLE COLUMNS" to look at the list of columns of the table and its structure. If you are using TOAD, then just type the table name in the sql editor of TOAD and click on F4, that will open up a window to show the constraints, table struvture, indexes etc of that particular table
|
|
|||
|
Re: Query to find structure of a table
Query 1:
select column_name, data_type, data_length, 2 data_precision, data_scale from ALL_TAB_COLUMNS 3 where table_name = 'EMP'; Query 2: SQL> set long 100000 SQL> set pages 0 SQL> select dbms_metadata.get_ddl('TABLE','EMP') from dual; i think this should work out !!! These queries would answer your query !!
|
![]() |
|
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Structure of Salary | nehalshah | Companies | 3 | 04-27-2009 04:51 PM |
| Creating a table by copying another table's structure | Allan Paul | Oracle | 19 | 04-17-2009 06:03 AM |
| How to find Table Size | timmy | Oracle | 2 | 09-23-2008 04:52 AM |
| How a java table be brought to data table? | dhandhan | QTP | 0 | 04-15-2007 06:14 AM |
| How to find Defined key fields in a table? | sharifhere | SQL | 2 | 02-22-2007 01:01 AM |