EffiProz(
www.effiproz.com) C# database is a light weight embedded database for .NET, ASP.NET, .NET CF & Silverlight applications. This article demonstrates how to create CLR functions with effiproz database.
Any static function can be use as the body of the CRL function (containing assembly should be already loaded). The sample demonstrate how-to create a simple CLR function to add two numbers.
First create the static c# function, like this:
public static int Add(int x, int y) { return x + y; }
Then create a SQL function that reference the static function createtd above,
CREATE FUNCTION add_num(x INT, y INT)
RETURNS INT
NO SQL
LANGUAGE DOTNET
EXTERNAL NAME 'EffiProz.CLFunctionSample.Add'
Now we can call add_num function as any regular SQL function. e.g:
SELECT add_num(3,4) FROM DUAL;
You can download the sample code with upcoming Effiproz Database 0.1RC from
http://www.effiproz.com/samples/CLRFunctionSample.zip