简体   繁体   English

创建功能Teradata

[英]Create Function Teradata

I want to create a small function (or like) which will take parameters and return result of excuting teradata sql statement. 我想创建一个小函数(或类似函数),该函数将带参数并返回执行teradata sql语句的结果。 Purpose of this is to convert repeated using SQL into function which can be used into SELECT statement. 目的是将重复使用SQL转换为可用于SELECT语句的函数。 Please point me into right direction. 请指出正确的方向。 Create Function in teradata requires C/C++ compilation which is too much effort after looking at use of required function. 在Teradata中创建函数需要C / C ++编译,在查看所需函数的使用后,这会花费很多精力。

Passing parameters to SQL can be done using a CREATE MACRO, but those can't be used in a SELECT. 可以使用CREATE MACRO将参数传递给SQL,但是不能在SELECT中使用。

SQL-UDFs are limited to simple scalar functions in Teradata, ie no SELECTs, etc. SQL-UDF仅限于Teradata中的简单标量函数,即没有SELECT等。

If you need a more complex function (table or [window] aggregate) you must write it in C or Java. 如果需要更复杂的功能(表或[窗口]聚合),则必须使用C或Java编写。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM