PLSQL 用户定义的表类型和联接
假设我有一个用户定义的表类型:
create or replace type SrcCodeTbl is table of varchar(20);
我有一个具有此类型参数的过程:
create or replace procedure Blah.MyProc( srcCodesIN in SrcCodeTbl )
我可以在 select/join 语句中与过程中的另一个表一起使用 srcCodesIn 吗?一直试图让它工作,编译器不断报告:
select distinct someVal into outVal
from OtherTable ot, srcCodesIn sc
where ot.ID = sc.column_val;
Error(28,22): PL/SQL: ORA-00942: table or view does not exist
我确信它的语法很简单,我只是无法弄清楚。我确实得到了一些可以与 for 循环一起使用的东西,但我很感兴趣是否有其他方法可以做到这一点。谢谢。
Let's say I have a user defined table type:
create or replace type SrcCodeTbl is table of varchar(20);
I have a procedure that has a parameter of this type:
create or replace procedure Blah.MyProc( srcCodesIN in SrcCodeTbl )
Can I use srcCodesIn
in a select/join statement with another table within the procedure? Been trying to get it to work, and the compiler keeps reporting:
select distinct someVal into outVal
from OtherTable ot, srcCodesIn sc
where ot.ID = sc.column_val;
Error(28,22): PL/SQL: ORA-00942: table or view does not exist
I'm sure its something simple with the syntax, I just haven't been able to figure it out. I did get something to work with a for-loop, but I'm interested if there's another way to do it. Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
怎么样
How about