




版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進(jìn)行舉報或認(rèn)領(lǐng)
文檔簡介
1、 程序設(shè)計實踐課程設(shè)計報告學(xué) 院 計通學(xué)院 專 業(yè) 計算機(jī)科學(xué)與技術(shù) 班 級 學(xué) 號 學(xué)生姓名 指導(dǎo)教師 課程成績 完成日期 2006年9月20號圖書館管理系統(tǒng)數(shù)據(jù)庫分析與設(shè)計摘要: 圖書信息管理系統(tǒng)主要由讀者信息管理模塊,圖書信息管理模塊,借閱信息管理模塊,系統(tǒng)信息管理模塊等組成。其中又各自分成讀者注冊,證件修改,用戶注銷,圖書查詢,操作記錄等子模塊。在設(shè)計本系統(tǒng)過程中,我們第一步由自頂而下的需求分析概括設(shè)計出系統(tǒng)總模塊的數(shù)據(jù)流圖,再設(shè)計個子模塊的相應(yīng)數(shù)據(jù)流圖,列出數(shù)據(jù)流信息及數(shù)據(jù)字典;第二步概念設(shè)計在需求分析基礎(chǔ)上用e-r圖表示出數(shù)據(jù)及相互間聯(lián)系,采用先作子圖,再合并成初步e-r圖,進(jìn)行修
2、改和重構(gòu)后得到基本e-r圖;第三步邏輯設(shè)計,在sql server的設(shè)計環(huán)境下把圖書館管理系統(tǒng)e-r圖轉(zhuǎn)化為成邏輯數(shù)據(jù)模型表示的邏輯模式,同時實現(xiàn)數(shù)據(jù)模型的優(yōu)化和數(shù)據(jù)模式的規(guī)范化;第四步進(jìn)行物理設(shè)計設(shè)計數(shù)據(jù)的內(nèi)模式,確定數(shù)據(jù)的存儲結(jié)構(gòu),存取路徑,存儲空間分配等等,具體形式為表,視圖,索引的建立。關(guān)鍵字:數(shù)據(jù)庫,sql語言,ms sql server,圖書管理abstract:the books information management system mainly by the reader information management module, the books informati
3、on management module, borrows the information management module, the system information management module and so on is composed.respectively divides into the reader registration, the credential revises, the user cancels, books inquiry, operating record small steelyard module. in designs in this syst
4、em process, we first step by from go against but the under demand analysis summary to design the system total module the data stream chart, the re-engineering stature module corresponding data stream chart, lists the data stream information and the data dictionary;the second step of conceptual desig
5、n expressed in the demand analysis foundation with the e-r chart the data and mutually relates, uses first is the child to attempt, then merges the preliminary e-r chart, after carries on the revision and the heavy construction obtains basic e-r; the third step of logical design, transforms in under
6、 the sql server design environment the library management system e-r chart for becomes the logic data model expression the logical pattern, simultaneously realizes the data model optimization and the data pattern standard is deficient; fourth step carries on the physical design design data in patter
7、n, the specified data memory structure, the access path, storage space assignment and so on, the concrete form is the table, the view, the index constructskeywords:database,sql language,ms sql server, books management1 需求分析用戶的需求具體體現(xiàn)在各種信息的提供、保存、更新和查詢,這就要求數(shù)據(jù)庫結(jié)構(gòu)能充分滿足各種信息的輸入和輸出。收集基本數(shù)據(jù),數(shù)據(jù)結(jié)構(gòu)以及數(shù)據(jù)處理的流程,為后面的
8、具體設(shè)計打下基礎(chǔ)。在仔細(xì)分析調(diào)查有關(guān)圖書館管理信息需求的基礎(chǔ)上,我們主要考慮以下幾個方面的需求:1) 用戶需求:圖書用戶要求計算機(jī)系統(tǒng)和sql server所工作的范圍;2) 應(yīng)用資源:數(shù)據(jù)庫應(yīng)用的平臺包括物理平臺和圖書等;3) 應(yīng)用質(zhì)量和可靠性要求:包括操作人員素質(zhì)和系統(tǒng)的糾錯能力等1.1 項目名稱: 圖書館信息管理系統(tǒng)1.2 項目背景和內(nèi)容概要對圖書館管理信息系統(tǒng)進(jìn)行詳細(xì)地分析后,我們將系統(tǒng)分為以下幾個模塊:借閱管理模塊、借書證信息管理模塊、圖書信息管理模塊、系統(tǒng)管理模塊。其主要功能如下:l 借閱管理模塊主要功能如下:1).可以為讀者辦理,修改,注銷借書證,輸入讀者借書證基本信息等,定制讀
9、者的借閱權(quán)限。2).可以通過借書證查詢圖書信息、借出圖書信息,借閱圖書。3).通過借書證還書,管理員可以通過對借閱信息的管理對到期還未還的書,通過查詢讀者的借書證信息查詢讀者聯(lián)系方式發(fā)出催還通知。l 借書證信息管理模塊主要功能如下:1).讀者基本信息的輸入,如:讀者姓名、性別、單位等。2).讀者信息的修改、注銷等功能。3).添加新的讀者及其信息等。l 圖書信息管理模塊主要功能如下:1).定制書籍的各種信息管理,如:書名、作者、出版信息等。2).書籍信息的修改,新圖書的入庫管理和圖書的注銷等。l 系統(tǒng)管理模塊主要功能如下:1).用戶登錄。2).修改密碼。3).添加用戶。l 系統(tǒng)備份和數(shù)據(jù)傳輸模塊
10、主要功能如下:1).備份數(shù)據(jù)庫數(shù)據(jù)2).恢復(fù)數(shù)據(jù)庫數(shù)據(jù)3).網(wǎng)絡(luò)數(shù)據(jù)傳輸13 數(shù)據(jù)流圖l 數(shù)據(jù)流總體圖示圖1-1 數(shù)據(jù)流總體圖l 辦理借書證圖1-2 輸借書證流圖l 借書證修改圖1-3 借書證修改流圖l 借書證注銷圖1-4借書證注銷流圖l 借書系統(tǒng)不能借書的原因圖1-5借書系統(tǒng)流圖l 檢索系統(tǒng)圖1-6 檢索系統(tǒng)流圖l 還書系統(tǒng)圖1-7 還書系統(tǒng)流圖l 圖書檔案管理系統(tǒng)圖1-8 檔案管理流圖1.4 數(shù)據(jù)字典 參數(shù)名類型長度取值范圍別名意義圖書書名字符型11sm圖書編號字符型11b1050600000-b1050610000sh作者字符型10yz出版社字符型20cbs單價數(shù)值型8dj借出日期日期型
11、yy-mm-ddjs還書日期日期型yy-mm-ddhs借書證號字符型100501000000-0501100000jsz姓名字符型20name是否歸還字符型20yn性別字符型2sex單位字符型20dw發(fā)證日期日期型yy-mm-ddfz已借書冊數(shù)字符型2ync是否允許借書字符型2yns是或否類別字符型20lb進(jìn)冊數(shù)數(shù)值型10jc庫存量數(shù)值型10cz操作員編號數(shù)值型10cb操作員姓名字符型10cname操作員密碼 字符型15mm表1數(shù)據(jù)字典2 概念結(jié)構(gòu)設(shè)計這一階段我們將客戶的應(yīng)用需求抽象為信息世界的結(jié)構(gòu),即對系統(tǒng)的人、物、事和概念進(jìn)行人為處理,抽取人們所關(guān)心的共同特性,同時把這些特性用概念精確的描
12、述。我們首先根據(jù)需求分析的結(jié)果(數(shù)據(jù)流圖、數(shù)據(jù)字典等)對現(xiàn)實世界的數(shù)據(jù)進(jìn)行抽象,設(shè)計各個局部e-r圖,然后合并成初步e-r圖,再進(jìn)行修改與重構(gòu)。2.1局部e-r圖圖書信息管理系統(tǒng)主要分為以下幾個局部e-r圖:1).借書證處理系統(tǒng)er圖:管理員辦證改證銷證讀者檔案借書證身份驗證身份驗證身份驗證1ppnmnmp1p圖2-1 借書證處理系統(tǒng)er圖圖中各實體屬性如下:讀者檔案:學(xué)號,讀者姓名,性別,出生日期,借書證號,職業(yè),單位,通訊地址,郵政編碼,聯(lián)系電話借書證:借書證號,姓名,性別,辦證日期,借閱范圍,最大借書量,照片,身份證號管理員:管理員編號,管理員姓名,登陸密碼2).借書系統(tǒng)er圖:讀者借書
13、證庫存表借出信息驗證查詢借書檢查庫存索書條111n1nn圖2-2借書系統(tǒng)er圖圖中各實體屬性如下:讀者:身份證號,讀者姓名,借書證號借書證:借書證號,姓名,性別,辦證日期(借閱范圍,最大借書量,照片,身份證號)庫存信息:書號,圖書編號借出信息:圖書編號,借書證號,借書日期,歸還日期3).索書系統(tǒng)er圖:讀者圖書檔案索書要求索書mn索書條圖2-3索書系統(tǒng)er圖圖中各實體屬性如下:讀者:讀者姓名,借書證號圖書檔案:圖書編號,書號,書名,作者,出版單位,出版日期,單價,藏書冊書,類別,入庫日期4).還書系統(tǒng)er圖:驗證還書催還完整檢查讀者借書證庫存表借出信息管理員是否歸還1n1mmn1m1p圖2-4
14、 還書系統(tǒng)er圖圖中各實體屬性如下:讀者:學(xué)號,讀者姓名,借書證號借書證:借書證號,姓名,性別,辦證日期庫存信息:書號,圖書編號借出信息:圖書編號,借書證號,借書日期,歸還日期管理員:操作員編號,管理員姓名,登陸密碼5)圖書檔案管理系統(tǒng)er圖:管理員修改輸入注銷圖書檔案庫存身份驗證身份驗證身份驗證1n1nn1nnnn入庫清單圖2-5 檔案管理系統(tǒng)er圖圖中各實體屬性如下:管理員:操作員編號,管理員姓名,登陸密碼庫存信息:書號,圖書編號圖書檔案:圖書編號,書號,書名,作者,出版單位,出版日期,單價,類別,入庫日期入庫清單:入庫日期,圖書編號,管理員編號,書名6). 整體e-r圖讀者圖書檔案借出書
15、庫庫存表管理員借書證圖書管理證件處理催還借書還書查詢已借索書ppm1mn11mnppmnnpmnn1n圖2-6 整體er圖圖中各實體屬性如下:讀者檔案:學(xué)號,讀者姓名,性別,借書證號,單位借書證:借書證號,姓名,性別,辦證日期管理員:操作員編號,管理員姓名,登陸密碼庫存信息:書號,圖書編號借出信息:圖書編號,借書證號,借書日期,歸還日期圖書檔案:書號,書名,作者,出版單位,出版日期,單價,類別,藏書冊書,圖書編號入庫日期2.2 實體描述說明:1、由于讀者的信息可以在借書證辦理檔案中查到所以合并為借書證辦理檔案 2. 將借出書庫和入庫清單分別合并到了借書登記表和圖書信息表中實體名稱借書證數(shù)據(jù)庫表
16、借書證信息表實體說明讀者和借書證信息實體屬性列表借書證號,姓名,性別,辦證日期,最大借書量,學(xué)號實體名稱管理員數(shù)據(jù)庫表tz_passwd實體說明管理員的信息實體屬性列表管理員編號,管理員姓名,登陸密碼實體名稱讀者數(shù)據(jù)庫表借書登記表實體說明圖書館未被借出的圖書信息實體屬性列表書號,圖書編號實體名稱讀者數(shù)據(jù)庫表還書登記表實體說明圖書館未被借出的圖書信息實體屬性列表書號,圖書編號實體名稱圖書檔案數(shù)據(jù)庫表圖書信息表實體說明館藏圖書信息實體屬性列表書號,書名,作者,出版單位,出版日期,版次,單價,類別,圖書編號,入庫日期表2 實體描述2.3 關(guān)系描述 (已包含在e-r圖中)2.4 實體-關(guān)系調(diào)整 (實體
17、描述表中已消除冗余實體和關(guān)系)2.5 數(shù)據(jù)項定義1)圖書庫的數(shù)據(jù)項定義:名稱別名類型長度其他圖書書名sm字符型20普通索引書號sh數(shù)值型20主索引譯者yz字符型10出版社cbs字符型20單價dj數(shù)值型8出版時間cbsj日期型8表3 圖書庫數(shù)據(jù)項定義2)借、還書庫的數(shù)據(jù)項定義:名稱別名類型長度其他姓名xsxm字符型10普通索引借書證號jszh數(shù)值型8主索引圖書書名sm字符型20圖書編號sh字符型20借書日期jsrq日期型8還書日期hsrq日期型8表4借、還書庫數(shù)據(jù)項定義3)借書證庫的數(shù)據(jù)項定義:名稱別名類型長度其他姓名jsxm字符型10普通索引借書證號jsgh字符型6主索引性別xb字符型4單位d
18、w字符型8表5借書證庫數(shù)據(jù)項定義4)操作員庫的數(shù)據(jù)項定義:名稱別名類型長度其他操作員編號czyyhh字符型10操作員用戶名czyyhm字符型10口令kl字符型10表6操作員庫數(shù)據(jù)項定義2.6數(shù)據(jù)表(庫)描述圖書數(shù)據(jù)庫=圖書書名+圖書編號+著者+出版社+單價+書號+出版時間借書庫=姓名+借書證號+教師姓名+圖書名稱+借書日期+還書日期教師數(shù)據(jù)庫=姓名+借書證號+單位操作員庫=操作員用戶名+口令2.7 系統(tǒng)功能模塊圖軟件功能結(jié)構(gòu)圖:工商學(xué)院圖書信息管理系統(tǒng)系統(tǒng)管理基本情況錄入借、還書管理查詢、統(tǒng)計初始化數(shù)據(jù)備份操作員管理一般用戶登陸新圖書登記新期刊登記借書登記還書登記圖書庫藏查詢借書證庫查詢圖書查
19、詢借書查詢還書查詢圖2-7 軟件功能結(jié)構(gòu)2.8 系統(tǒng)流程圖:圖書管理系統(tǒng)讀者查詢系統(tǒng)圖書(期刊)庫查詢圖2-8 系統(tǒng)流程圖3 邏輯結(jié)構(gòu)設(shè)計為了能夠用計算機(jī)和sql server實現(xiàn)用戶需求,可將概念結(jié)構(gòu)轉(zhuǎn)化為相應(yīng)的數(shù)據(jù)模型,即是設(shè)計邏輯結(jié)構(gòu)。即由er圖建立了適當(dāng)?shù)谋?,并按不同的范式的定義,對表進(jìn)行規(guī)范化。對規(guī)范化的表,更據(jù)用戶需求建立數(shù)據(jù)庫結(jié)構(gòu)。3.1 確定數(shù)據(jù)依賴關(guān)系名主 要 函 數(shù) 依 賴管理員 bcnf管理員編號(管理員姓名,登陸密碼)庫存信息bcnf 圖書編號書名等借出信息bcnf(圖書編號)(借書日期,借書證號,歸還日期)借書證2nf借書證號(借書證號,姓名,性別,單位,發(fā)證日期,已
20、借書冊書,是否容許借書)以后擴(kuò)展:身份證號(姓名,性別,照片)圖書檔案2nf圖書編號(書號,書名,作者,出版單位,出版日期,版次,單價,內(nèi)容提要,分類號,索書號,所在書庫,入庫日期)入庫清單bcnf圖書編號(管理員編號,書名,入庫日期)還書信息bcnf借書證號(姓名,圖書編號,書名,借出日期,還書日期)3.2 數(shù)據(jù)依賴的優(yōu)化與調(diào)整3.2.1關(guān)系模式的優(yōu)化 (1) 借書證信息:借書證 (借書證號,姓名,性別,單位,發(fā)證日期,已借書冊書,是否容許借書) 滿足 bcnf范式(2) 管理員信息:管理員信息(管理員編號,管理員姓名,登陸密碼)滿足 bcnf 范式(3) 庫存信息:庫存信息(圖書編號,書號
21、) 滿足bcnf 范式(4) 借書信息:借書信息(圖書編號,借書證號,姓名,書名,借書日期,是否歸還)滿足 bcnf 范式(5) 還書信息:還書信息(姓名,圖書編號,書名,借出日期,還書日期)滿足 bcnf 范式(6) 圖書信息:圖書檔案(圖書編號,書名,作者,圖書類別,單價,出版社,進(jìn)冊書,庫存量)均滿足 bcnf范式(7) 入庫清單:入庫清單(圖書編號,管理員編號,書名,入庫日期)滿足 bcnf范式3.2.2關(guān)系模式的調(diào)整雖然在關(guān)系模式的優(yōu)化中將各種關(guān)系滿足了bcnf范式的要求,但是對某些數(shù)據(jù)庫的操作卻并沒有簡化,相反導(dǎo)致了數(shù)據(jù)庫查詢等數(shù)據(jù)庫操作的效率低下。于是對借書證信息,和圖書信息作出
22、了以下調(diào)整。(1) 借書證信息:借書證(借書證號,姓名,性別,辦證日期,單位,已借書冊數(shù),借書許可,)(3nf) (2) 圖書信息: 圖書檔案(圖書編號,書名,作者,出版單位,單價,圖書類別,進(jìn)冊數(shù),入庫量) (2nf)4 代碼設(shè)計圖書管理系統(tǒng)部分源代碼圖書外借情況查詢代碼tempstr=allt(thisform.container1.text1.value)tempstr=%+tempstr+%if bo1.text=借書證號select * from 借書登記表 where 借書登記表.借書證號 like tempstr into cursor tempcursorthisform.gr
23、id1.recordsource=tempcursorthisform.refreshendif if bo1.text=姓名select * from 借書登記表 where 借書登記表.姓名 like tempstr into cursor tempcursorthisform.grid1.recordsource=tempcursorthisform.refreshendif if bo1.text=圖書編號select * from 借書登記表 where 借書登記表.圖書編號 like tempstr into cursor tempcursorthisform.grid1.reco
24、rdsource=tempcursorthisform.refreshendif if bo1.text=書名select * from 借書登記表 where 借書登記表.書名 like tempstr into cursor tempcursorthisform.grid1.recordsource=tempcursorthisform.refreshendif if bo1.text=是否歸還select * from 借書登記表 where 借書登記表.是否歸還 like tempstr into cursor tempcursorthisform.grid1.recordsource
25、=tempcursorthisform.refreshendif thisform.container1.text1.value=圖書外借和歸還情況查詢代碼tempstr=allt(thisform.container1.text1.value)tempstr=%+tempstr+%if bo1.text=借書證號select * from 還書登記表 where 還書登記表.借書證號 like tempstr into cursor tempcursorthisform.grid1.recordsource=tempcursorthisform.refreshendif if bo1.tex
26、t=姓名select * from 還書登記表 where 還書登記表.姓名 like tempstr into cursor tempcursorthisform.grid1.recordsource=tempcursorthisform.refreshendif if bo1.text=圖書編號select * from 還書登記表 where 還書登記表.圖書編號 like tempstr into cursor tempcursorthisform.grid1.recordsource=tempcursorthisform.refreshendif if bo1.text=書名sele
27、ct * from 還書登記表 where 還書登記表.書名 like tempstr into cursor tempcursorthisform.grid1.recordsource=tempcursorthisform.refreshendif thisform.container1.text1.value=存儲過程代碼procedure rideletelocal llretvalllretval=.t. if (isrlocked() and !deleted() or !rlock() llretval=.f. else if !deleted() delete if cursor
28、getprop(buffering) 1 =tableupdate() endif llretval=pnerror=0 endif not already deleted endif unlock record (recno()return llretvalprocedure riupdatelparameters tcfieldname,tcnewvalue,tccascadeparentlocal llretvalllretval=.t. if isrlocked() or !rlock() llretval=.f. else if eval(tcfieldname)tcnewvalue
29、 private pccascadeparent pccascadeparent=upper(iif(type(tccascadeparent)c,tccascadeparent) replace (tcfieldname) with tcnewvalue if cursorgetprop(buffering) 1 =tableupdate() endif llretval=pnerror=0 endif values dont already match endif its locked already, or i was able to lock it unlock record (rec
30、no()return llretvalprocedure rierrorparameters tnerrno,tcmessage,tccode,tcprogramlocal lnerrorrows,lnxxlnerrorrows=alen(gaerrors,1)if type(gaerrorslnerrorrows,1)l dimension gaerrorslnerrorrows+1,alen(gaerrors,2) lnerrorrows=lnerrorrows+1endifgaerrorslnerrorrows,1=tnerrnogaerrorslnerrorrows,2=tcmessa
31、gegaerrorslnerrorrows,3=tccodegaerrorslnerrorrows,4=lnxx=1do while !empty(program(lnxx) gaerrorslnerrorrows,4=gaerrorslnerrorrows,4+,+; program(lnxx) lnxx=lnxx+1enddogaerrorslnerrorrows,5=pcparentdbfgaerrorslnerrorrows,6=pnparentrecgaerrorslnerrorrows,7=pcparentidgaerrorslnerrorrows,8=pcparentexprga
32、errorslnerrorrows,9=pcchilddbfgaerrorslnerrorrows,10=pnchildrecgaerrorslnerrorrows,11=pcchildidgaerrorslnerrorrows,12=pcchildexprreturn tnerrnoprocedure riopenparameters tctable,tcorderlocal lccurwkarea,lcnewwkarea,lninusespotlninusespot=atc(tctable+*,pcricursors)if lninusespot=0 lccurwkarea=select(
33、) select 0 lcnewwkarea=select() if not empty(tcorder) use (tctable) again order (tcorder) ; alias (_ri+ltrim(str(select() share else use (tctable) again alias (_ri+ltrim(str(select() share endif if pnerror=0 pcricursors=pcricursors+upper(tctable)+?+str(select(),5) else lcnewwkarea=0 endif something
34、bad happened while attempting to open the fileelse lcnewwkarea=val(substr(pcricursors,lninusespot+len(tctable)+1,5) pcricursors = strtran(pcricursors,upper(tctable)+*+str(lcnewwkarea,5),; upper(tctable)+?+str(lcnewwkarea,5) if not empty(tcorder) set order to (tcorder) in (lcnewwkarea) endif sent an
35、order if pnerror0 lcnewwkarea=0 endif something bad happened while setting orderendifreturn (lcnewwkarea)procedure riendparameters tlsuccesslocal lnxx,lnspot,lcworkareaif tlsuccess end transactionelse set deleted off rollback set deleted onendifif empty(pcriolderror) on errorelse on error &pcriolder
36、ror.endiffor lnxx=1 to occurs(*,pcricursors) lnspot=atc(*,pcricursors,lnxx)+1 use in (val(substr(pcricursors,lnspot,5)endforif pcoldcompat = onset compatible onendifif pcolddele=off set deleted offendifif pcoldexact=on set exact onendifif pcoldtalk=on set talk onendifdo case case empty(pcolddbc) set
37、 data to case pcolddbcdbc() set data to (pcolddbc)endcasereturn .t.procedure rireuse* rireuse.prgparameters tctablename,tcwkareapcricursors = strtran(pcricursors,upper(tctablename)+?+str(tcwkarea,5),; upper(tctablename)+*+str(tcwkarea,5)return .t.* 參照完整性刪除觸發(fā)器 借書證信息表procedure _ri_delete_借書證信息表local l
38、lretvalllretval = .t.private pcparentdbf,pnparentrec,pcchilddbf,pnchildrec,pcparentid,pcchildidprivate pcparentexpr,pcchildexprstore to pcparentdbf,pcchilddbf,pcparentid,pcchildid,pcparentexpr,pcchildexprstore 0 to pnparentrec,pnchildrecif _triggerlevel=1 begin transaction private pcricursors,pcriwk
39、areas,pcriolderror,pnerror,; pcolddele,pcoldexact,pcoldtalk,pcoldcompat,pcolddbc pcoldtalk=set(talk) set talk off pcolddele=set(deleted) pcoldexact=set(exact) pcoldcompat=set(compatible) set compatible off set deleted on set exact off pcricursors= pcriwkareas= pcriolderror=on(error) pnerror=0 on err
40、or pnerror=rierror(error(),message(),message(1),program() if type(gaerrors(1)u release gaerrors endif public gaerrors(1,12) pcolddbc=dbc() set data to (tsglxt)endif first triggerlocal lcparentid & parents value to be sought in childlocal lcchildwkarea & child work area handle returned by riopenlocal
41、 lcparentwkarealocal lldelheaderarealcstartarea=select()llretval=.t.lcparentwkarea=select()select (lcparentwkarea)pcparentdbf=dbf()pnparentrec=recno()store 借書證號 to lcparentid,pcparentidpcparentexpr=借書證號lcchildwkarea=riopen(還書登記表,借書證號)if lcchildwkarea=0 if _triggerlevel=1 do riend with .f. endif at t
42、he end of the highest trigger level return .f.endif not able to open the child work areapcchilddbf=dbf(lcchildwkarea)llretval=!seek(lcparentid,lcchildwkarea)select (lcchildwkarea)pnchildrec=recno()pcchildid=借書證號pcchildexpr=借書證號if !llretval do rierror with -1,違反刪除限制規(guī)則。,endif=rireuse(還書登記表,lcchildwkar
43、ea)if not llretval if _triggerlevel=1 do riend with llretval endif at the end of the highest trigger level select (lcstartarea) return llretvalendifif _triggerlevel=1 do riend with llretvalendif at the end of the highest trigger levelselect (lcstartarea)return llretval* 結(jié)束參照完整性刪除觸發(fā)器 借書證信息表*procedure
44、 _ri_update_借書證信息表* 參照完整性更新觸發(fā)器 借書證信息表local llretvalllretval = .t.private pcparentdbf,pnparentrec,pcchilddbf,pnchildrec,pcparentid,pcchildidprivate pcparentexpr,pcchildexprstore to pcparentdbf,pcchilddbf,pcparentid,pcchildid,pcparentexpr,pcchildexprstore 0 to pnparentrec,pnchildrecif _triggerlevel=1
45、begin transaction private pcricursors,pcriwkareas,pcriolderror,pnerror,; pcolddele,pcoldexact,pcoldtalk,pcoldcompat,pcolddbc pcoldtalk=set(talk) set talk off pcolddele=set(deleted) pcoldexact=set(exact) pcoldcompat=set(compatible) set compatible off set deleted on set exact off pcricursors= pcriwkar
46、eas= pcriolderror=on(error) pnerror=0 on error pnerror=rierror(error(),message(),message(1),program() if type(gaerrors(1)u release gaerrors endif public gaerrors(1,12) pcolddbc=dbc() set data to (tsglxt)endif first triggerlocal lcparentid & parents value to be sought in childlocal lcoldparentid & pr
47、evious parent id valuelocal lcchildwkarea & child work area handle returned by riopenlocal lcchildid & childs value to be sought in parentlocal lcoldchildid & old child id valuelocal lcparentwkarea & parentwork area handle returned by riopenlocal lcstartarealcstartarea=select()llretval=.t.lcparentwk
48、area=select()select (lcparentwkarea)pcparentdbf=dbf()pnparentrec=recno()lcoldparentid=oldval(借書證號)pcparentid=lcoldparentidpcparentexpr=借書證號lcparentid=借書證號if lcparentidlcoldparentid lcchildwkarea=riopen(還書登記表) if lcchildwkarea=0 if _triggerlevel=1 do riend with .f. endif at the end of the highest tri
49、gger level select (lcstartarea) return .f. endif not able to open the child work area pcchilddbf=dbf(lcchildwkarea) select (lcchildwkarea) scan for 借書證號=lcoldparentid pnchildrec=recno() pcchildid=借書證號 pcchildexpr=借書證號 if not llretval exit endif & not llretval llretval=riupdate(借書證號,lcparentid,借書證信息表
50、) endscan get all of the 還書登記表 records =rireuse(還書登記表,lcchildwkarea) if not llretval if _triggerlevel=1 do riend with llretval endif at the end of the highest trigger level select (lcstartarea) return llretval endifendif this parent id changedif _triggerlevel=1 do riend with llretvalendif at the end
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時也不承擔(dān)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 2024年茶藝師(泡茶、品茶、茶藝)等專業(yè)知識試題庫與答案
- 2024年廣告設(shè)計師(制作及創(chuàng)意)等技能知識考試題庫與答案
- 現(xiàn)代密封技術(shù)試題及答案
- 攝影位置基礎(chǔ)知識培訓(xùn)課件
- 2025年設(shè)立中外合資經(jīng)營企業(yè)合同餐飲類
- 2025國內(nèi)留學(xué)中介服務(wù)合同
- 搭一搭二課件
- 公司財務(wù)知識培訓(xùn)課件
- 公司財務(wù)培訓(xùn)法律知識課件
- 晉中教師招聘面試題目研究:行業(yè)動態(tài)與趨勢分析
- 心臟起搏治療與護(hù)理
- 降低產(chǎn)后乳房脹痛發(fā)生率
- NBT 35080-2016 水電站氣墊式調(diào)壓室設(shè)計規(guī)范
- 買房尾款結(jié)清合同范本
- 2024屆貴州省遵義市紅花崗區(qū)小升初數(shù)學(xué)高頻考點檢測卷含解析
- 小學(xué)體育訓(xùn)練記錄表
- 高中政治必刷題 高考真題 必修3《政治與法治》(原卷版)
- 知識題庫-人社勞動知識競賽測試題及答案(十一)
- 2024年四川省南充市道鑫雙語學(xué)校小升初必考題語文檢測卷含答案
- 《政治學(xué)概論》教學(xué)課件(總)
- 2024年昆山國創(chuàng)投資集團(tuán)有限公司招聘筆試參考題庫附帶答案詳解
評論
0/150
提交評論