How to check if cursor returns any records in oracle?

后端 未结 5 1930
旧时难觅i
旧时难觅i 2020-12-11 02:41

I have a following stored procedure in which I have used a cursor. Depending on whether the cursor return any records or not I need to do some processing.

But I am

5条回答
  •  情歌与酒
    2020-12-11 02:51

    341/5000 One solution would be to work with reverse logic. It is e.g. not possible to ask:

    IF my_record IS NULL THEN
       do something;
    END IF;
    

    or

    IF my_record.my_attibute IS NULL THEN
       do something;
    END IF;
    

    Instead it is possible to ask:

    IF my_record.my_attibute IS NOT NULL THEN
       go on processing;
    ELSE
       do something;
    END IF;
    

提交回复
热议问题