This discussion is archived
0 Replies Latest reply: Feb 26, 2013 4:11 PM by 665395 RSS

x-www-form-urlencoded POST body parameters as collection

665395 Newbie
Currently Being Moderated
Hey Gurus,

Is it possible to obtain the bind parameters created from a POST Body with content type x-www-form-urlencoded as a collection?

I'm faced with a problem with one of my update procedure's Resource Template. Our application is dynamic in that data instances are defined by metadata in other tables,
I am attempting to update a record but do not know until time of processing what :bind variables will be available.

An example of our POST request is like:

POST my_api/instances/12345
Content Type: x-www-form-urlencoded

Post body: 234=John&235=Watson&236=Male

Where 234 is a user defined First Name field saved in the metadata tables and is listed as a child of 12345.

An example of what my attempt at processing looks like:

- loop item instance data tied to resource

for item in
(select item_id from record_items where record_id = 12345)
loop
--Pass item_id and value
lv_upd_stmt := 'pk_update_item('||item.item_id||', :'||item.item_id||);'
execute immediate lv_upd_stmt;
end;

Unfortunately this fails with Bind Variable NOT DECLARED.

I hope somebody understands my problem, any information is appreciated.

Thank you

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points