Henry Olive 5 Posted November 16, 2021 I wish everyone a healthy day. In my data path there are udf.sql, udflib.c, udflib.def files I copied below code from Firebird's udf.sql when i try to execute below code in Flame Robin I'm getting CREATE FUNCTION SUBSTR failed unknown ISC error 336068876 DECLARE EXTERNAL FUNCTION substr CSTRING(256), SMALLINT, SMALLINT RETURNS CSTRING(80) FREE_IT ENTRY_POINT 'fn_substr' MODULE_NAME 'udflib' What is wrong ? Thank You Share this post Link to post
Serge_G 87 Posted November 16, 2021 (edited) Hi, First, know that : there are many internal functions in Firebird SUBSTR should be replaced advantageously by SUBSTRING (even if a little more "verbose" syntax) Udf are deprecated in Firebird 4.0 (P.S. don't ask me about UDR, I am still with 2.5 in production, 3 running only for test, 4 only installed) read 5.10 chapter of Firebird 4.0 Language reference In my mind, Firebird 3 is closer Interbase For the declaration of the UDF, I think you have to first check firebird .conf file (default parameter “UdfAccess” set to “None” ) , UDFs directories and bitness of the library also involved Edited November 16, 2021 by Serge_G 1 Share this post Link to post
Henry Olive 5 Posted November 16, 2021 Thank you so much Serge firebird.conf file says below message NOTE: THE EXTERNAL FUNCTION ENGINE FEATURE COULD BE USED TO COMPROMISE # THE SERVER/HOST AS WELL AS DATABASE SECURITY!! # IT IS STRONGLY RECOMMENDED THAT THIS SETTING REMAINS NONE! Any advice to use SUBSTR function ? Thank You Share this post Link to post
Serge_G 87 Posted November 16, 2021 (edited) firebird .conf says # ---------------------------- # External Function (UDF) Paths/Directories # # UdfAccess may be None, Full or Restrict. If you choose # Restrict, provide ';'-separated trees list, where UDF libraries # are stored. Relative paths are treated relative to the root directory # of firebird. # # Since FB4.0 default value is None. Set it to 'Restrict UDF' to have # the same restrictions as in previous FB versions. To specify access # to specific trees, enum all required paths (for Windows this may be # something like 'C:\ExternalFunctions', for unix - '/db/udf;/mnt/udf'). # # NOTE: THE EXTERNAL FUNCTION ENGINE FEATURE COULD BE USED TO COMPROMISE # THE SERVER/HOST AS WELL AS DATABASE SECURITY!! # # IT IS STRONGLY RECOMMENDED THAT THIS SETTING REMAINS NONE! # # Type: string (special format) # #UdfAccess = None First change is to uncomment (removing #) last line and say UdfAccess = Restrict UDF as wrote line 10 (pointing the dir_udf directory C:\Program Files\Firebird\Firebird_4 _0\UDF) or indicate directories like indicated below line 10 UdfAcess=C:\interbase\UDF;C:\MyUDF .... If you make a non customed install of Firebird 4.0 you should see the UDF directory don't exist, and no udflib dll copied AS I said if you want a near Interbase Firebird use version 3 Edited November 16, 2021 by Serge_G Share this post Link to post
Vandrovnik 214 Posted November 16, 2021 (edited) 5 hours ago, Henry Olive said: Any advice to use SUBSTR function ? Use SUBSTRING instead of SUBSTR, as Serge_G wrote... Edited November 16, 2021 by Vandrovnik 1 Share this post Link to post
Henry Olive 5 Posted November 16, 2021 Thank you SO MUCH Serge, Vandrovnik SUBSTRING solves my problem Share this post Link to post
Stano 143 Posted November 16, 2021 Here is a link directly to FB support. These questions belong there: https://groups.google.com/g/firebird-support?pli=1 Share this post Link to post
Frickler 11 Posted November 24, 2021 On 11/16/2021 at 12:40 PM, Henry Olive said: Thank you SO MUCH Serge, Vandrovnik SUBSTRING solves my problem Interbase has virtually no internal functions. Not even in the newest versions. All has to be done in UDFs. The Firebird developers on the other hand had changed that from the beginning. Share this post Link to post