I want to check whether there is a specific record in my table. If there is, I just do some update; if not, I want to insert one.
So here I have my conditional PL/SQL
...
SELECT COUNT(*) INTO count FROM table WHERE some_condition;
IF (count == 0) THEN
--create a new record
ELSE THEN
--update the existing one
END IF;
...
However, if there is indeed no such a record, the PL/SQL will throw out a NO_DATA_FOUND exception just after the SELECT statement. So what's the proper way to write the query in my case? Thanks so much!