Hi
That SQL will work in vast majority of cases: but i have had issues where there is more than one environment in that installation with the same miscellaneous property name. In that case you can use:
SELECT ATTRIBUTE_VALUE
FROM IM_ENVIRONMENT_JDBC_LD LD, IM_ENVIRONMENT_JDBC ENV
WHERE SECTION_NAME = 'misc' and
REF_ID = ENV.UNIQUE_NAME and
FRIENDLYNAME = 'envname' and
ATTRIBUTE_NAME = 'AuditViewTask'
where 'envname' is the name of the environment.
Cheers