我在sql Server中有半打视图需要在Teradata中复制,但我无法找到与sql元数据表相当的TD.我想复制以下功能(我认为这是相当自我解释的):
select table_name,column_id ordinal_position,column_name,data_type,char_length char_max_length,data_precision numeric_precision,data_scale numeric_scale from user_tab_columns select name as FUNCTION_NAME from sys.objects where type_desc='sql_SCALAR_FUNCTION' select TABLE_NAME as VIEW_NAME from INFORMATION_SCHEMA.VIEWS
我还想知道在线是否有任何可用的Teradata参考资料;我遇到的一切似乎都是广告而不是实用信息.
解决方法
所有Teradata系统表都存储在DBC架构下.
对于列,它是dbc.columns
select * from dbc.columns
对于视图,dbc.tables在列上有一个名为table_type’V’的过滤器(其中V代表视图)
select * from dbc.tables
我不知道如何在Teradata中获得所有功能.无论谁知道,请编辑这个答案.
在Teradata DBC.Tables中包含系统中存在的许多对象. (例如,存储过程,UDF,触发器,宏,视图,表,散列索引,连接索引等)列表类用于标识对象的类型.
SELECT * FROM DBC.TABLES WHERE TABLEKIND = '<see below>' A = Aggregate Function B = Combined Aggregate Function and ordered analytical function D = JAR E = External Stored Procedure F = Standard Function G = Trigger H = Instance or Constructor Method I = Join Index J = Journal M = Macro N = Hash Index O = No Primary Index (Table) P = Stored Procedure Q = Queue Table R = Table Function S = Ordered Analytical Function T = Table U = User-defined data type V = View X = Authorization Y = GLOP Set