help-gnu-radius
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Help-gnu-radius] SQLServer Config SQL Update Statement Question


From: Arian Maleki
Subject: [Help-gnu-radius] SQLServer Config SQL Update Statement Question
Date: Sun, 8 Jun 2003 20:17:49 -0700 (PDT)

I am running GNU Radius 0.96.4 with mysql.  I am
trying to update the session-timeout attribute in the
attrib table on the acct_stop_query action.  I think
my problem is that I am using two update statements. 
I have tried it with and without semi colon but I get
the same error.  Anyone else try doing this?  Does gnu
radius support two sql statements per action?  If its
only one statement any idea for updating
session-timeout attribute on account stop?
 
====sqlserver=====
.....
acct_stop_query      UPDATE calls \
                     SET status=%C{Acct-Status-Type},
\
                        
acct_session_time=%C{Acct-Session-Time}, \
                        
acct_input_octets=%C{Acct-Input-Octets}, \
                        
acct_output_octets=%C{Acct-Output-Octets}, \
                        
connect_term_reason=%C{Acct-Terminate-Cause} \
                     WHERE
calls.user_name='%C{User-Name}' \
                       AND calls.status = 1 \
                       AND
calls.acct_session_id='%C{Acct-Session-Id}' \
                        \
                     UPDATE attrib \
                     SET value = value -
%C{Acct-Session-Time} \
                     WHERE
attrib.user_name='%C{User-Name}' \
                       AND
attrib.attr='Session-Timeout'
.....
This is what is in the radius.log

Jun 08 20:00:50: Acct.error: MYSQL Error (-1): Cannot
Query:UPDATE calls SET sta
tus=2, acct_session_time=41, acct_input_octets=213695,
acct_output_octets=36176,
 connect_term_reason=1 WHERE calls.user_name='test'
AND calls.status = 1 AND cal
ls.acct_session_id='20000001' UPDATE attrib SET value
= value - 41 WHERE attrib.
user_name='test' AND attrib.attr='Session-Timeout'
Jun 08 20:00:50: Acct.error: MYSQL error: You have an
error in your SQL syntax n
ear 'UPDATE attrib SET value = value - 41 WHERE
attrib.user_name='test' AND attr
ib.at' at line 1
Jun 08 20:00:50: Acct.error: MYSQL Error: query UPDATE
calls SET status=2, acct_
session_time=41, acct_input_octets=213695,
acct_output_octets=36176, connect_ter
m_reason=1 WHERE calls.user_name='test' AND
calls.status = 1 AND calls.acct_sess
ion_id='20000001' UPDATE attrib SET value = value - 41
WHERE attrib.user_name='t
est' AND attrib.attr='Session-Timeout'

Any help is greatly appreciated.
Thanks,
Arian
address@hidden




reply via email to

[Prev in Thread] Current Thread [Next in Thread]