Oacle 저장 프로 세 스 의 상용 문법

896 단어 Oacle
기록 해 보 세 요. 주로 자신 이 나중에 찾 는 데 편리 합 니 다.
create or replace procedure sp_test
(
aa in varchar,
bb in number default 0
) is
v_pos varchar(50);
v_num number;
begin
 
 ---        
 select SUBSTR(PARAMETER, 1, INSTR(PARAMETER,branchId)-2) ||
           SUBSTR(PARAMETER, INSTR(PARAMETER,branchId)+length(branchId)) into v_pos from dual;
 
 ---            
 loop
    if bb is null then ---if   
       exit;   ---    
    end if;
    if v_num >= bb then
       exit;
    end if;
    v_num := v_num +1;
  end loop;
           
    ---    
    dbms_output.put_line('aaaaa');

    ..
  
  commit;
  exception
      when NO_DATA_FOUND then  --       
          dbms_output.put_line('ddddd');
    when others then
    begin
    --      
      dbms_output.put_line(sqlerrm);
      rollback;
      
      ---    
      raise;
    end;  
end sp_test;

좋은 웹페이지 즐겨찾기