HP-UX AAA Server A.07.01 Administrator's Guide

sql_statement
User defined SQL statement. Passed unmodified to the database
client library.
Example 18-4 shows a complete SQL action definition where a row is deleted from the
session table for a stop session action:
Example 18-4 SQL Statement to Delete a Row
For OCI:
SQLAction StopSession {
{
input
RAD(Class) DBP(sessid, 254, CHAR)
output
DBR(DBretCode) FUNC(ACKonZero)
SQLStatement db_oci {
DELETE FROM RAD_SESS_TABLE
WHERE session_id=:sessid
}
}
}
For ODBC:
SQLAction StopSession {
{
input
RAD(Class) DBP(1, 254, CHAR)
output
DBR(DBretCode) FUNC(ACKonZero)
SQLStatement db_odbc {
DELETE FROM RAD_SESS_TABLE
WHERE session_id=sessid
}
}
}
SQL Result Mapping
The SQL Access AATV does not check the result of the SQL statement execution.
However, if you want to have control over the actions based on the SQL statement
result, use the DBR (result) mapping and a pre-defined or custom mapping function to
set an event based on the SQL statement return values. You can use SQL result mapping
anywhere in your input or output maps, it will operate on the return code from the
last SQL statement executed prior to the SQL result mapping entry.
The sample implementation tests for successful SQL statement execution for all SQL
actions using the mapping function AckonZero except in the RetrieveUser action,
which uses the RetrieveonZero mapping function to set the event code. See “Mapping
230 SQL Access