mysql UDF parameter passing

mysql UDF parameter passing

am 21.08.2006 21:37:39 von bealdrid

Hello Everyone!

I am looking to implement a UDF in C++ that will more efficiently allow
me to narrow down the data set returned from my queries. I'm looking
to call this function in the where clause in my queries, for example:

SELECT temperature FROM table_name WHERE (MyUDF(temp_flag) = 1)

What I want to make sure of, is that I get the correct value for the
respective function call on the respective row. temp_flag is the name
of a particular field in the database; in this case it is a flag column
that contains a string denoting if the temperature has passed our range
check. So in the example query above, I want to make sure the argument
passed to MyUDF is the actual string value of temp_flag from the same
row as the temperature, for each individual function call.

Sorry if anything seems unclear; I am new to UDF's. Thank you for any
input!