我怎样才能解决这个“SQL语句被忽略”的问题?错误?
我有以下无法编译的小函数:
function f_query_01 Return interval Day to second is
start_time timestamp(3);
end_time timestamp(3);
time_diff interval Day to second;
c_query_number number;
begin
start_time := systimestamp;
select count(*) into c_query_number from wg; <--This is the line that errors out
end_time := systimestamp;
time_diff := start_time - end_time;
return time_diff;
end f_query_01;
编译器给出以下错误:
Error(29,3): PL/SQL: SQL Statement ignored
Error(29,44): PL/SQL: ORA-04044: procedure, function, package, or type is not allowed here
是什么导致了此错误以及如何修复它?
I have the following small function that does not compile:
function f_query_01 Return interval Day to second is
start_time timestamp(3);
end_time timestamp(3);
time_diff interval Day to second;
c_query_number number;
begin
start_time := systimestamp;
select count(*) into c_query_number from wg; <--This is the line that errors out
end_time := systimestamp;
time_diff := start_time - end_time;
return time_diff;
end f_query_01;
The compiler gives me the following errors:
Error(29,3): PL/SQL: SQL Statement ignored
Error(29,44): PL/SQL: ORA-04044: procedure, function, package, or type is not allowed here
What is causing this error and how can I fix it?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
看起来表 wg 不存在。当更新为正确的表名称时,编译不会出现错误。来自表不存在的编译器的消息将是最有帮助的。
It appears the table wg does not exist. When updated to the correct table name the compile works without errors. A message from the compiler of table does not exist would be most helpful.