[英]how to use clause “Where IN” in apex ords (REST api)
I am using apex ORDS to create my own REST api. 我正在使用apex ORDS创建自己的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 : 我想做的是创建一个查询,该查询以json格式返回链接到特定用户的动漫列表:
to help visualisation, I have user with ID = 1 that has a seen 3 animes : anime ID : 1,2 and 4 为了帮助可视化,我有一个ID = 1的用户,该用户看到了3个动漫:动漫ID:1,2和4
the request I want to do in ORDS is : 我想在ORDS中执行的请求是:
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
我在使用Java的android studio上,我想要的是创建这种类型的URL:
"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. 问题是我找不到如何在ORDS中捕获?q并将其用于查询。
How do I get ?q in ORDS and could you give me an example please? 我如何获得ORDS中的q,请给我一个例子吗? thanks
谢谢
Everything in the Query String in ORDS is automatically turned into a Bind. ORDS中查询字符串中的所有内容都会自动变为绑定。 There's nothing extra to be done.
无需执行其他任何操作。 "q" is an exception because it is used internally by ORDS for Query Filtering.
“ q”是一个例外,因为ORDS在内部将其用于查询过滤。 That means q= has to follow a very exact syntax and has specific function tied to it.
这意味着q =必须遵循非常精确的语法并具有特定的功能。 REF: https://docs.oracle.com/cd/E56351_01/doc.30/e87809/developing-REST-applications.htm#GUID-091748F8-3D14-402B-9310-25E6A9116B47
参考: 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.
只需选择其他字母/名称,即可正常工作。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.