oracle中FOR的解释
我正在做一个测试。我的所有测试都是按行进行的,所以我的行看起来像这样;
ID | TEST
----------------------------------
1 | 'select sysdate from dual'
2 | 'select sysdatesss from dual'
现在我逐行阅读它,我需要使用 EXPLAIN PLAN FOR
对其进行测试,
因此第一行将是这样,
EXPLAIN PLAN FOR select sysdate from dual
但我在转换 TEST
字段时遇到问题。现在我用;
EXPLAIN PLAN FOR testing.TEST
但它不起作用。
有什么想法吗?
I am making a test. I have all tests in rows, so my rows looks like this;
ID | TEST
----------------------------------
1 | 'select sysdate from dual'
2 | 'select sysdatesss from dual'
Now I read it row by row and I need to test it with EXPLAIN PLAN FOR
so the for the first row it would be
EXPLAIN PLAN FOR select sysdate from dual
but I have problem converting the TEST
field. Right now I use;
EXPLAIN PLAN FOR testing.TEST
but it does not work.
Any ideas?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
SQL语句是一个字符串,但是您必须使用动态SQL来转换存储为字符串的SQL语句。
参考:
A SQL statement is a string, but you have to use dynamic SQL to convert a SQL statement that is stored as a string.
Reference:
立即执行“解释计划” ||测试.测试
EXEC IMMEDIATE 'EXPLAIN PLAN FOR ' || TESTING.TEST