strMsg := select * from (select msg_content from dssq_msg where type='xh' order by dbms_random.value)where rownum<=1;在触发器中,提示这个地方有错误,请问,是哪地方错了,谢谢!

解决方案 »

  1.   

    觸發器中需要Into子句
    declare 
      msg varchar2(20);
    begin
    select msg_content into msg from (select msg_content from dssq_msg where type='xh') t where rownum<=1;
    end;
      

  2.   

    漏了order by語句:
    declare 
      msg varchar2(20);
    begin
    select msg_content into msg from (select msg_content from dssq_msg where type='xh'
    order by dbms_random.value)  where rownum<=1;
    end;
      

  3.   

    谢谢tommysun哥哥,我先试一下
      

  4.   

    to tommysun:
    帮忙看一下,这句话怎么写呀declare 
      msg varchar2(20);
    begin
     select msg_content+'回复2看下一条' into msg from (select msg_content from dssq_msg where type='xh'
     order by dbms_random.value)  where rownum<=1;
    end;
      

  5.   

    是要连接字符串么?是的话就用||
    msg_content||'回复2看下一条'
      

  6.   

    declare 
      msg varchar2(20);
    begin
     select msg_content || '回复2看下一条' into msg from (select msg_content from dssq_msg where type='xh'
     order by dbms_random.value)  where rownum<=1;
    end;