?
Solved

UDF

Posted on 2005-05-13
10
Medium Priority
?
2,016 Views
Last Modified: 2013-12-09
I am trying to declare some of the UDF's from the IB library here is the SQL I am using.

DECLARE EXTERNAL FUNCTION div
      INTEGER, INTEGER
      RETURNS DOUBLE PRECISION BY VALUE
      ENTRY_POINT 'IB_UDF_div' MODULE_NAME 'ib_udf';

When I compile a stored procedure trying to use the div function I get an error

"Invalid token.invalid request BLR at offset 284.
function DIV is not defined.

I do run the declare function before trying to compile the stored procedure that uses it.
0
Comment
Question by:sk33v3
  • 5
  • 4
10 Comments
 
LVL 19

Expert Comment

by:NickUpson
ID: 13997151
forget the SP for now, the UDF only needs defining once to the database so please try this to start with.

connect to the database

run the declaration

commit;

disconnect

connect

select div(4, 2) from rdb$database;

what result do you get
0
 
LVL 9

Author Comment

by:sk33v3
ID: 13997180
fmSQLEditor.Query:
Invalid token.invalid request BLR at offset 59.
function DIV is not defined.
module name or entrypoint could not be found.
0
 
LVL 19

Expert Comment

by:NickUpson
ID: 13997259
ok, that usually means that firbird cannot find the .dll file, which directory is it in and what is the setting for udfaccess in the firebird.conf file
0
Restore individual SQL databases with ease

Veeam Explorer for Microsoft SQL Server delivers an easy-to-use, wizard-driven interface for restoring your databases from a backup. No expert SQL background required. Web interface provides a complete view of all available SQL databases to simplify the recovery of lost database

 
LVL 9

Author Comment

by:sk33v3
ID: 13997308
UdfAccess = Restrict UDF

The directory on the windows machine for the dll file is

C:\Program Files\Firebird\Firebird_1_5\UDF
0
 
LVL 19

Expert Comment

by:NickUpson
ID: 13997501
make the conf file say

UdfAccess = Restrict C:\Program Files\Firebird\Firebird_1_5\UDF

then bounce the firebird server and try the select again, if that still fails make it

UdfAccess = Restrict "C:\Program Files\Firebird\Firebird_1_5\UDF"

and bounce the server again
0
 
LVL 9

Author Comment

by:sk33v3
ID: 13997575
Neither one of those 2 statements fixed it. Does it matter if I am connecting to the databas elocally and not remotely?
0
 
LVL 19

Expert Comment

by:NickUpson
ID: 13997828
no, the database connection method doesn't affect this. When you say it's not fixed I assume you mean that the select still produces the invalid request BLR message. you did bounce (that's stop and restart the firebird service) after making changes to the conf file. If you are unsure about that reboot the machine to make sure it's been restarted

0
 
LVL 9

Author Comment

by:sk33v3
ID: 13997849
I did bounce the FB service through the control panel applet provided. But I will try restrating my machine.
0
 
LVL 19

Accepted Solution

by:
NickUpson earned 2000 total points
ID: 13997981
just a thought, the udfaccess line has had the leading # removed? the leading # is a comment
0
 
LVL 7

Expert Comment

by:EugeneK-biruza
ID: 14524619
Just in addition: here is a very good book about Firebrid:

The Firebird Book: A Reference for Database Developers
http://www.devarchive.com/bb231.html
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Instead of error trapping or hard-coding for non-updateable fields when using QODBC, let VBA automatically disable them when forms open. This way, users can view but not change the data. Part 1 explained how to use schema tables to do this. Part 2 h…
Creating a Cordova application which allow user to save to/load from his Dropbox account the application database.
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
Despite its rising prevalence in the business world, "the cloud" is still misunderstood. Some companies still believe common misconceptions about lack of security in cloud solutions and many misuses of cloud storage options still occur every day. …
Suggested Courses

839 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question