Hi,
I've created a simple function in PL/SQL (called FUNC_COUNTER) which makes a SELECT FOR UPDATE to generate and maintain a counter (stored in an Oracle TABLE).
When I execute the PL/SQL function in a BEGIN END, my function returns my counter value.
Ex : It returns 1230, 1231, 1232...
But when I try to select my PL/SQL in a SELECT query, I'm obtaining a null value :
ex :
SELECT FUNC_COUNTER() FROM dual;
-> NULL
Then I've tried to create another PL/SQL that calls my first function and it works well.
This new function returns my counter valueq : ex : 1233, 1234...
I always could call my functions in a SELECT from DUAL query.
Why this time it is not possible please ? (is there any lock issue ?)
Regards