(RADIATOR) Bind Variables and Oracle

Paul paul at level9.net
Wed Nov 21 11:20:59 CST 2001


Hi,

Wondering if anyone has had any experience with using bind variables with
Radiator / Oracle.

I am running Radiator 2.18.2 and Oracle 8.0.5 (both on Solaris) using DBD
1.12 and DBI 1.20.

We use a SessionDatabase SQL clause to perform IP vs. CLI writes to an
external Oracle database. We have found that the query we are currently
using is very inefficient as Oracle has to parse the whole query every time
and would like to modify the query to use bind variables as per below:

### WITHOUT BIND VARIABLE
$query  = "delete from radius_clid_tbl where " .
      "IP_ADDR= '$framedipaddress' or " .
      "MSISDN= '$callingstation'";
my $sth = $sess_handle->prepareAndExecute($query);

### USING BIND VARIABLE
$query  = "delete from radius_clid_tbl where " .
      "IP_ADDR= ? or " .
      "MSISDN= ? ";
my $sth = $sess_handle->prepareAndExecute($query, $framedipaddress,
$callingstation);

The SessionDb SQL clause currently looks like this:

<SessionDatabase SQL>
        DBSource dbi:Oracle:
        DBUsername user/password at sid
        AddQuery
        DeleteQuery delete from radius_clid_tbl \
                where (IP_ADDR='%{Framed-IP-Address}' \
                or IP_ADDR='%{Framed-Address}' \
                or MSISDN='%{Calling-Station-Id}')
        ClearNasQuery
        CountQuery
</SessionDatabase SQL>

The delete needs to be performed when an access-request is recvd and when a
stop record is recvd, so I don't think I can use a hook. Also the DBA's
involved won't let me use a stored procedure :-(

If anyone has any experience with this, some help would be much appreciated
:-)

Thanks,

Paul


___________________

Paul O'Shea
Level9 Networks
___________________




===
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