Reputation: 12484
In my stored proc, I run a query like soi :
SELECT [email protected]
FROM [email protected]
WHER PROVID = 28938
How would obtaon only one NEXTVAL result?
Upvotes: 1
Views: 79
Reputation: 1974
Or more generally: make sure your FROM and WHERE clauses result in just one row found - then NEXTVAL will be executed just once.
In addition, you can always get just a single NEXTVAL execution by invoking it natively in PL/SQL, as in:
DECLARE
l_seq INTEGER;
BEGIN
l_seq := my_sequence.NEXTVAL;
END;
Upvotes: 4