variable string replace (i presume using UNLANG?)

Steve Staples sstaples at mnsi.net
Mon May 16 22:58:35 CEST 2011


Hi all,

I am looking to replace a string, before sending the query off to sql...

right now, it is %{SQL-User-Name} (sql_user_name = "%{User-Name}"
), but the value is going to be like:
mppp%sstaples at domain.com 

and i want to remove the mppp% (which will always be prefixed, or not
exist) so that the variable only is
sstaples at domain.com

Is that easy to do?  I have searched the docs, but came up empty (sorry
if it has been discussed already... just didnt find it)

I could always write it in the query to replace the string:
SELECT REPLACE('mppps%sstaples at domain.com', 'mppp%', '');
but not sure if that is the most efficient way to do it?

Thanks in advance.

Steve.




More information about the Freeradius-Users mailing list