我在設計ords api並遇到以下問題。ords url參數不起作用
我想設計下列API:
/ords/schema_name/customers/?name=somename
可能返回的項目,其中列customer_name
等於輸入參數name
,如果設置的URL。
的ORDS服務定義爲:
BEGIN
ORDS.DEFINE_SERVICE(
p_module_name => 'customers' ,
p_base_path => '/customers/',
p_pattern => ':id?',
p_source => 'select * from customers where customer_id = nvl(:id,customer_id) and UPPER(customer_name) = nvl(UPPER(:name),UPPER(customer_name))'
);
COMMIT;
END;
不過,我從請求/ords/schema_name/customers/?name=somename
得到了resonse是爲請求/ords/schema_name/customers/
相同。它從數據庫返回所有客戶。
我也試過發送請求到/ords/schema_name/customers?name=somename
。不是運氣也。
我想知道爲什麼url上的參數不起作用,以及如何解決它。
我會嘗試/ ords/schema/customers?key = somekey。這裏有類似的例子http://www.thatjeffsmith.com/archive/2017/03/a-tale-of-two-styles-of-uris-and-parameters-words/ – thatjeffsmith
@thatjeffsmith我也試過發送請求到'/ ords/schema_name/customers /?key = somekey'。不是運氣也。 – fluency03
@thatjeffsmith但我也看到很多線路上的例子都在做'.../customers /?key = somekey'。 – fluency03