郁闷。一个简单的分页显示的存储过程,怎么一直 编译错误!帮忙给看看啊@_@

wlaptech 2003-09-18 12:11:31
create or replace procedure find_bypage(pages number) is
begin
select * from(select rownum pages,* from book) where pages>(pages-1)
*10 and pages<pages*10;
end;
/
怎么回事?????????
...全文
56 7 打赏 收藏 转发到动态 举报
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
wlaptech 2003-09-18
  • 打赏
  • 举报
回复
还是报错啊,您再帮我看看。
create or replace procedure find_bypage(pages number) is
begin
select * from(select rownum pages,* from book)
where pages between (pages-1)*10+1 to pages*10;
end;
/
SQL> show err;
PROCEDURE FINDBOOKBY_PAGE 出现错误:

LINE/COL ERROR
-------- -----------------------------------------------------------------
3/35 PLS-00103: 出现符号 "*"在需要下列之一时:
(-+modnull<an identifier>
<a double-quoted delimited-identifier><a bind variable>table
avgcountcurrentmaxminpriorsqlstddevsumvarianceexecutethe
foralltimetimestampintervaldate
<a string literal with character set specification>
<a number><a single-quoted SQL string>

3/81 PLS-00103: 出现符号 "TO"在需要下列之一时:
*&-+/atmodrem
<an exponent (**)>and||

LINE/COL ERROR
-------- -----------------------------------------------------------------
符号 "and在 "TO" 继续之前已插入。
nicholaz 2003-09-18
  • 打赏
  • 举报
回复
modify to:

select * from(select rownum pages,* from book)
where pages between (pages-1)*10+1 to pages*10;
nicholaz 2003-09-18
  • 打赏
  • 举报
回复
你的条件永远不能实现。当然会出错。
nicholaz 2003-09-18
  • 打赏
  • 举报
回复
你的过程写错了,兄弟!你选出的又不是一条数据,当然要使用游标了,况且在过程中
select ..... into.....from ....
bzszp 2003-09-18
  • 打赏
  • 举报
回复
语句没有错误
你写的存储过程有问题
为什么要写成存储过程?
wlaptech 2003-09-18
  • 打赏
  • 举报
回复
大侠,求您了。怎么还是抱错啊???
create or replace procedure findbookby_page(pages number) is
begin
select * from(select rownum pages,* from book) where pages between (pages-1)*10+1 and pages*10;
end;
/
警告: 创建的过程带有编译错误。

SQL> show err;
PROCEDURE FINDBOOKBY_PAGE 出现错误:

LINE/COL ERROR
-------- -----------------------------------------------------------------
3/35 PLS-00103: 出现符号 "*"在需要下列之一时:
(-+modnull<an identifier>
<a double-quoted delimited-identifier><a bind variable>table
avgcountcurrentmaxminpriorsqlstddevsumvarianceexecutethe
foralltimetimestampintervaldate
<a string literal with character set specification>
<a number><a single-quoted SQL string>
nicholaz 2003-09-18
  • 打赏
  • 举报
回复
哦!写错了,是between ... and .....

select * from (select rownum pages,* from book)
where pages between (pages-1)*10+1 and pages*10;

3,499

社区成员

发帖
与我相关
我的任务
社区描述
Oracle 高级技术相关讨论专区
社区管理员
  • 高级技术社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧