我们可以在我的本地模式过程中使用不同模式的视图吗
can we use different schema's view in my local schema procedure
假设我当前的架构名称是 sch1。如果我在名为 sch2. 的不同模式中有一个 v1 视图,所以我想使用该视图(sch2.v1 ) 在我当前的模式 (sch1) 的 过程 中。
这可能吗?。是的请举一个例子。
是的,通过为 sch2.v1 授予 sch1 select 权限:
SQL> conn sch2/pwd1
SQL> grant select on v1 to sch1 [ with grant option ];
SQL> conn sch1/pwd2
SQL> select * from sch2.v1; -- assuming you query sch2.v1 inside your procedure
假设我当前的架构名称是 sch1。如果我在名为 sch2. 的不同模式中有一个 v1 视图,所以我想使用该视图(sch2.v1 ) 在我当前的模式 (sch1) 的 过程 中。
这可能吗?。是的请举一个例子。
是的,通过为 sch2.v1 授予 sch1 select 权限:
SQL> conn sch2/pwd1
SQL> grant select on v1 to sch1 [ with grant option ];
SQL> conn sch1/pwd2
SQL> select * from sch2.v1; -- assuming you query sch2.v1 inside your procedure