Thursday, December 15, 2011

Every table in oracle has few default fields like date etc, what is the sql statement to show these?

Basic statment like "select * from emp" does not show these statements . Kindly let me know the statement to show these fields - its very urgent|||You can select directly from the data dictionary which contains the information about your table. For example:





SELECT


column_name "Name",


nullable "Null?",


concat(concat(concat(data_type,'('),da鈥?"Type"


FROM user_tab_columns


WHERE table_name='TABLE_NAME_TO_DESCRIBE';





If you are using SqlPlus, you can use the DESC command as described here: http://www.ss64.com/ora/desc.html





Another option, which is a lot easier, is to use a tool like DBVisualizer which can show you the table structure (and I believe the new version can even generate the create script for you). Get the free version here: http://www.dbvis.com/products/dbvis/inde鈥?/a>

No comments:

Post a Comment