Solved

Calling a UDF via a Trigger

Posted on 2006-07-19
1
816 Views
Last Modified: 2013-12-09
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
Comment
Question by:seancurt
1 Comment
 
LVL 19

Accepted Solution

by:
NickUpson earned 500 total points
ID: 17137399
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

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

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

Suggested Solutions

Using SQL Scripts we can save all the SQL queries as files that we use very frequently on our database later point of time. This is one of the feature present under SQL Workshop in Oracle Application Express.
Never store passwords in plain text or just their hash: it seems a no-brainier, but there are still plenty of people doing that. I present the why and how on this subject, offering my own real life solution that you can implement right away, bringin…
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

831 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