select count(*) into var1 from tab,... where ...
再判断var1的值

解决方案 »

  1.   

    那你可以做一个procude来解决这个问题亚
      

  2.   

    可以用利用exception 事务处理,判断当no_data_found异常发生时,再处理var1即可!
      

  3.   

    select * from dual 
    where exists (select * from your_table_name where your_condition;)这样的话只要有记录返回则显示DX你用楼上的方法再结合exist子句也行 
      

  4.   

    先声明一CURSOR:
            CURSOR CUR_A IS
                SELECT
                    *
                FROM
                  ...
    判断是否查询结果为空:
                OPEN CUR_A;
                FETCH CUR_A INTO REC_A;
                IF CUR_A%FOUND THEN
                  ...
                ELSE
                  ...
                END IF;
                CLOSE CUR_A;
      

  5.   

    想不到一时没刷新问题就变了du0lin(dulin)说得不错
      

  6.   

    select count(*) from 

        select .../*这才是你真正的查询语句*/
    )
      

  7.   

    使用Oracle Pl/sql中的隐式游标
    先执行语句,然后用SQL%RowCount判断。SQL%RowCount中存放刚刚执行的语句影响的行数。select * from tab1 where col1 = 'abc';

    Insert into tab1(...) values(...);if (SQL%RowCount=0) then
       ...
    end if
      

  8.   

    select * from table_name where where_condition;
    if sql%notfound then
       return FALSE;
    else
      return TRUE
    end if;