database - SQL statement ignore when attempted to open cursor -


i have error, "sql statement ignored", when make spec , body of package database in pl/sql.

i wrote code :

procedure get_all_link_recent_result     ( pi_userid        in  tlms_cm_result.userid%type,       pi_email         in  tlms_cm_result.email%type,       pi_testid        in  tlms_cm_result.testid%type,       po_ret_code      out varchar2,       po_ret_message   out varchar2,       po_ref_cursor    out type_cm_result_refcur     )     l_userid           tlms_cm_result.userid%type;     l_testid           tlms_cm_result.testid%type;     begin       l_userid   :=    pi_userid || 0;       l_testid   :=    pi_testid || 0;     open po_ref_cursor      select *       tlms_cm_result       userid l_userid ,       testid l_testid ,       email = pi_email      order       userid;    po_ret_code := c_err_msg_other;   exception     when others       po_ret_code := c_err_msg_other;       po_ret_message := sqlerrm;   end get_all_link_recent_result; 

the specific line "pl/sql : sql statement ignore" error line

open po_ref_cursor 

so, statements after that, starting for select * from cause error.

open cursor independent complete statement. is, should ends semi colon. in case semi colon missing.

i'm not sure trying achieve code, cannot test it. not clear me why opening cursor without explicitly closing it. thing seem trying open implicitly cursor for loop. not way it.

for example, rewrite part of code follows::

open po_ref_cursor;  --add semi-colon  in (select *   tlms_cm_result   userid l_userid ,   testid l_testid ,   email = pi_email  order   userid)  loop   po_ret_code := i.c_err_msg_other;  end loop; 

assuming c_err_msg_other part of select query.


Comments

Popular posts from this blog

OpenCV OpenCL: Convert Mat to Bitmap in JNI Layer for Android -

android - org.xmlpull.v1.XmlPullParserException: expected: START_TAG {http://schemas.xmlsoap.org/soap/envelope/}Envelope -

python - How to remove the Xframe Options header in django? -