sql insert via unlang
Anton Borisov
antonio at mccinet.ru
Wed Jan 28 14:30:47 CET 2009
Good day!
We have made sql oracle function. This function insert data into sql
table, but we call into this funtion as
"select myfunction ('aaa','bbbbbb') from dual" and it returns
"OK: Quota consumed."
And... this is wotking!!
In unlang we added:
if ("%{sqlauth: select myfunction ('...','...') from dual}") {
ok
}
Now:
Wed Jan 28 16:15:43 2009 : Info: expand: select myfunction...
Wed Jan 28 16:15:43 2009 : Debug: rlm_sql (sqlauth): Reserving sql
socket id: 0
Wed Jan 28 16:15:43 2009 : Info: sql_xlat finished
Wed Jan 28 16:15:43 2009 : Debug: rlm_sql (sqlauth): Released sql socket
id: 0
Wed Jan 28 16:15:43 2009 : Info: expand: %{sqlauth: select
myfunction... -> OK: Quota consumed.
Wed Jan 28 16:15:43 2009 : Info: ++++[reply] returns noop
So, I can see my data from Access-Request in my sql table.
tnt at kalik.net wrote:
>> I try to add prepaid system to my equipment.
>> In this case when quota is reached, equipment sends Access-Request with
>> quota comsumed and I need to store this data in sql. But. Unfortunately,
>> I must think about how many on-line customers send quota to sql in same
>> time. Yes, I can write perl script with sql insert and update and
>> freeradius will execute this one every time for quota data. But, I think
>> this is not for system with many customers.
>
> Perl is very fast but it needs to open (and close) the connection to the
> database and that is expensive. Unlang uses threads open by freeradius
> at startup. So it will work faster. But I don't think that INSERT is
> supported.
>
> Ivan Kalik
> Kalik Informatika ISP
>
> -
> List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
--
Yours faithfully,
Anton Borisov.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 3364 bytes
Desc: S/MIME Cryptographic Signature
URL: <http://lists.freeradius.org/pipermail/freeradius-users/attachments/20090128/90da6f2b/attachment.bin>
More information about the Freeradius-Users
mailing list