




免费预览已结束,剩余27页可下载查看
下载本文档
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
图书管理系统 数据库设计报告 文件标识:lms-database 当前版本:1.0 作 者:xxx 文件状态: 草稿 正式发布 正在修改 完成日期:2011-12-24 项目名称, 数据库设计报告 k7yeqs 2011page 2 of 32 版 本 历 史 版本/状态作者参与者起止日期备注 项目名称, 数据库设计报告 k7yeqs 2011page 3 of 32 目目目 录录录 0. 文档介绍文档介绍 4 0.1 文档目的.4 0.2 文档范围.4 0.3 读者对象.4 0.4 参考文献.4 0.5 术语与缩写解释.4 1. 数据库环境说明数据库环境说明 4 2. 数据库的命名规则数据库的命名规则 5 3.概念设计概念设计 6 4. 逻辑设计逻辑设计 6 5.物理模型物理模型 8 5.0 表汇总.8 5.1 表 users.9 5.2 表 userrole9 5.3 表 userrights.10 5.4 表 overlimitrecord.10 5.5 表 lostrecord10 5.6 表 orderrecord.11 5.7 表 borrowrecord.11 5.8 表 book11 5.9 表 liabrary.12 5.10 表 bookcategory12 5.11 表 bookkind13 5.12 表 systemlog13 6. 安全性设计安全性设计 13 6.1 防止用户直接操作数据库的方法.13 6.2 用户帐号密码的加密方法.14 6.3 角色与权限.14 7. 优化优化 14 8. 数据库管理与维护说明数据库管理与维护说明 15 8.1 数据库日常检查 .15 8.2 数据库备份方案.15 9. 数据库对象.16 项目名称, 数据库设计报告 k7yeqs 2011page 4 of 32 0. 文档介绍文档介绍 0.1 文档目的文档目的 本文档为图书管理系统的数据库设计文档,主要介绍系统的数据库设计,给出了系统的 逻辑设计和物理设计,同时给出了数据库环境的说明,确定了数据库命名规则,给出了数据 库的优化方案、安全性设计方案和数据库维护、管理等内容,本文档可作为项目开发人员在 数据库实现时的参考和规范。 0.2 文档范围文档范围 本文档适用于项目开发的设计阶段,在项目开发阶段可按照本文档检验数据库的实施情 况。 0.3 读者对象读者对象 1.图书管理系统的开发人员 2.指导老师 3.图书管理系统的测试人员 4.图书管理系统的客户 0.4 参考文献参考文献 【01】王珊 萨师煊, 数据库系统概论 ,高等教育出版社,2006-05-04 0.5 术语与缩写解释术语与缩写解释 缩写、术语缩写、术语解解 释释 spp精简并行过程,simplified parallel process sd系统设计,system design 逻辑设计 把一种计划、规划、设想通过视觉的形式通过概念、判断、推理、论证来理解 和区分客观世界的思维传达出来的活动过程 物理设计设计数据库的物理结构,根据数据库的逻辑结构来选定 rdbms,并设计和实 施数据库的存储结构、存取方式等。 1. 数据库环境说明数据库环境说明 数据库系统:mysql 数据库设计工具:power designer 项目名称, 数据库设计报告 k7yeqs 2011page 5 of 32 编程工具:power designer 详细配置: 2. 数据库的命名规则数据库的命名规则 2.1 数据库涉及字符规则数据库涉及字符规则 采用 26 个英文字母(区分大小写)和 0 9 这十个自然数,加上下划线_组成,共 63 个字符。不能出现其他字符(注释除外) 。 2.2 数据库对象命名规则数据库对象命名规则 数据库对象包括表、视图(查询) 、存储过程(参数查询) 、函数、约束。对象名字由前 缀和实际名字组成,长度不超过 30。 前缀:使用小写字母。如: 表tb 视图vi 存储过程sp 函数fn 实际名字 实际名字尽量描述实体的内容,由单词或单词组合,每个单词的首字母大写,其他字母 小写,不以数字和_开头。因此,合法的对象名字类似如下。 表tbuser_info、tbmessage_detail 视图vi_messagelist 存储过程sp_messageadd 2.3 数据库表命名规则数据库表命名规则 字段由前缀和实际名字组成。实际名字中首单词一个系统尽量采取同一单词。 前缀:使用小写字母 tb,表示表。 例如:tbmember tbmember_info t bforum_board tbforum_thread1 2.4 字段命名规则字段命名规则 数字、字符、日期/时间、lob(大对象)、杂项,字段由表的简称、下划线,实际名字加后 缀组成。 后缀:使用小写字母,代表该字段的属性。 例如: user_idint user_namestr user_regdatedtm 2.5 视图命名规则视图命名规则 字段由前缀和实际名字组成,中间用下划线连接。 前缀:使用小写字母 vi,表示视图。 例如:vi_user vi_userinfo 2.6 存储过程命名规则存储过程命名规则 字段由前缀和实际名字组成,中间用下划线连接。 前缀:使用小写字母 sp,表示存储过程。 例如:sp_user 2.7 sql 语句规则语句规则 项目名称, 数据库设计报告 k7yeqs 2011page 6 of 32 所有 sql 语句的关键词全部大写或首字母大写,比如 select,update,from, order,by 等。 3.概念设计概念设计 4. 逻辑设计逻辑设计 项目名称, 数据库设计报告 k7yeqs 2011page 7 of 32 项目名称, 数据库设计报告 k7yeqs 2011page 8 of 32 5.物理模型物理模型 5.0 表汇总表汇总 表名功能说明 users记录用户的基本信息,包括姓名、性别、单位、联系方式等 userrole记录用户的角色,不同的角色拥有不同的权限 userrights记录图书管理系统中用户可拥有的所有权限 overlimitrecord记录超期的图书借阅记录 lostrecord记录图书遗失的记录 orderrecord记录读者预约图书的情况 borrowrecord记录读者借阅图书的情况 book记录图书的基本信息,包括书名、出版社、页数、是否可借阅等 library记录图书馆分馆的基本情况,包括分馆地址、电话等信息 项目名称, 数据库设计报告 k7yeqs 2011page 9 of 32 bookcategory记录图书的类别及相关属性,划分不同类别可方便用户借阅查找 bookkinds记录图书的种类及相关属性,不同种类的书籍有不同的赔付价格 systemlog记录系统的运行情况 5.1 表表 users 表名users 列名数据类型空/非空约束条件表示含义 useridint 非空主键用户编号 usernamenvchar非空无用户姓名 usernumint非空无用户学号 usersexnvchar(2)可以为空只能是“男“或是“女“用户性别 userroleint非空只能为“用户角色”表中已有项的角色 编号 用户所属角色 userunitnvchar可以为空无用户所在单位 useremailnvchar可以为空格式为“xxxx.xx”用户邮箱 userphonenvchar(11 ) 可以为空位数为 11 位,全部字符为数字用户联系电话 userpswnvchar(12 ) 非空长度至少为 6,最多为 12 位的数字、字 母的组合 用户登录密码 userisborrowint非空无用户是否可借阅 书籍 userborroecntint非空无用户当前可借阅 的书籍数量 补充说明1.userrole 为外键,关联着用户角色表中的角色编号 2.userisborrow 的初始值为 1,当 userborrowcnt 的值为 0 时其值为 0,当用户出现超期 事务未处理时,userisborrow 的值为-1,出现遗失事务未处理时其值-2,当同时有 userborrowcnt 为 0 和超期事务未处理时其值为-3,当同时有 userborrowcnt 为 0 和遗失 事务未处理时其值为-4,当同时有遗失和超期事务未处理时其值为-5,只有当其值为 1 时表示当前可借,否则当前不可借阅。 5.2 表表 userrole 表名userrole 列名数据类型空/非空约束条件表示含义 roleidint非空主键角色编号 rolenamenvchar非空最大为 256 个字符角色名称 roledescribenvchar可以为空无角色描述 roleborrowcntint非空无可借阅书籍的最大数量 项目名称, 数据库设计报告 k7yeqs 2011page 10 of 32 roleborrowdaysint非空无可借阅书籍的最大天数 roleborrowtimesint非空无可续借的次数 rolecontinuedaysint 非空无续借一次可多借阅书籍的天 数 rolerightsint非空只能为权限表中已有 项的编号 角色所拥有的权限 补充说明rolerights 为外键,关联着权限表中的权限编号 5.3 表表 userrights 表名userrights 列名数据类型空/非空约束条件表示含义 rightsidint非空主键权限编号 rightsnamenvchar非空最大为 256 个字符权限名称 rightsdescribenvchar可以为空无权限描述 补充说明无 5.4 表表 overlimitrecord 表名overlimitrecord 列名数据类型空/非空约束条件表示含义 olridint非空主键超期记录编号 olruseridint非空无超期借阅书籍的读者编号 olrbookidint非空无超期被借阅的书籍编号 overdaysint非空无超期天数 isfineboolean非空无是否已经缴纳超期罚款的标识 overcostint非空无超期应缴纳的罚款金额 补充说明olruserid 和 olrbookid 为外键,分别关联用户表中的用户编号和图 书表中的图书编号 5.5 表表 lostrecord 表名lostrecord 列名数据类型空/非空约束条件表示含义 lostrecidint非空主键书籍遗失记录编号 lostrecbookidint非空无遗失的书籍编号 lostrecuseridint非空无遗失书籍的用户编号 lostrecdatedate非空无书籍遗失事务等级日期 lostisfineboolean非空无是否已经缴纳遗失书籍赔付款 lostrebuyboolean非空无是否已经重新购入该书籍 项目名称, 数据库设计报告 k7yeqs 2011page 11 of 32 补充说明lostrecuserid 和 lostrecbookid 为外键,分别关联用户表中的用户编号 和图书表中的图书编号 5.6 表表 orderrecord 表名orderrecord 列名数据类型空/非空约束条件表示含义 orderrecidint非空主键预约图书记录的编号 orderrecbookidint非空无被预约图书的编号 orderrecuseridint非空无预约图书的用户编号 orderrecdatedate非空无预约图书的日期 orderisfinishboolean非空无预约活动是否完成 补充说明orderrecuserid 和 orderrecbookid 为外键,分别关联用户表中的用户 编号和图书表中的图书编号 5.7 表表 borrowrecord 表名orderrecord 列名数据类型空/非空约束条件表示含义 brdint非空主键借阅书籍记录的编号 bruseridint非空无借阅书籍的用户的编号 brbookidint非空无被借阅的书籍的编号 brdatedate非空无借阅书籍的时间 brisbackboolean非空无是否已经归还书籍的标识位 brbackdatedate非空无用户应该归还书籍的最大日期 briscontinueboolean非空无用户是否可以续借书籍 brcontinuetimesint非空无用户还可以续借该书籍的次数 brisoverlimitboolean非空无借阅的书籍是否已经超期 broverlimitfinevnchar可以为空无若书籍超期所应缴纳的超期款 补充说明orderrecuserid 和 orderrecbookid 为外键,分别关联用户表中的用户 编号和图书表中的图书编号 5.8 表表 book 表名book 列名数据类 型 空/非空约束条件表示含义 bookidint非空主键书籍编号 booknamenvchar非空最大长度为 256 个字符书籍名称 bookauthornvchar非空最大长度为 256 个字符书籍的作者名 项目名称, 数据库设计报告 k7yeqs 2011page 12 of 32 isbnidnvchar非空最大长度为 256 个字符书籍的 isbn 码 publishnvchar非空最大长度为 256 个字符书籍的出版社名 publishplacenvchar非空最大长度为 256 个字符书籍的出版地 publishdatedate非空无书籍的出版时间 totalwordsint非空无书籍的总字数 totalpageint非空无书籍的总页数 bookpricenvchar非空无书籍的定价 bookabstructnvchar非空无书籍的内容简介 bookcategoryint非空无书籍的类别 bookindatedate非空无书籍的入库时间 booklibraryint非空无书籍所在的图书分馆 isborrowboolean非空无标识书籍当前是否可借 bookkindint非空无书籍的种类 补充说明1.bookcategory 为外键,关联着图书类别表中的类别编号 2.bookkind 为外键,关联这图书种类表中的种类编号 3.图书类别表示图书的内容的类别,如哲学类,文学类,设置图书类别图 书可以方便用户进行查找和定位,图书的种类表示书籍的种类,如新书、 珍藏版书籍、外文书、中文书,设置图书种类是可能不同种类的书籍在超 期、遗失时的赔付额度不一样,如 1980 年前的书属于珍藏版的书,遗失后 应该按定价的 5 倍赔付等 4.当书籍当前已经被借出或者已经遗失了,则该书籍当前不可借阅 5.书籍作者的最大长度设为 256 是因为可能一本书的作者为多个,名字的 总长度较大 6.isbn 码为图书的分类编码,同样的书籍的 isbn 码应该一样 5.9 表表 liabrary 表名liabrary 列名数据类 型 空/非空约束条件表示含义 liabraryidint非空主键图书分馆编号 libnamnvchar非空最大长度为 256 个字符图书分馆名称 libphonenvchar非空最大长度为 11图书分馆的联系电话 libaddressnvchar非空最大长度为 256 个字符图书分馆的地址 libabstructnvchar非空无图书分馆的简介 补充说明一个图书管理系统可能同时管理位于不同位置的几个图书分馆,所以需要 设置图书分馆表,一本图书也应该属于某一个图书分馆 项目名称, 数据库设计报告 k7yeqs 2011page 13 of 32 5.10 表表 bookcategory 表名bookcategory 列名数据类 型 空/非空约束条件表示含义 categoryidint非空主键图书类别编号 categorynamenvchar非空最大长度为 256 个字 符 图书类别名称 categorydescribenvchar非空无类别的简介 补充说明图书的类别是指图书内容的分类,如哲学类、历史类、计算机类等,将 图书按类别归类可方便用户的查找和借阅 5.11 表表 bookkind 表名bookkind 列名数据类型空/非空约束条件表示含义 kindidint非空主键图书种类编号 kindnamenvchar非空最大长度为 256 个字符图书种类名称 kinddescribenvchar可以为空无图书种类的简介 overlimitcostnvchar非空无图书超期的罚金额度 lostcostnvchar非空无图书遗失的罚金额度 补充说明图书可能会被划分为新书、珍藏版书籍、外文书、中文书等种类,根据种 类的不同书籍的超期、遗失的赔付金额也不同,如外文书遗失需要赔付两 倍定价的金额,而一般的中文书只需按定价赔付等,所以需要划分不同的 书籍种类 5.12 表表 systemlog 表名systemlog 列名数据类型空/非空约束条件表示含义 logidint非空主键系统日志编号 logcontentnvchar非空无系统日志内容 logtimedate 2.数据库版本检查:数据库应该打了最新的 patchset。 sqlselect * from v$version; 3.查看 sga 区域:sga 区各项 buffer 之和应该小于系统物理内存的一半。 sqlshow sga; 4.回滚段竞争检查:如果是 oracle8i 版本返回值应该低于 2%。如果该值过高,8i 需要手工 建立更多的回滚段,如果是 9i,返回值应该为 0,如果持续存在非零值,应该增加回滚表空 间的大小。 8i: sql select the average of waits/gets is |round(sum(waits) / sum(gets) * 100,2)|%from v$rollstat; 9i: sqlselect distinct nospaceerrcnt as nospace from v$undostat where begin_timesysdate-(1/12); 5.查看日志文件:数据库运行时,可以通过查询 v$log_history 来观察 log switch 的切换 时间。联机日志最好是业务非高峰期每小时切换一次,业务高峰期 20 分钟左右切换一次。 sqlselect to_char(first_time,yyyy-mm-dd hh24:mi:ss) change_time from v$log_history; 6.查看表空间:查看各个表空间所占的大小,剩余空间,使用空间百分比等信息,特别是当 业务表空间的剩余空间低于 50m 或者使用空间百分比大于 90%时,需要考虑增加表空间的大 小。 sql select a.tablespace_name,a.bytes totalbytes,sum(b.bytes) freebytes from dba_data_files a,dba_free_space b where a.file_id = b.file_id group by a.tablespace_name, a.bytes ; 7.检查 job 状态:broken 列应该为 n;如果 broken 列为 y,检查 oracle 告警日志,分析 job 失败的原因。解决后运行:exec dbms_job.run(:job); sqlselectjob,what,to_char(next_date,yyyy/mm/ddhh24:mi:ss),broken,failures from dba_jobs; 8.查看数据库连接用户:查看当前数据库连接的用户进程的具体信息,包括连接的数据库用 户名,机器名,运行的程序名,进程状态。 项目名称, 数据库设计报告 k7yeqs 2011page 16 of 32 select username,machine,program,status from v$session where osuser -1 then tmpcondition := tmpcondition | itemid; 项目名称, 数据库设计报告 k7yeqs 2011page 19 of 32 -如果是根据用户的其他属性删除时 else if itemname is not null then tmpcondition := tmpcondition |username = |itemname; end if; if itemnum -1 then if tmpcondition is not null then tmpcondition := tmpcondition | userrole = |itemrole; else tmpcondition := tmpcondition | add userrole = |itemrole; end if; end if; if itemunit is not null then if tmpcondition is not null then tmpcondition := tmpcondition | userunit = |itemunit; else tmpcondition := tmpcondition | add userunit = |itemunit; end if; end if; if itememail is not null then if tmpcondition is not null then tmpcondition := tmpcondition | useremail = |itememail; else tmpcondition := tmpcondition | add useremail = |itememail; end if; 项目名称, 数据库设计报告 k7yeqs 2011page 20 of 32 end if; if itemtel is not null then if tmpcondition is not null then tmpcondition := tmpcondition | usertel = |itemtel; else tmpcondition := tmpcondition | add usertel = |itemtel; end if; end if; if itempsw is not null then if tmpcondition is not null then tmpcondition := tmpcondition | userpsw = |itempsw; else tmpcondition := tmpcondition | add userpsw = |itempsw; end if; end if; if itempsw -1 then if tmpcondition is not null then tmpcondition := tmpcondition | userborrowcnt = |itemborrowcnt; else tmpcondition := tmpcondition | add userborrowcnt = |itemborrowcnt; end if; end if; end if; -执行删除语句 tmpcondition := delete from users where |tmpcondition; execute immediate tmpcondition; delres := 1; commit; exception when no_data_found then delres := sqlerrm; when others then 项目名称, 数据库设计报告 k7yeqs 2011page 21 of 32 delres := sqlerrm; rollback to savepoint sp1; end; 存储过程名称存储过程名称updateonusers 存储过程描述存储过程描述更新记录项的存储过程 参数说明 参数一:需要更新的记录的查找条件,数组记录一次对应用户姓名、学号、 性别、所属角色编号、单位、邮箱和电话、密码 如果不需要某一项作为查找条件时,该项对应位置传入 null 参数二:记录需要更新的数据项,数组记录依次对应用户姓名、学号、性 别、所属角色编号、单位、邮箱和电话、密码 如果不需要更新某一项的值时,该项对应位置传入 null 最后一个参数为更新结果的返回值,成功时返回 1,否则返回出错代码 存储过程实现存储过程实现-创建一个数组类型,用以存储需要修改的记录的值 create or replace type users_arr as varray(11) of varchar2(500); create or replace procedure updateonusers( conditionarr in users_arr, valuearr in users_arr, updateres out integer)is tmpcondition varchar(500); tmpvalue varchar(500); begin savepoint sp1; tmpcondition := null; tmpvalue := null; if conditionarr(0) is not null then tmpcondition := tmpcondition| userid = |conditionarr(0); end if; if valuearr(0) is not null then tmpvalue := tmpvalue| userid = |valuearr(0); end if; if conditionarr(1) is not null then if tmpcondition is not null then tmpcondition := tmpcondition| username = |conditionarr(1); else tmpcondition := tmpcondition| and username = |conditionarr(1); end if; end if; if valuearr(1) is not null then 项目名称, 数据库设计报告 k7yeqs 2011page 22 of 32 if tmpvalue is not null then tmpvalue := tmpvalue| username = |valuearr(1); else tmpvalue := tmpvalue|, username = |valuearr(1); end if; end if; if conditionarr(2) is not null then if tmpcondition is not null then tmpcondition := tmpcondition| usernum = |conditionarr(2); else tmpcondition := tmpcondition| and usernum = |conditionarr(2); end if; end if; if valuearr(2) is not null then if tmpvalue is not null then tmpvalue := tmpvalue| usernum = |valuearr(2); else tmpvalue := tmpvalue|, usernum = |valuearr(2); end if; end if; if conditionarr(3) is not null then if tmpcondition is not null then tmpcondition := tmpcondition| usersex = |conditionarr(3); else tmpcondition := tmpcondition| and usersex = |conditionarr(3); end if; end if; if valuearr(3) is not null then if tmpvalue is not null then tmpvalue := tmpvalue| userrole = |valuearr(3); else tmpvalue := tmpvalue|, userrole = |valuearr(3); end if; end if; if conditionarr(4) is not null then if tmpcondition is not null then tmpcondition := tmpcondition| userrole = |conditionarr(4); else tmpcondition := tmpcondition| and userrole = |conditionarr(4); 项目名称, 数据库设计报告 k7yeqs 2011page 23 of 32 end if; end if; if valuearr(4) is not null then if tmpvalue is not null then tmpvalue := tmpvalue| userrole = |valuearr(4); else tmpvalue := tmpvalue|, userrole = |valuearr(4); end if; end if; if conditionarr(5) is not null then if tmpcondition is not null then tmpcondition := tmpcondition| userunit = |conditionarr(5); else tmpcondition := tmpcondition| and userunit = |conditionarr(5); end if; end if; if valuearr(5) is not null then if tmpvalue is not null then tmpvalue := tmpvalue| userunit = |valuearr(5); else tmpvalue := tmpvalue|, userunit = |valuearr(5); end if; end if; if conditionarr(6) is not null then if tmpcondition is not null then tmpcondition := tmpcondition| useremail = |conditionarr(6); else tmpcondition := tmpcondition| and useremail = |conditionarr(6); end if; end if; if valuearr(6) is not null then if tmpvalue is not null then tmpvalue := tmpvalue| useremail = |valuearr(6); else tmpvalue := tmpvalue|, useremail = |valuearr(6); end if; end if; if conditionarr(7) is not null then if tmpcondition is not null then 项目名称, 数据库设计报告 k7yeqs 2011page 24 of 32 tmpcondition := tmpcondition| usertel = |conditionarr(7); else tmpcondition := tmpcondition| and usertel = |conditionarr(7); end if; end if; if valuearr(7) is not null then if tmpvalue is not null then tmpvalue := tmpvalue| usertel = |valuearr(7); else tmpvalue := tmpvalue|, usertel = |valuearr(7); end if; end if; if conditionarr(8) is not null then if tmpcondition is not null then tmpcondition := tmpcondition| userpsw = |conditionarr(8); else tmpcondition := tmpcondition| and userpsw = |conditionarr(8); end if; end if; if valuearr(8) is not null then if tmpvalue is not null then tmpvalue := tmpvalue| userpsw = |valuearr(8); else tmpvalue := tmpvalue|, userpsw = |valuearr(8); end if; end if; if conditionarr(9) is not null then if tmpcondition is not null then tmpcondition := tmpcondition| userisborrow = |conditionarr(9); else tmpcondition := tmpcondition| and userisborrow = |conditionarr(9); end if; end if; if valuearr(9) is not null then if tmpvalue is not null then tmpvalue := tmpvalue| userisborrow = |valuearr(9); else tmpvalue := tmpvalue|, userisborrow = |valuearr(9); end if; 项目名称, 数据库设计报告 k7yeqs 2011page 25 of 32 end if; if conditionarr(10) is not null then if tmpcondition is not null then tmpcondition := tmpcondition| userborrowcnt = |conditionarr(10); else tmpcondition := tmpcondition| and userborrowcnt = |conditionarr(10); end if; end if; if valuearr(10) is not null then if tmpvalue is not null then tmpvalue := tmpvalue| userborrowcnt = |valuearr(10); else tmpvalue := tmpvalue|, userborrowcnt = |valuearr(10); end if; end if; strvalues := update users set |strvalues|where |strcondition; execute immediate strvalues; updateres := 1; commit; exception when no_data_found then updateres := sqlcode; when others then updateres := sqlcode; rollback to savepoint sp1; end; 存储过程名称存储过程名称searchonusers 存储过程描述存储过程描述查找记录项的存储过程 参数说明 参数一:需要更新的记录的查找条件,数组记录一次对应用户姓名、学号、 性别、所属角色编号、单位、邮箱和电话、密码 如果不需要某一项作为查找条件时,该项对应位置传入 null 参数二:查找返回的结果数组,数组记录依次对应用户姓名、学号、性别、 所属角色编号、单位、邮箱和电话、密码 最后一个参数为查找结果的返回值,成功时返回 1,否则返回出错代码 项目名称, 数据库设计报告 k7yeqs 2011page 26 of 32 存储过程实现存储过程实现create or replace procedure searchonusers( conditionarr in users_arr, valuearr out users_arr, searchres out integer)is tmpcondition varchar(500); begin savepoint sp1; tmpcondition := null; if conditionarr(0) is not null then tmpcondition := tmpcondition | userid = |conditionarr(0); end if; if conditionarr(1) is not null then if tmpcondition is not null then tmpcondition := tmpcondition | username = |conditionarr(1); else tmpcondition := tmpcondition | add username = |conditionarr(1); end if; end if; if conditionarr(2) is not null then if tmpcondition is not null then tmpcondition := tmpcondition | usernum = |conditionarr(2); else tmpcondition := tmpcondition | add usernum = |conditionarr(2); end if; end if; if conditionarr(3) is not null then if tmpcondition is not null then tmpcondition := tmpcondition | usersex = |conditionarr(3); else tmpcondition := tmpcondition | add usersex = |conditionarr(3); end if; end if; if conditionarr(4) is not null then if tmpcondition is not null then tmpcondition := tmpcondition | userrole = |conditionarr(4); else tmpcondition := tmpcondition | add userrole = |conditionarr(4); end if; end if; 项目名称, 数据库设计报告 k7yeqs 2011page 27 of 32 if conditionarr(5) is not null then if tmpcondition is not null then tmpcondition := tmpcondition | userunit = |conditionarr(5); else tmpcondition := tmpcondition | add userunit = |conditionarr(5); end if; end if; if conditionarr(6) is not null then if tmpcondition is not null then tmpcondition := tmpcondition | useremail = |conditionarr(6); else tmpcondition := tmpcondition | add useremail = |conditionarr(6); end if; end if; if conditionarr(7) is not null then if tmpcondition is not null then tmpcondition := tmpcondition | usertel = |conditionarr(7); else tmpcondition := tmpcondition | add usertel = |conditionarr(7); end if; end if; if conditionarr(8) is not null then if tmpcondition is not null then tmpcondition := tmpcondition | userpsw = |conditionarr(8); else tmpcondition := tmpcondition | add userpsw = |conditionarr(8); end if; end if; if conditionarr(9) is not null then if tmpcondition is not null then tmpcondition := tmpcondition | userisborrow = |conditionarr(9); else tmpcondition := tmpcondition | add userisborrow = |conditionarr(9); end if;
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 2025年监狱医学罪犯健康评估模拟考试答案及解析
- 工信局国家安全教育培训课件
- 超星德法23年考试专项测试题有答案
- 衍生品管理暂行办法
- 行业黑名单管理办法
- 梅毒感染器械处理课件
- 乡村振兴人才培育:2025年新型职业农民培养策略研究
- 农业种植合作社生产管理协议
- 2025年大学生国家安全知识竞赛试题及答案
- 市场分析报告生成工具
- 汽修厂污染防治知识培训课件
- 海运销售入门培训
- 租房托管班合同(标准版)
- 2025-2026学年苏教版(2024)小学数学二年级上册(全册)教学设计(附目录P226)
- 2025年甘南事业单位笔试试题(含答案)
- 2025年浪浪山小妖怪开学第一课
- 2025-2026秋学生国旗下演讲稿:第1周让我们接过历史的接力棒-抗战胜利纪念日
- 2025年幼儿园食堂从业人员培训测试题(含答案)
- 企业员工职业道德培训教材及案例
- 施工临时用水用电方案(3篇)
- 工贸行业安全知识培训课件
评论
0/150
提交评论