简体   繁体   中英

how to use clause “Where IN” in apex ords (REST api)

I am using apex ORDS to create my own REST api.

what I'm trying to do is to create a query that returns in json format a list of animes linked to a specific user :

to help visualisation, I have user with ID = 1 that has a seen 3 animes : anime ID : 1,2 and 4

the request I want to do in ORDS is :

select *
from table
where ID in (1,2,4)

I'm on android studio using java and what I want is to create an URL of this type : "https://apex.oracle.com/****/apex/****/****/getAnimeList?q=" + theList

The problem is that I can't find how to catch ?q in ORDS and use it it my query.

How do I get ?q in ORDS and could you give me an example please? thanks

Everything in the Query String in ORDS is automatically turned into a Bind. There's nothing extra to be done. "q" is an exception because it is used internally by ORDS for Query Filtering. That means q= has to follow a very exact syntax and has specific function tied to it. REF: https://docs.oracle.com/cd/E56351_01/doc.30/e87809/developing-REST-applications.htm#GUID-091748F8-3D14-402B-9310-25E6A9116B47

For the others, here's an example. Just choose a different letter/name and it'll work fine.

在此处输入图片说明

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM