【发布时间】:2014-06-05 21:23:47
【问题描述】:
我们称之为 foo
我会这样称呼它:
Select * From TABLE (schema.foo("aString"))
它将返回与该用户名相关的所有项目的字符串。
EG
Select * From TABLE (schema.foo("apple")) =
apple
-----
fruit
red
delicious
我想要做的是遍历一个列表,并针对该列表中的每一行运行该过程。
我正在尝试运行的内容:
Select * from schema.fruits where name in (Select * From TABLE (schema.foo(fruits.name))
但是它没有给我正确的输出。我想要的是以下内容:
apple | fruit
apple | red
apple | delicious
orange | fruit
orange | orange
orange | also delicious
有什么想法吗?
【问题讨论】:
-
你能附上你的SP代码吗?
标签: sql stored-procedures db2