At 19.59 11/10/02, you wrote:
>I'll confess that I know more about Oracle than free-radius at this time (I
>am just now setting up free-radius) however, I suspect that to_date is not
>being evaluated by FreeRadius, only by Oracle. However, the format provided
>to 'to_date' must match the format provided by the FreeRadius '%S' variable.
>
>A time of '0' will not be a valid time for any Oracle related date(and time)
>functions. Assuming you just don't want to store the AcctStopTime, just
>modify the query to write a NULL - if the column allows nulls. If it
>doesn't allow NULL values and you don't want to change the column
>definition, you can just hardcode an epoch value using to_date:
>
>to_date('01-JAN-1970', 'DD-MON-YYYY')
write the NULL string is OK. this is from my sql.conf (it's working):
accounting_start_query = "INSERT into ${acct_table1} (RadAcctId,
AcctSessionId, AcctUniqueId, UserName, Realm, NASIPAddress, NASPortId,
NASPortType, AcctStartTime, AcctStopTime, AcctSessionTime, AcctAuthentic,
ConnectInfo_start, ConnectInfo_stop, AcctInputOctets, AcctOutputOctets,
CalledStationId, CallingStationId, AcctTerminateCause, ServiceType,
FramedProtocol, FramedIPAddress, AcctStartDelay, AcctStopDelay) values('',
'%{Acct-Session-Id}', '%{Acct-Unique-Session-Id}', '%{SQL-User-Name}',
'%{Realm}', '%{NAS-IP-Address}', '%{NAS-Port}', '%{NAS-Port-Type}',
TO_DATE('%S','yyyy-mm-dd hh24:mi:ss'), NULL, '0', '%{Acct-Authentic}',
'%{Connect-Info}', '', '0', '0', '%{Called-Station-Id}',
'%{Calling-Station-Id}', '', '%{Service-Type}', '%{Framed-Protocol}',
'%{Framed-IP-Address}', '%{Acct-Delay-Time}', '0')"
accounting_stop_query = "UPDATE ${acct_table1} SET AcctStopTime =
TO_DATE('%S','yyyy-mm-dd hh24:mi:ss'), AcctSessionTime =
GREATEST(%{Acct-Session-Time},AcctSessionTime), AcctInputOctets =
GREATEST(%{Acct-Input-Octets},AcctInputOctets), AcctOutputOctets =
GREATEST(%{Acct-Output-Octets},AcctOutputOctets), AcctTerminateCause =
'%{Acct-Terminate-Cause}', AcctStopDelay = '%{Acct-Delay-Time}',
ConnectInfo_stop = '%{Connect-Info}', FramedIPAddress =
'%{Framed-IP-Address}' WHERE AcctSessionId = '%{Acct-Session-Id}' AND
UserName = '%{SQL-User-Name}' AND NASIPAddress = '%{NAS-IP-Address}'"
Note in the start query the NULL string as stop_time and in some fields the
value '0' or ''
> From what I see in your message below, you have figured out the correct
>query (or insert actually) to make it function properly.
>
>Hope this helps. If not, I'll just defer to Alan.
>
>
---------------------------------------
Smith & Wesson - The original point and click interface.
---------------------------------------
Ing. Andrea Gabellini
Email: [EMAIL PROTECTED]
Tel: 0549 886111 (Italy)
Tel. +378 0549 886111 (International)
Intelcom San Marino S.p.A.
Strada degli Angariari, 3
47891 Rovereta
Repubblic of San Marino
http://www.omniway.sm http://www.intelcom.sm
-
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html