Thursday 15 September 2011

rest - APEX RESTFUL POST method -


If I take a GET method with SQL query in the APEX cool service, then all the parameters go into the URL string. This means that end-user can change the parameter by itself ... so I should use the post with POL / SKL block. But how do I return data from this method? I like the query in GET

  SELECT * from table WHERE id =: PARAM   

it gets done in POST ???

  Select the declaration * from the table WHERE id =: PARAM END;   

I can not find anything useful in the documentstion, only about GET methods.

I know this is an old question, but recently I had the same problem and I Got a solution for myself

Perhaps my solution is useful to you. I use Apex combination to generate and parsing JSON objects in PAL / SQL when I work with post methods in ease of webservices. The following in the source of the resource handler:

  Output Jason; Start apex_plugin_util.print_json_http_header; Output: = test_function (: INPUT_JSON_STRING); Sys.htp.p (output.to_char); End; After that, in my PL / SQL function:  
 use the  function or change the check_type (INPUT_JSON_STRING VARCHAR2) returns JSON my_json json; Aux_string varchar2; BEGIN my_json: = json (INPUT_JSON_STRING); Aux_string: = my_json.get ('Something'). Get_string; (...) returns my_json; EXCEPTION END test_function;   

My blog is more detailed, but it's in Spanish, sorry.

Hope it helps.

No comments:

Post a Comment