Resource Templates : Strategy for dealing with PUT and POST
mwrfFeb 22 2011 — edited Feb 21 2013Hi,
I'd like some advice on best practice for dealing with inserts and updates through Resource
Templates.
I see it that I have 2 options:
(a) Take my data in via URI parameters OR
(b) in the content body as application/json
With option (a), It goes like this:
update my_table set
col1 = {uri param1},
col2 = {uri param2}
etc. etc.
With approach (b),I am converting the json blob to a varchar2 and
using pl/json to parse it.
This works fine, Until the 4000 varchar2 limit is reached.
I will be receiving data as application/json in the content body by default
so option (b) would suit me best, but it seems messy to do it within
the resource template. I could offload to a database procedure for processing
but that's another layer in the system to maintain.
I'd be interested in others experiences with this and how you approached it / best
practice for doing this.
Kudos to whoever came up with the resource template idea in Oracle and putting it in the Apex listener, I'm surprised
that it hasn't gained more attention. I hope that a full production version is released soon.