24小时热门版块排行榜    

查看: 595  |  回复: 1

renyan198251

木虫 (小有名气)


[交流] 【求助】求编程

一个图书销售数据库 BookShopDB,
里面有图书信息BookInfo表(BookID,BookName,Author,ISBN,PublishDate,PublisherID,CategoryID,Price,Content)、图书类别表Category(CategoryID,CategoryName)、出版社表Publisher(PublisherID,PublisherName)、销售明细表Sales(SalesID,BookID,Quantity,SalesDate,Discount,Price,SalesPrice,Userid)、用户表Userinfo(UserID,UserName,Sex)
求编写一个SQL语言:“设计一个存储过程,采用模糊查询方式查找指定出版社书籍信息”
谢谢!
回复此楼

» 猜你喜欢

» 本主题相关价值贴推荐,对您同样有帮助:

» 抢金币啦!回帖就可以得到:

查看全部散金贴

已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

xqwbx163

银虫 (小有名气)



小木虫(金币+0.5):给个红包,谢谢回帖
renyan198251(金币+10): 多谢了。 2011-04-28 17:33:14
这是写存储过程的一个例子,你可以仿造这个写写
create or replace procedure p_score799
is
Cursor cursor1 is select score_code,busi_code,op_cfg,income_cfg,begin_ymd,end_ymd,score_type from temp799;
score_code1 varchar2(8);
busi_code1 varchar2(64);
  op_cfg1 NUMBER(12,2);
  income_cfg1 NUMBER(18,8);
i NUMBER(4);
p_SiteID number(10);
begin_ymd1 varchar2(125);
end_ymd1 varchar2(125);
score_type1 varchar2(4);
begin
open cursor1;
loop
fetch cursor1 into score_code1,busi_code1,op_cfg1,income_cfg1,begin_ymd1,end_ymd1,score_type1;
select count(*) INTO i FROM cScoreCodeCfg t WHERE t.region_code = '799' and t.busi_code=busi_code1;
            IF i=0 THEN


begin
exit when cursor1%notfound;
select opacceptid.Nextval INTO p_SiteID from dual;

insert into cScoreCodeCfg(region_code,score_type,score_code,busi_code,op_cfg,income_cfg,begin_ymd,end_ymd,login_id,op_accept,op_time) values('799',score_type1,score_code1,busi_code1,op_cfg1,income_cfg1,begin_ymd1,end_ymd1,'10000848',p_SiteID,'2010-09-06 15:11:55');
commit;
end;
else
exit when cursor1%notfound;
END IF;


end LOOP;
close cursor1;

end p_score799;
2楼2011-04-28 17:13:33
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖
相关版块跳转 我要订阅楼主 renyan198251 的主题更新
普通表情 高级回复 (可上传附件)
信息提示
请填处理意见