Diagnostic Steps to Try When InterBase Will Not Recognize a UDF

By: Borland Staff

Abstract: 5 different potental reasons for this error

Problem:
I am getting a message:
    "invalid request BLR at offset 50
    -function DOG is not defined
    -module name or entrypoint could not be found

when I try to reference a UDF called "dog"  in a select statement.


Solution:
/*******************************************************************************/
Note: The information in this article was written for InterBase v5.x
/********************************************************************************/

There are lots of possible reasons why a UDF might not be recognized 
by InterBase.  The following is a list of some of the most common causes 
of what might cause this to occur.

1.  The system may not know where the library file containing the UDF is 
      located.

      a.   Try hard coding the path to the shared library in the "declare 
            external function" statement in a ddl script.

      b.  On a UNIX system, the library containing the UDF was not on 
            shared library path.  UNIX has an environment variable for the 
            Load Library Path.  The shared library containing the definition 
            of the function referenced by the UDF must be on this path.   
            Check  that the LD_LIBRARY_PATH is set to  include the 
            directory where the shared library is located by having the OS 
            echo the currently set environment variables to the screen.   
            The command to check environment variables is "setenv" on 
            most UNIX systems .   This will help verify that the location
            of the library is included on the path as we expect.

      c.   On a Wintel system,  look in one of these places:
             1. The windowssystem directory Windows95 or the 
                  winntsystem32 directory on Windows NT.
             2.  The InterBase bin directory
             3.  The InterBase lib directory
             4.  The system's PATH

               -  To find out what your path setting is under Windows95 or NT 4.0
                  Hit the "Start" button.
                  Use the menu choices Settings | Control Panel
                  Then click on the "System" icon.
                  Then click on the Environment tab.
                  "Path" will be listed under "System Variables"  listing.

2.   Entry_point defined incorrectly.
        a.  Double check that the value given for "entry point" in the
          "declare external function" syntax is really the name of
          the function in the shared library.  It does not necessarily
          have to be the same name as the UDF name declared in 
          the database.

3.  The library name or function name may not have been declared correctly. 
     a.  InterBase does not check to see that the external function or
          library name you specify is valid.  It is determined invalid if the systems
          'load library' call fails.  You can declare an invalid function or library name 
          and have InterBase accept it as valid.
 
           As long as the "declare external function" syntax follows InterBase's
           grammar rules, it will be accepted.     You will not know that you typed
           it in wrong until you try to use it.  Then you will get errors.   Do a  
           "show function 

                 eg. If my library file name was "kennel", then when I do the command,
	                                     
                 ls -l kennel
		 
                 it would return something like this: 
		 
                -rw-rw-rw-  1 root      653 Apr 12 22:00 kennel    

           this means that anyone can read or write to this file.  At a minimum,
           you need to be able to read the file.  The listing for a file that only gives
           users read access would look something like this:
	
                -r--r--r--  1 root      653 Apr 12 22:00 kennel    

5.   Find out where the database thinks the function should be , using
      the "show database" command in ISQL.

 

Server Response from: ETNASC04