SQL> create or replace procedure p_query_all_question(o_result sys_refcursor)
2 --在线答疑显示所有问题
3
4 --显示的列:学段,科目,题目内容,提问者,浏览数,状态,更新时间
5 --涉及到的表:问题信息,问题统计信息,学段科目信息
6 as
7 v_sqlstr varchar2(4000);
8 begin
9 v_sqlstr:='select
10 xk.teacherstage,--学段
11 xk.subjectname,--科目
12 qi.question_title,--题目内容
13 qi.question_id,--提问者
14 qt.browse_count,--浏览数
15 qi.question_status,--状态
16 qt.lastest_update_time --更新时间
17 from Q_QUESTIONINFO qi,Q_QUESTION_STAT qs,E_SUBJECTINFO xk
18 where qi.questionid=qs.questionid and qi.subject_id=xk.subject_id
19 ';
20 open o_result for v_sqlstr;
21
22 end;
23 /
Warning: Procedure created with compilation errors.
SQL> show err
Errors for PROCEDURE P_QUERY_ALL_QUESTION:
LINE/COL ERROR
-------- -----------------------------------------------------------------
20/1 PL/SQL: Statement ignored
20/6 PLS-00361: IN cursor 'O_RESULT' cannot be OPEN'ed
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/9240380/viewspace-667023/
,如需转载,请注明出处,否则将追究法律责任。