此内容没有您所选择的语言版本。
11.8. Procedures and Functions
A user can define one of the following functions:
- Source Procedure ("CREATE FOREIGN PROCEDURE") - a stored procedure in source
- Source Function ("CREATE FOREIGN FUNCTION") - A function that is supported by the source, where JBoss Data Virtualization will pushdown to source instead of evaluating in the JBoss Data Virtualization engine.
- Virtual Procedure ("CREATE VIRTUAL PROCEDURE") - Similar to stored procedure, however this is defined using the JBoss Data Virtualization Procedure language and evaluated in the JBoss Data Virtualization engine.
- Function/UDF ("CREATE VIRTUAL FUNCTION") - A user defined function, that can be defined using the Teiid procedure language or can have the implementation defined using a JAVA Class.
Here is an example procedure:
CREATE VIRTUAL PROCEDURE CustomerActivity(customerid integer) RETURNS (name varchar(25), activitydate date, amount decimal) AS BEGIN ... END
CREATE VIRTUAL PROCEDURE CustomerActivity(customerid integer) RETURNS (name varchar(25), activitydate date, amount decimal) AS
BEGIN
...
END
Here is an example function:
CREATE VIRTUAL FUNCTION CustomerRank(customerid integer) RETURNS integer AS BEGIN ... END
CREATE VIRTUAL FUNCTION CustomerRank(customerid integer) RETURNS integer AS
BEGIN
...
END