Click here to Skip to main content
Click here to Skip to main content

How-To Create a CLR Function with EffiProz Database

, 17 Mar 2010
Rate this:
Please Sign up or sign in to vote.
EffiProz(www.e...
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

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

About the Author

arith silva

United States United States
No Biography provided

Comments and Discussions

 
GeneralTable-Valued Functions Pinmemberdunscj16-Apr-11 3:10 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

| Advertise | Privacy | Mobile
Web01 | 2.8.140721.1 | Last Updated 17 Mar 2010
Article Copyright 2010 by arith silva
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid