(RADIATOR) sql prepare & execute
Hugh Irvine
hugh at open.com.au
Thu May 20 02:19:44 CDT 2004
Hello SHAN -
Your hook code can do whatever you like - you don't need to call
prepareAndExecute() if you don't want to.
You will find the code that Radiator uses in "Radius/SqlDb.pm".
regards
Hugh
On 19 May 2004, at 21:49, S H A N wrote:
> hi,
>
> currently my code is using the following approach...
>
> my $query = "INSERT INTO BOD1500 (USERNAME, NAS_REAL_PORT, NAS_PORT,
> SPEED, NAS_ID, TIMESTAMP) VALUES ('$user', '$nas_real_port',
> '$nas_port', '${speed}${profile}', '$nas_id', NOW())";
> my $sth = $authby_handle->prepareAndExecute($query);
>
> which is being called from a hook for each radius ACCEPT packet
>
> i am looking to prepare the querry once but want to execute it
> repeatedly such as evident from the below method instead of calling
> prepareAndExecute everytime.
>
> $insert_mrtg=$DBconn->prepare('insert into mrtg (node_ip, date_time,
> avg_in, avg_out, max_in, max_out) values (?, to_date(?, \'YYYYMMDD
> HH24:MI:SS\'), ?, ?, ?, ?)
> ')
>
> while ( 1)
> {
> $insert_mrtg->execute($_, $datetimestamp, $line[1], $line[2],
> $line[3], $line[4] )
> }
>
> how best can i do the same in radiator?
>
> thanks
>
> S H A N
>
> --
> Archive at http://www.open.com.au/archives/radiator/
> Announcements on radiator-announce at open.com.au
> To unsubscribe, email 'majordomo at open.com.au' with
> 'unsubscribe radiator' in the body of the message.
>
>
NB: have you included a copy of your configuration file (no secrets),
together with a trace 4 debug showing what is happening?
--
Radiator: the most portable, flexible and configurable RADIUS server
anywhere. Available on *NIX, *BSD, Windows, MacOS X.
-
Nets: internetwork inventory and management - graphical, extensible,
flexible with hardware, software, platform and database independence.
-
CATool: Private Certificate Authority for Unix and Unix-like systems.
--
Archive at http://www.open.com.au/archives/radiator/
Announcements on radiator-announce at open.com.au
To unsubscribe, email 'majordomo at open.com.au' with
'unsubscribe radiator' in the body of the message.
More information about the radiator
mailing list