skip to main content
Product overview : OpenAccess SDK configurations and IP implementation : User defined scalar functions
 

User defined scalar functions

The IP can register with the OpenAccess SDK SQL engine and implement scalar functions that take one or more arguments. This allows the IP to support functionality beyond that provided by the built-in functions. The user-defined functions can be used just like the built-in ones. It is defined in terms of the number of arguments and the type of output. The following example uses an encrypt function to store a Social Security number in an encrypted format:
INSERT INTO emp (empno, ename, deptno, soc-sec-num) VALUES (1,'joe', 2, encrypt('111-22-3333')