run multiple sql queries

classic Classic list List threaded Threaded
4 messages Options
| Threaded
Open this post in threaded view
|

run multiple sql queries

imdadk
Hii all,

Can i run multiple sql queries at a time in freeradius sql module.?
specifically for accounting. for manage accounting data in different
different tables.

Thanks
-
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
| Threaded
Open this post in threaded view
|

Re: run multiple sql queries

Alan DeKok-2
On Mar 12, 2021, at 4:11 PM, Imdad Hasan <[hidden email]> wrote:
> Can i run multiple sql queries at a time in freeradius sql module.?

  No.

> specifically for accounting. for manage accounting data in different
> different tables.

  You can write a stored procedure to do update multiple tables, and then run that.

  Alan DeKok.


-
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
| Threaded
Open this post in threaded view
|

Re: run multiple sql queries

imdadk
In reply to this post by imdadk
can i use unlang for run another queries in accounting section?

like this








*switch "%{Acct-Status-Type}" {        case 'Stop' {            update
control {                  Tmp-String-0 := "%{sql:UPDATE `usage` SET
acctinputoctets = acctinputoctets + '%{Acct-Input-Octets}',
acctoutputoctets = acctoutputoctets + '%{Acct-Output-Octets}', lastupdated
= now() WHERE username = '%{User-Name}'}"            }              } }*

On Sat, Mar 13, 2021 at 2:41 AM Imdad Hasan <[hidden email]>
wrote:

> Hii all,
>
> Can i run multiple sql queries at a time in freeradius sql module.?
> specifically for accounting. for manage accounting data in different
> different tables.
>
> Thanks
>
-
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
| Threaded
Open this post in threaded view
|

Re: run multiple sql queries

Kristofer Hallin
On 15 Mar 2021, 12:09 +0100, Imdad Hasan <[hidden email]>, wrote:
> can i use unlang for run another queries in accounting section?

Why don’t you just try? That must be quicker than waiting for answers from the mailing list.

>
> like this
>
>
>
>
>
>
>
>
> *switch "%{Acct-Status-Type}" { case 'Stop' { update
> control { Tmp-String-0 := "%{sql:UPDATE `usage` SET
> acctinputoctets = acctinputoctets + '%{Acct-Input-Octets}',
> acctoutputoctets = acctoutputoctets + '%{Acct-Output-Octets}', lastupdated
> = now() WHERE username = '%{User-Name}'}" } } }*
>
> On Sat, Mar 13, 2021 at 2:41 AM Imdad Hasan <[hidden email]>
> wrote:
>
> > Hii all,
> >
> > Can i run multiple sql queries at a time in freeradius sql module.?
> > specifically for accounting. for manage accounting data in different
> > different tables.
> >
> > Thanks
> >
> -
> List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
-
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html