For a table in oracle, I can query "all_tab_columns" and get table column information, like the data type, precision, whether or not the column is nullable.
In SQL Developer or TOAD, you can click on a view in the GUI and it will spit out a list of the columns that the view returns and the same set of data (data type, precision, nullable, etc).
So my question is, is there a way to query this column definition for a view, the way you can for a table? How do the GUI tools do it?
You can get the MySQL table columns data type with the help of “information_schema. columns”. SELECT DATA_TYPE from INFORMATION_SCHEMA. COLUMNS where table_schema = 'yourDatabaseName' and table_name = 'yourTableName'.
You can not change the column data type of the VIEW. Instead, you can change the data type of underlying base table's column (In that case refer the answer of the link mentioned in your question) or you can create a view query with that data type. -- Your view CREATE OR REPLACE VIEW <YOUR VIEW> AS SELECT ID, ...
Use dba_tab_cols/user_tab_cols/all_Tab_cols to find it. select * from dba_tab_cols where table_name = 'XYZ'; In TOAD, use F4 on the table and find it.
you can use the function DUMP that gives a data type (as a number). The corresponding name is given via Oracle documentation (just look in the doc at the function DUMP).
You can use user_tab_columns
(or all_tab_columns
and dba_tab_columns
respectively) regardless if table_name refers to a view or a table.
View columns appear in all_tab_columns
, so you can query them just as you can tables.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With