Hello Gildas -

On Tue, 17 Oct 2000, Gildas PERROT wrote:
> Hi,
> 
> I would like to modify SQL queries for SessionDatabase SQL since sometimes,
> one field (Calling-Station-Id or CALLINGID) is empty as you can see below :
> 
> Mon Oct 16 19:01:59 2000: ERR: do failed for 'insert into ONLINE (USERNAME,
> NASIDENTIFIER, NASPORT, ACCTSESSIONID, TIME_STAMP, FRAMEDIPADDRESS,
> CALLINGID, CALLEDID) values ('carrefour', '10.69.1.1', 35, '00000131',
> 971715719, '10.69.1.48', , 6641 )': You have an error in your SQL syntax
> near ' 6641 )' at line 1
> 
> My AddQuery is :
> 
>         AddQuery insert into ONLINE (USERNAME, NASIDENTIFIER, NASPORT, \
>                 ACCTSESSIONID, TIME_STAMP, FRAMEDIPADDRESS, CALLINGID,
> CALLEDID)
>  \
>                 values ('%n', '%N', %{NAS-Port}, '%{Acct-Session-Id}', \
>                 %{Timestamp}, '%{Framed-IP-Address}', %{Calling-Station-Id},
> %{C
> alled-Station-Id} )
> 
> How can I modify it in order to put a default value of 0 for CALLINGID if
> Calling-Station-Id is unknown ?
> 

Like this:

        AddQuery insert into ONLINE (USERNAME, NASIDENTIFIER, NASPORT, \
        ACCTSESSIONID, TIME_STAMP, FRAMEDIPADDRESS, CALLINGID,CALLEDID)\
        values ('%n', '%N', %{NAS-Port}, '%{Acct-Session-Id}', \
        %{Timestamp}, '%{Framed-IP-Address}', 0%{Calling-Station-Id},\
        %{Called-Station-Id} )

If you have a look at the code in SessSQL.pm, you will see an example in the
default AddQuery.

hth

Hugh

-- 
Radiator: the most portable, flexible and configurable RADIUS server 
anywhere. SQL, proxy, DBM, files, LDAP, NIS+, password, NT, Emerald, 
Platypus, Freeside, Interbiller, TACACS+, PAM, external, etc, etc.
Available on Unix, Linux, FreeBSD, Windows 95/98/2000, NT, MacOS X.



===
Archive at http://www.starport.net/~radiator/
Announcements on [EMAIL PROTECTED]
To unsubscribe, email '[EMAIL PROTECTED]' with
'unsubscribe radiator' in the body of the message.

Reply via email to