2011-08-02 10:24:26
SQL 4 Oracle 오라클용 sql 실무
▒ PLSQL 10초마다 무한반복
declare
find_tm number := 0;
find_cnt number := 0;
begin
WHILE 1=1 LOOP
select mod(TO_CHAR(SYSDATE,'ss'),10) INTO find_tm from dual;
if find_tm = 0 then
select count(*) INTO find_cnt from 목적_Table where 최득일자=to_char(SYSDATE,'yyyymmdd') and 확인플레그='0' ;
if find_cnt > 5 then
update 목적_Table set 확인플레그='1' where 최득일자=to_char(SYSDATE,'yyyymmdd') and 확인플레그='0' ;
commit ;
end if;
end if;
END LOOP ;
end;

'SQL4Oracle' 카테고리의 다른 글
| 줄바꿈관련 특수문자 제거 (0) | 2023.03.10 |
|---|---|
| COUNT 방법 (중복배제 집계, NULL 집계, 부분 집계) (0) | 2023.03.10 |
| 우편번호로 시군구 지역 고객찾기 (0) | 2023.03.10 |
| replace (0) | 2023.03.10 |
| JOIN UPDATE (0) | 2023.03.10 |