>>바람 님께서 쓰시길<<
::
:: 요건 새로 수정한겁니당..
:: create procedure count_page(p_code char(2))
:: define v_num integer;
:: select count(num) into v_num from counter
:: where to_char(visit_date,'%m%d%Y') = to_char(current, '%m%d%Y') ;
::
:: if(v_num > 0) then{
:: update counter set num = num+1
:: where to_char(visit_date,'%m%d%Y') = to_char(current, '%m%d%Y')
:: and code=p_code;
:: }else{
:: insert into counter(p_code,visit_date,num)
:: values(p_code,current,1);
:: }
:: end if
:: end procedure;
::
제어문을 보니 약간 다르네요.
IF-ELIF-ELSE-END IF
이런 식으로 되어있는데요
중간에 condition부분에 ()를 사용하지 않네요.
그리고... 블럭문을 처리할때도...{}를 사용하지 않구요.
if v_num > 0 then
update counter set num = num+1
where to_char(visit_date,'%m%d%Y') = to_char(current, '%m%d%Y')
and code=p_code;
else
insert into counter(p_code,visit_date,num)
values(p_code,current,1);
end if
프로시저 만들어서 해보니 잘 되네요.
그럼 수고하세요.
|