HP-UX AAA Server A.08.01 administrator's guide (T1428-90072, May 2010)

Table Of Contents
Example 22-6 SQL Statement with Result Mapping - OCI Using the New Syntax
SQLAction RetrieveUser {
{
input
RAD(User-Id, REPLY) DBP(userid, 253, CHAR)
output
DBR(100:*) RET(RETRIEVE_ERROR)
DBR(-1:*) RET(ERROR)
DBC(user_password, 128, CHAR) RAD(Password, CHECK)
DBC(address_pool, 128, CHAR) RAD(Address-Pool, REPLY)
FUNC(get_sid) RAD(Class, REPLY)
DBR(0:0) RET(RETRIEVE_SUCCESS)
DBR(*:*) RET(RETRIEVE_ERROR)
SQLStatement db_oci {
SELECT user_password, address_pool
FROM RAD_USERS_TABLE
WHERE user_name=:userid
}
}
}
The above example shows the Result mapping using the new syntax. This feature gives
more flexibility on controlling the return events based on the return codes from oracle
and oci and native error codes from the database. You will not have to write a mapping
function to return an event.
In the above example, on the successful execution of SELECT query configured. The
output mappings would get executed. The first output mapping has been configured
as
DBR(100:*) RET(RETRIEVE_ERROR)
The return event from OCI/ODBC would be compared with the configured ones 100:*
, For a successful sql query the OCI/ODBC would return 0 and error code from the
database would be 0 so the first DBR entry would not match and so as the second one.
So all the next mappings would get executed until the following entry, which would
match and RETRIEVE_SUCCESS would be returned:
DBR(0:0) RET(RETRIEVE_SUCCESS)
368 SQL Access