Category Archives: pl/sql

Oracle PL/SQL Example: Select Total Record Counts in a Cursor

Solution * Use Oracle analytical function, COUNT(*) OVER(), e.g. cursor c1 IS SELECT DISTINCT EMPLOYEE_ID, FIRST_NAME, LAST_NAME, HIRE_DATE, COUNT(DISTINCT EMPLOYEE_ID) OVER() CNT FROM EMPLOYEES; Example CREATE OR REPLACE PROCEDURE pTest AS logfile_prefix varchar2(64) := ‘pTest’; log_dir varchar2(64) := ‘LOG_DIR’; logfile_name … Continue reading

Posted in oracle, pl/sql, sql | Tagged , | Leave a comment