0

有没有办法在 SQL 查询中传递多个参数?

带有 1 个参数的 SQL 查询。

Select 
       cusode as ACCOUNT,
       cusfulname as NAME,
       cushomephone as PHONE,
       numcals as CALLCOUNT,
       firstcalltime as FIRSTCALL,
       durationhm as DURATION,
       address as ADDRESS,
       city as CITY
from table(os_un_etcist('4815044'))

如何传递超过 1 个参数。

例如“4815044”和“415175”

4

2 回答 2

2

您需要修改该函数以允许一个 id 数组,而不仅仅是 1。您可以修改现有的,或创建一个新函数,该函数只需为每个 id 调用原始函数并将数据输出管道。

要获取函数的来源,您可以执行以下操作:

select line, text
from all_source
where name = 'MY_FUNCTION';

或者(更好的选择):从 Oracle 下载SQL Developer(免费),然后打开 Functions 文件夹进行连接。相信我,你会希望这个(或者可能是蟾蜍)向前发展。

于 2012-09-14T19:44:23.737 回答
1

如果它们具有相同的列,我建议进行 UNION 查询,因此多个select语句分别查询不同的表

if they have different columns use the ,operator and give the table aliases and then select appropriately

select x.a,y.b,y.c from table(os_un_etcist('4815044')) as x, table(os_un_etcist('415175')) as y

PS:这是基于我对 OPs 问题的解释。

于 2012-09-14T19:10:04.820 回答