DELETE FROM DC2.OR_100 WHERE PV_USER = '815';
commit;
INSERT INTO DC2.OR_100 (PV_KEY,PV_USER,PV1)
SELECT LPAD(TO_CHAR(ROWNUM),20,0),TABLE_SELECT.* FROM (
SELECT '815',COUNT(*)
FROM
 DC2.SAM_DENPYO T001
,DC2.SAM_SYOHIN T002
WHERE
 T001.DEN_KB(+)='2'
 AND T001.DEN_SYO_CD=T002.SYO_CD(+)
 AND T001.DEN_DATE BETWEEN '20100301' AND '20100310'
) TABLE_SELECT
;
commit;
EXIT;


