One can use the AUTHID CURRENT_USER clause to make stored procedures and functions execute with the privileges and schema context of the calling user. You can create one instance of the procedure,...
My example is not perfect but close."sql SELECT deptno, job, ename, sal
,CURSOR(
SELECT ename, deptno, job, sal
, DENSE_RANK () OVER (ORDER BY sal desc) rnk
...
Using LEAD analytical function its possible to get hierarchical set of data. Here is an example: SELECT deptno, empno, sal, LEAD(sal, 1, 0) OVER (PARTITION BY dept ORDER BY sal DESC NULLS LAST) N...