1
votes

I'm trying to run a SQL query in my Firebird database. I've restored a backup in my local development environment.

My error is the following:

echo "SELECT STRTOINT('3') FROM MyTable;" | isql-fb /var/lib/firebird/3.0/data/dbname.fdb
Statement failed, SQLSTATE = 39000
invalid request BLR at offset 36
-function STRTOINT is not defined
-module name or entrypoint could not be found

To check if the function exists i run this:

echo 'SELECT RDB$FUNCTION_NAME FROM RDB$FUNCTIONS;' | isql-fb /var/lib/firebird/3.0/data/dbname.fdb  | grep STRTOINT
STRTOINT

How to call the function correctly? Any hints are welcome!

2

2 Answers

2
votes

Have you tried to do the following?

CAST(MyVarcharCol AS INT)

Read more: http://www.firebirdfaq.org/faq139/

2
votes

The fact that the UDF is defined in the database does not mean the UDF exists. UDFs require both a definition in the database, and a native library (.dll/.so) on disk that contains the code for the UDF function.

The error means that either

  • The UDF does not exist in any of the libraries found,
  • Firebird has no permission to read the library,
  • The folder containing the library is not defined in firebird.conf (setting UdfAccess)
  • The UDF library is 32 bit and Firebird is 64 bit (or vice versa)

See also invalid request BLR at offset 163

Firebird itself has no UDF called STRTOINT, so you need to find out which third-party library this is, and install it correctly.