pagecount number(3);
recordcount number(5);
begin
select count(*) into recordcount from student_info;
if mod(pagecount,pagesize)>0 then
pagecount := recordcount / pagesize +1;
else
pagecount := recordcount / pagesize;
end if;
if pageno <1 then
pageno := 1;
end if;
if pageno > pagecount then
pageno := pagecount;
end if;
select * from
(
select s.student_id,rownum as rown from student_info s
) where rown between pageno*pagesize-pagesize+1 and pageno*pagesize;
end pageset;
提示如下错误
PROCEDURE IGHACK.PAGESET 编译错误
错误:PLS-00103: 出现符号 "("在需要下列之一时:
:= . ) , @ % default
character
行:1
文本:create or replace procedure pageset(pageno in number(3):=1 , pagesize in number(3):=1)
7 个解决方案
#1
create or replace procedure pageset(pageno in number, pagesize in number)
is
pagecount number(3);
recordcount number(5);
begin
select count(*) into recordcount from student_info;
if mod(pagecount,pagesize)>0 then
pagecount := recordcount / pagesize +1;
else
pagecount := recordcount / pagesize;
end if;
if pageno <1 then
pageno := 1;
end if;
if pageno > pagecount then
pageno := pagecount;
end if;
select * from
(
select s.student_id,rownum as rown from student_info s
) where rown between pageno*pagesize-pagesize+1 and pageno*pagesize;
end pageset;
存储过程in传入的参数不能复制啊。
你想完成什么样需求呢?
is
pagecount number(3);
recordcount number(5);
begin
select count(*) into recordcount from student_info;
if mod(pagecount,pagesize)>0 then
pagecount := recordcount / pagesize +1;
else
pagecount := recordcount / pagesize;
end if;
if pageno <1 then
pageno := 1;
end if;
if pageno > pagecount then
pageno := pagecount;
end if;
select * from
(
select s.student_id,rownum as rown from student_info s
) where rown between pageno*pagesize-pagesize+1 and pageno*pagesize;
end pageset;
存储过程in传入的参数不能复制啊。
你想完成什么样需求呢?
#2
只指定参数类型就行,不用指定大小,入参可以省略in。
改为
你加:=1是想赋个初始值?
改为
create or replace procedure pageset(pageno number, pagesize number)
你加:=1是想赋个初始值?
#3
存储过程in传入的参数不能复制啊
我想做的是一个分页的过程
我想做的是一个分页的过程
#4
现在我用in out可以赋值
但是
select * from
(
select s.student_id,rownum as rown from student_info s
) where rown between pageno*pagesize-pagesize+1 and pageno*pagesize;
这一句提示
PROCEDURE IGHACK.PAGESET 编译错误
错误:PLS-00428: 在此 SELECT 语句中缺少 INTO 子句
但是
select * from
(
select s.student_id,rownum as rown from student_info s
) where rown between pageno*pagesize-pagesize+1 and pageno*pagesize;
这一句提示
PROCEDURE IGHACK.PAGESET 编译错误
错误:PLS-00428: 在此 SELECT 语句中缺少 INTO 子句
#5
str_sql := 'select * from(select s.student_id,rownum as rown from student_info s) where rown between' || pageno*pagesize-pagesize+1 || 'and' || pageno*pagesize;
execute immediate str_sql;
execute immediate str_sql;
#6
可以指定默认值,但是参数的大小是不能指定的,去掉就可以了
#7
.........
#1
create or replace procedure pageset(pageno in number, pagesize in number)
is
pagecount number(3);
recordcount number(5);
begin
select count(*) into recordcount from student_info;
if mod(pagecount,pagesize)>0 then
pagecount := recordcount / pagesize +1;
else
pagecount := recordcount / pagesize;
end if;
if pageno <1 then
pageno := 1;
end if;
if pageno > pagecount then
pageno := pagecount;
end if;
select * from
(
select s.student_id,rownum as rown from student_info s
) where rown between pageno*pagesize-pagesize+1 and pageno*pagesize;
end pageset;
存储过程in传入的参数不能复制啊。
你想完成什么样需求呢?
is
pagecount number(3);
recordcount number(5);
begin
select count(*) into recordcount from student_info;
if mod(pagecount,pagesize)>0 then
pagecount := recordcount / pagesize +1;
else
pagecount := recordcount / pagesize;
end if;
if pageno <1 then
pageno := 1;
end if;
if pageno > pagecount then
pageno := pagecount;
end if;
select * from
(
select s.student_id,rownum as rown from student_info s
) where rown between pageno*pagesize-pagesize+1 and pageno*pagesize;
end pageset;
存储过程in传入的参数不能复制啊。
你想完成什么样需求呢?
#2
只指定参数类型就行,不用指定大小,入参可以省略in。
改为
你加:=1是想赋个初始值?
改为
create or replace procedure pageset(pageno number, pagesize number)
你加:=1是想赋个初始值?
#3
存储过程in传入的参数不能复制啊
我想做的是一个分页的过程
我想做的是一个分页的过程
#4
现在我用in out可以赋值
但是
select * from
(
select s.student_id,rownum as rown from student_info s
) where rown between pageno*pagesize-pagesize+1 and pageno*pagesize;
这一句提示
PROCEDURE IGHACK.PAGESET 编译错误
错误:PLS-00428: 在此 SELECT 语句中缺少 INTO 子句
但是
select * from
(
select s.student_id,rownum as rown from student_info s
) where rown between pageno*pagesize-pagesize+1 and pageno*pagesize;
这一句提示
PROCEDURE IGHACK.PAGESET 编译错误
错误:PLS-00428: 在此 SELECT 语句中缺少 INTO 子句
#5
str_sql := 'select * from(select s.student_id,rownum as rown from student_info s) where rown between' || pageno*pagesize-pagesize+1 || 'and' || pageno*pagesize;
execute immediate str_sql;
execute immediate str_sql;
#6
可以指定默认值,但是参数的大小是不能指定的,去掉就可以了
#7
.........