Declaring InterBase UDF's in the Database Desktop

By: Borland Staff

Abstract: One external function may be declared at a time in the SQL editor

How do I declare an InterBase UDF with the Database Desktop?  

This document applies to InterBase versions 4.0 and up.

In Database Desktop,  you can enter SQL statements directly with the
SQL editor.  There are two ways to access the SQL editor.  You can either
click on the SQL icon on the toolbar, or select File | New | SQL File to
access the SQL editor.  After entering an SQL statement with the SQL editor,
you still will need to commit them.  The statement to declare the UDF's need only 
be issued once to make the functions permanently available in your database.

You can only declare one external function at a time.  Here are a couple of
examples using functions from the supplied ib_udf.dll:

declare external function strlen
   returns integer by value
   entry_point "IB_UDF_strlen"
   module_name "ib_udf";

declare external function substr
   cstring(80), smallint, smallint
   returns cstring(80) free_it        
   entry_point "IB_UDF_substr"
   module_name "ib_udf";

If you have several functions to declare, or want to declare a whole
library, you are better to put them all in a script and execute that script
using WISQL,  or another tool that allows you to process scripts.
(You can't process scripts in Database Desktop).

source :        Helen Borrie 
                       from the list server

Server Response from: ETNASC01