MySQL Forums
Forum List  »  UDF

How to return errors from UDF ?
Posted by: Mathieu Dubois
Date: July 15, 2018 09:14PM

Dear all,

I'm maintaining a library of MySQL UDF functions but I'm new to this.

One of those functions (say `xxx`) expects several parameters but can only produce results for some values say if the last argument (an integer) is 1, 2 or 3. So I wanted to warn the user in case of bad parameter.

At first, I expected to do this in `xxx_init` but if I'm correct, the value of the argument is not defined when calling this function with nonconstant arguments so it's not possible.

So if I understand correctly, the only way to do this is by detecting this in `xxx` and returning NULL (by setting is_null to 1 and returning NULL). Is that correct ?

Thanks in advance,
Mathieu

Options: ReplyQuote


Subject
Views
Written By
Posted
How to return errors from UDF ?
232
July 15, 2018 09:14PM


Sorry, only registered users may post in this forum.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.