我有一个返回表格的函数。返回的表包含(除其他外)一个 store_id。我可以获取特定 transaction_id 和 city_id 的 store_id,如下所示:
select store_id from table(user2.f_get_store(15, 12345));
--where 15 and 12345 are city_id and transation_id
我有另一个表,其中包含交易列表(包括 transaction_id 和 city_id)。我想要一个返回的查询
store_id, city_id, transaction_id
对于事务表中的每个条目。我的第一个猜测是:
select user2.f_get_store(city_id, transaction_id), city_id, transaction_id
from table_name;
(简化了不重要的细节)
但是,这会产生“ORA-00932:数据类型不一致”错误。我需要如何构造这个查询?
(我正在使用甲骨文)
~~~~~编辑~~~~~
当我尝试
select user2.f_get_store(city_id, transactioN_id) from table_name;
我收到权限不足错误。我认为这是因为 f_get_store 由与我正在使用的用户不同的用户拥有。
(我编辑了示例代码以显示由不同用户拥有的功能)