Tuesday, June 18, 2013

Some Oracle Query Tricks

----Get factorial of number using query:

with t as (select level as l from dual connect by level <=&value)
select EXP (SUM (LN (l))) MULTIPLY from t

----Get ORACLE_HOME path using query:

select substr(file_spec, 1, instr(file_spec, '\', -1, 2) -1) ORACLE_HOME from dba_libraries where library_name = 'DBMS_SUMADV_LIB';

No comments:

Post a Comment

web stats