v$session Using v$session you can list all sessionsidentify active sessions with STATUS=’ACTIVE’ and how long it was running LAST_CALL_ET see running sql with SQL_ID or SQL_ADDRIf session is […]
SQL
Posted on:
Exclude Days SQL Function
create or replace FUNCTION EXCLUDE_WEEKEDNDS (p_start_date IN date, p_end_date IN date)RETURN NUMBERISl_count NUMBER;BEGINl_count := 0;SELECT COUNT(1) INTO l_countFROM(WITH DATA AS(SELECT–to_date(trunc(p_start_date), ‘YYYY-MM-DD’) date1,–to_date(trunc(p_end_date), ‘YYYY-MM-DD’) date2p_start_date date1,p_end_date date2FROM dual)SELECT date1+LEVEL-1 […]
SQL
Posted on:
Oracle SQL Function with Examples
PL/SQL function is a reusable program unit stored as a schema object in the Oracle Database. The following illustrates the syntax for creating a function: CREATE [OR REPLACE] […]