-- -----------------------------------------------
-- USING SQL TO DEVELOP TIME ORIENTED APPLICATIONS
-- By : Richard T. Snodgrass
-- -----------------------------------------------
--
-- Fill the hole in POSITIONS for the position of
-- Associate of the Computer Science.
-- By   : Bruce C. Huang
-- Date : Dec. 12, 1997
--
-- Oracle 7.3 cannot handle INSERT..VALUES..WHERE,
-- so the SQL92 format was modified to INSERT..
-- SELECT..WHERE
-- -----------------------------------------------
REM
REM Code Fragment 7.4 in Oracle 7.3
REM
INSERT INTO POSITIONS
   ( PCN , JOB_TITLE_CODE1, START_DATE , END_DATE )
SELECT '341288' PCN , NULL , SYSDATE , TO_DATE('3000-01-01','YYYY-MM-DD')
FROM   DUAL
WHERE  NOT EXISTS( SELECT *
                   FROM   POSITIONS P2
                   WHERE  P2.PCN = PCN
                      AND P2.END_DATE = TO_DATE('3000-01-01','YYYY-MM-DD'));
