Skip to Main Content

ORDS, SODA & JSON in the Database

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Migrating from mod_owa, checkbox input or owa_util.ident_arr value type

Olafur TNov 7 2018 — edited Nov 7 2018

Hi,

working with ORDS 18.3 and tomcat 8. Trying to call a procedure that takes in owa_util.ident_arr that used to receive the values from a form checkboxes.

What's the best way to deal with a POST handler that submits checkbox values? ORDS does not convert it into JSON so any attempt to parse it will give it an error of  "ORA-20987: Error at line 1, col 1: strict mode JSON parser does not allow unquoted literals"

So, the body is kept as plain "form data" and not parsed.

Printing the body will show a traditional form body like "param1=val1&param2=val2&chk1=chkval1&chk1=chkval2&chk1=chkval3&chk1=chkval4"

So what is the "correct" way to parse checkbox array value of "chk1" without doing extensive string manipulations?

I've tried a few ways to get it in but all results in an ORDS 500 error.

Is my only way to use "apex_string.split("parsed body", '\s*[=&]\s*');" and loop over all "chk1" and add them to an array?

Thanks in advance

Olafur

Comments
Post Details
Added on Nov 7 2018
3 comments
977 views