I want to get all view columns derviation/definition information. Is there any way to get them.
my table name is - DB.ORG_Table
which has 3 columns namely col1,col2,col3
i have created view (Myview) as "repalce view DBV.Myview as locking table DB.ORG_Table access select col1 as id,(col2/col3)*100 as Cal_Val from DB.ORG_Table".
Now i want myview column information like below:
id - DB.ORG_Table.Col1
Cal_Val - (DB.ORG_Table.Col2/DB.ORG_Table.Col3)*100
Thanks in advance.
I dont see much difference what you already have, except you want to use table name with column names.
You can use the table alias for that as follows:
repalce view DBV.Myview as locking table DB.ORG_Table for access
select OT.col1 as id,(OT.col2/OT.col3)*100 as Cal_Val
from DB.ORG_Table AS OT
Thanks for your info,
i want know from which table Cal_val is coming.
i dont want to use help or show view statement.
Is there any way??
You will have to show the view definition to get the source of Cal_Val.
If you need this info to automate something, you can use show view, extract tablename in some variable and use that variable in your script.