• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 841
  • Last Modified:

Calling a UDF via a Trigger

Hi

I have installed a UDF dll on my firebird database, however i am unsure how to call it.

The UDF creates a text file to a location, and is called FILE_WRITE:

DECLARE EXTERNAL FUNCTION FILE_WRITE
    CSTRING (1024),
    CSTRING (1024)
    RETURNS INTEGER BY VALUE
    ENTRY_POINT 'File_write' MODULE_NAME 'udf_file.dll';


Could someone please advise on the syntax of calling a UDF via a trigger please?

Many thanks
0
seancurt
Asked:
seancurt
1 Solution
 
NickUpsonCommented:
without knowing the meaning of the args it's a little difficult to do a good example but you treat any udf as if it were a built-in function like lower

e.g.

int return_val;
select file_write('path_of_file', 'value to add to file') from rdb$database into :return_val;
if (return_val <> 0) then
 do_something about failure;


rdb$database always has only one row
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now