日期:2014-05-17  浏览次数:20792 次

分页存储过程一直报缺失关键字,各位帮忙看看
SQL> --分页
SQL> create or replace procedure proc8(v_in_table in varchar2,v_in_pagesize in number,v_in_pagenow in number,v_out_result out pack2.my_cursor) is
  2 v_begin number(10);
  3 v_end number(10);
  4 v_sql varchar2(3000);
  5 begin
  6 v_begin:=v_in_pagesize*(v_in_pagenow-1)+1;
  7 v_end:=v_in_pagesize*v_in_pagenow;
  8 v_sql:='select name into v_name from (select a1.*,rownum rn from (select * from '||v_in_table||') a1 where rownum<='||v_end||') where rn>'||v_begin;
  9 open v_out_result for v_sql;
 10 end;
 11 /
 
java.sql.SQLException: ORA-00905: 缺失关键字
ORA-06512: 在 "SYSTEM.PROC8", line 9
ORA-06512: 在 line 1



------解决方案--------------------
v_sql 里面不要加into 兄弟
------解决方案--------------------
SQL code

select name into v_name from  --这句有问题,改成
select name from