I am currently migrating a SQL Server stored procedure to Oracle stored procedure:
In SQL Server, we use
I don't know how to efficiently do the EXISTS check in Oracle, so what I did is define a counter variable, and do like this:
SELECT COUNT(*) INTO v_counter1
IF v_counter1 = 0 THEN
Though I don't think it is efficient because if there are many records in the table satisfy the condition, it will take a long time to count the number. Really I don't need the number but just if there is just one case.
I know my way is stupid, just give some recommendations.