execute DML in unlang

Fajar A. Nugraha list at fajar.net
Wed Mar 23 05:51:51 CET 2011


On Wed, Mar 23, 2011 at 9:58 AM, 魏景鹏 <weijingpeng at m800400.com> wrote:
> Dear all,
>
> How to execute insert, update, delete statments in unlang?
>
> if I set
>
> %{sql:delete....}
>
> freeradius can't interpret the configure file correctly.
>
> if I set
>
> Tmp-String-0 := %{sql:delete...}
>
> the output of 'radiusd -X' shows there's some problem since the
> statement don't return any value.

If your query is fixed, a workaround will be to create a function in
mysql, which you can set to return something in the end.
If your query is arbitrary, you might be able to use prepared
statement inside the function. There's an example for prepared
statement inside a procedure:
http://forums.mysql.com/read.php?60,27979,30437#msg-30437 . Using it
inside a function should be similar.

-- 
Fajar




More information about the Freeradius-Users mailing list