我有一个返回表的函数。返回的表中(除其他内容外)包含一个商店ID。我可以获取特定事务的商店ID和城市ID,如下所示:
select store_id from table(user2.f_get_store(15, 12345));
--where 15 and 12345 are city_id and transation_id
我有另一个表,其中包含一个事务列表(其中包括事务\u id和城市\u 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&U GeT&U商店的用户不同于我正在使用的用户。
(我编辑了示例代码以显示函数是由不同用户拥有的)