How to execute TWO OR MORE Sql statement?
Jurgen van Vliet
jurgen at wanbound.com
Wed Jul 26 15:59:22 CEST 2006
Im using stored procs to do a series of queries even with IF THEN ELSE
structires, with variables being the result of a query and being used in
other queries.
Works like a charm for me with mysql5 and freeradius 1.1.2
In the sql.conf I just use as query something like "call
storedproc1(var1,var2,var3)"
Regards,
Jurgen
-----Oorspronkelijk bericht-----
Van: freeradius-users-bounces+jurgen=wanbound.com at lists.freeradius.org
[mailto:freeradius-users-bounces+jurgen=wanbound.com at lists.freeradius.org]
Namens Alan Lumb
Verzonden: woensdag 26 juli 2006 14:08
Aan: FreeRadius users mailing list
Onderwerp: Re: How to execute TWO OR MORE Sql statement?
> Create a stored procedure in the database that contains all of the SQL
> queries necessary. Then call that stored procedure via sql.conf. This
> works fine with Postgres.
MySQL 5 supports stored proceedures and functions, however I know that mysql
proceedures can cause problems as they can/will return multiple data sets
that can cause some apps problems (not sure about freeradius and its support
for mysql).
I gave up on such a method and moved to rlm_perl. Now I have a perl
handling script that performs as many queries as I need and can put lots of
logic in the script, strip bits out of usernames and whatnot. Also it can
look for certain flags in the database and if present send AV Pairs or VSA's
to the NAS to configure them differently.
my only issue has been getting rlm_perl to compile properly on suse x86_64,
and sometimes have had to goto the extreme of recompiling perl and manually
linking DynaLoader into rlm_perl.so
So in answer to the original question I recommend rlm_perl if you have the
time and patience to get around the setup problems.
-
List info/subscribe/unsubscribe? See
http://www.freeradius.org/list/users.html
More information about the Freeradius-Users
mailing list