日期:2014-05-16 浏览次数:20450 次
1.首先创建一个表lengzijiantest,表中只有一个字段f_id
CREATE TABLE LENGZIJIANTEST ( F_ID NUMBER NOT NULL )
insert into lengzijiantest values (1)
4.写入如下命令
DECLARE v_tmp NUMBER := 0; BEGIN SELECT f_id INTO v_tmp FROM lengzijiantest WHERE f_id = 2; EXCEPTION WHEN NO_DATA_FOUND THEN DBMS_OUTPUT.put_line ('找不到数据'); END;
DECLARE v_tmp NUMBER := 0; BEGIN SELECT min(f_id) INTO v_tmp FROM lengzijiantest WHERE f_id = 2; EXCEPTION WHEN NO_DATA_FOUND THEN DBMS_OUTPUT.put_line ('找不到数据'); END;