CREATE OR REPLACE FUNCTION getAdrHome
RETURN VARCHAR
IS
base VARCHAR (10);
home VARCHAR (255);
BEGIN
SELECT VALUE
INTO base
FROM v$diag_info
WHERE name = 'ADR Base';
SELECT SUBSTR (VALUE, LENGTH (base) + 2)
INTO home
FROM v$diag_info
WHERE name = 'ADR Home';
RETURN home;
END;
/
To use this function
select getAdrHome from dual;
No comments:
Post a Comment