1) I tried DOC_NUMBER_COUNTER_API.FETCH_NEXT_NUMBER('EVENTBUS', '-') but it didn’t work, and even when I set a hardcoded value, it doesn’t appear in my table.
For my tests, I’m using an OData call on my custom projection CustomProjectionTESTNINOTAB.
But the ID column is still null.
However, this call works fine.
SELECT IFSAPP.DOC_NUMBER_COUNTER_API.FETCH_NEXT_NUMBER('EVENTBUS','-') FROM DUAL
Hi @NINO,
First, counter value would be null for existing records, so better check by creating by some new records.
Second, use PL/SQL Expression option to get default value.
Please check above suggestions and let me know if you need further assistance.
For testing, I’m using an OData call on my custom projection CustomProjectionTESTNINOTAB, but the ID column still remains null.
However, when I run this directly in SQL:
SELECT IFSAPP.DOC_NUMBER_COUNTER_API.FETCH_NEXT_NUMBER('EVENTBUS', '-') FROM DUAL
it works perfectly.
Do you have any idea why the default value or PL/SQL expression isn’t being applied when inserting through OData?
Thanks again for your help.
@NINO you can’t call the procedure directly in SQL Developper, you need to call it threw dual for exemple or using a variable to store the return result
.
BUT
when adding a custom field the call could be added directly :
I have created a custom entity and page
Works well from my end
Hi everyone,
Thanks for your help and suggestions.
I finally found why the PL/SQL default value wasn’t applied when inserting data through OData.
In fact, when using a custom entity and projection, the default value isn’t triggered by a simple POST on the Projection Set. You must call the Default action of the projection, which initializes the record and executes the PL/SQL default expression.