Have an amazing solution built in RAD Studio? Let us know. Looking for discounts? Visit our Special Offers page!

User Defined Functions with InterBase


InterBase has several built in functions that developers can use to create and optimize SQL queries. In some situations though, you may find yourself needing to expand queries or work with more complex queries that include string, date and statistical functions. InterBase’s way to resolve this problem is by supporting libraries or user defined functions or UDFs. UDFs are programs for performing custom functions that are extensions of the server and execute as part of the server process. You can access UDFs through isql or a host-language program. You can also access UDFs in stored procedures and trigger bodies. UDFs can be used in a database application anywhere that a built-in SQL function can be used.

How to add UDFs to InterBase

There are several UDF libraries available on the internet for InterBase, but one with several functions that you can look into is FreeADHocUDF.

InterBase has two UDF files in the installation, one called udflib.dll (Employee db example shown in video) and the ib_udf.

You can also create your own UDF in this simple three-step process:

  1. Write the function in any programming language that can create a shared library. Functions written in Java are not supported.
  2. Compile the function and link it to a dynamically linked or shared library.
  3. Use DECLARE EXTERNAL FUNCTION to declare each UDF to each database in which you need to use it.

For more information on creating your own UDFs, check out the docwiki.

Learn how to utilize constexpr variables and constexpr functions in this tutorial.

InterBase Product Page

Reduce development time and get to market faster with RAD Studio, Delphi, or C++Builder.
Design. Code. Compile. Deploy.
Start Free Trial   Upgrade Today

   Free Delphi Community Edition   Free C++Builder Community Edition

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.