1、ORA-06512只是告诉你在PL/SQL code中,问题所在的行数,格式:ORA-06512:at str line num 
2、ORA-01422:返回的行数比指定的多!
ORA-01422: exact fetch returns more than requested number of rows 
Cause: More rows were returned from an exact fetch than specified. 
Action: Rewrite the query to return fewer rows or specify more rows in the exact fetch. 
第二条sql的返回值不唯一!

解决方案 »

  1.   

    条件不同了,结果不同,而且你把得到的值传入变量v_pre_month,但查询返回了多条,这样是不允许的.
    要么使用游标,要么再限定死条件使只返回一行,就看你的意图了.
      

  2.   

    字符串也写错了,strsql2写成strsql
    修改如下:
    strsq2 := 'select '||v_ywlzd||' from t_a where jgdm='||to_char(vv_jgdm)||' and hzny='||to_char(v_date_pre);
    execute immediate strsql2  into v_pre_month;