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

Example 5 SQL Statement with Result Mapping - OCI
SQLAction RetrieveUser {
{
input
RAD(User-Id,REPLY) DBP(userid, 254, CHAR)
output
DBC(user_password, 128, CHAR) RAD(Password,CHECK)
DBC(address_pool, 128, CHAR) RAD(Address-Pool,REPLY)
DBR(DBretCode) FUNC(RETRIEVEonZero)
SQLStatement db_oci {
SELECT user_password, address_pool
FROM RAD_USERS_TABLE
WHERE user_name=:userid
}
}
}
Example 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)
268 SQL Access