This is a brief overview of the types of user-defined routines offered by Trafodion and a description on how to create them. The article also talks about operators and routines that are built into Trafodion.
Routines, Procedures and Functions
The most generic term used here is a Routine, which includes all of the following:
Type | Subtype | Return Value(s) | Where in SQL syntax | Languages | Security | Description |
---|---|---|---|---|---|---|
Stored Procedure in Java (SPJ) | Output parameters Result sets | CALL statement | Java | trusted |
| |
Function (UDF) | Scalar UDF | Scalar value | In any scalar expression | C | trusted |
|
Table-mapping UDF (TMUDF) | Table | FROM clause | Java / C++ | trusted |
|
Click the links in the table above for more information.
Known Issues
Unfortunately, the security features of Trafodion UDRs are not completely implemented at this time. Here is an outline of what we have today and of the design we are trying to follow:
Security attribute of the UDR | TRUSTED | ISOLATED | Current Implementation |
---|---|---|---|
UDR code runs under Trafodion id, has full control over the database, can read and write any data, can corrupt system data structures. | yes | no | yes |
UDR code runs in a separate process (tdm_udrserver) | no | yes | yes (except for TMUDF compiler interface) |
UDR code runs under a special user id with low privileges (similar to a guest id) | no | yes | no |
Scalar UDFs are converted into a relational operator | no | yes | yes |
Ability to run SQL statements on a special connection that implements definer's rights or invoker's rights (the user id that created the UDR or that invoked the UDR, respectively) | yes | yes | no (SQL in SPJs runs as DB_ROOT) |
Predefined UDRs and UDRs created during INITIALIZE TRAFODION
In some cases, we may want to include a new function in Trafodion, if it is generic and potentially useful to most Trafodion users.
Built-in Functions
x
Related articles
There is no content with the specified labels