2 Replies Latest reply: Sep 26, 2013 1:53 AM by Test2 RSS

    RESTful Service Search Parameters

    Test2

      Hello,

      I am using APEX 4.2.2 .. with Listener 2.0.3

       

      I want to expose  data in EMP table as RESTful Service with parameters:

       

      The source is:

      Source Type :SQL query .Format: JSON
      
      select * from emp where 
      (:job IS NULL OR job = :job)
       and
      (:ename is null or ename = :ename)
      
      
      
      URI Template:employeesfeed/{job}/{ename}

       

      If I use this URL, it works fine...

      http://oraclesrv/real_estate/property/hr/employeesfeed/MANAGER/BLAKE

      and it gives:

      {"next":{"$ref":"http://oraclesrv/real_estate/property/hr/employeesfeed/MANAGER/BLAKE?page=1"},"items":[{"empno":7698,"ename":"BLAKE","job":"MANAGER","mgr":7839,"hiredate":"1981-04-30T20:00:00Z","sal":2850,"deptno":30}]}
      

      But, as you may notice from the Source logic, the "end user" should be able to retrieve all MANAGERS using this Link.

       

      http://oraclesrv/real_estate/property/hr/employeesfeed/MANAGER/null

      But, it gives:

      {"items":[]}

       

      So, How can I retrieve all Managers ?? ( using that Source ).

       

      Regards,