Product Documentation

FairCom Java & .NET Stored Procedures

Previous Topic

Next Topic

Invoking User-Defined Scalar Functions

User Defined Scalar Function are a type of FairCom DB SQL expression that return a value based on the argument(s) supplied. User Defined Scalar Functions are invoked in exactly the same manner as built in scalar functions.

User Defined Scalar Functions can be used in the SELECT list or in the WHERE clause. They can be used as parameters of other scalar functions or included with other SQL expressions. The parameter passed to a user defined scalar function can be a literal, field reference or any expression

Previous Topic

Next Topic

With Constants

Example with Constants


SELECT str_cat('abcd','efgh') FROM syscalctable;


STR_CAT(ABCD,EFGH)

-------------------------------

abcdefgh

1 record selected

Previous Topic

Next Topic

With Constants and Column References

Example with Constants and Column References


SELECT empfname, str_cat(empfname, emplname) FROM emp WHERE str_cat('mary', 'john') = 'maryjohn';


EMPFNAME STR_CAT(EMPFNAME,EMPLNAME)

---------------- ---------------------------------------------

Mary MaryJohn

1 records selected

Previous Topic

Next Topic

With parameter reference (ODBC/JDBC)

Example with Parameter References


SELECT str_cat(?, ?) FROM emp

SELECT * FROM emp WHERE str_cat(?, ?) = 'MaryJohn'


TOCIndex