Oracle Cursor的使用

DECLARE
  v_key_ty VARCHAR2(20) := 'COND_OFFER_MSG';
  outinfo  Order_types.Order_info_tp;
  v_row    master_cd%ROWTYPE;

  CURSOR test_cur IS
    select * from master_cd where key_ty = 'LAR_BD_MAP';
BEGIN

  OPEN test_cur;
  loop
    FETCH test_cur
      into v_row;
    EXIT WHEN test_cur%NOTFOUND;
    dbms_output.put_line(v_row.cd);
  end loop;
END;

你可能感兴趣的:(oracle)