2012-04-11 56 views
1

我試圖使用Oracle 10g創建一個圖書館系統(學校工作),但我被困在創造簡單APEX報表和表單,錯誤消息說:無法創建的Oracle APEX應用程序錯誤ORA-20001

ORA-20001:無法創建模塊。 ORA-20001:創建頁面錯誤。 ORA-20001:無法創建表單頁面。 ORA-20001:錯誤頁面= 8 item =「P8_BRANCHID」id =「」ORA-20001:Error page = 8 item =「P8_BRANCHID」 id =「」與現有的應用程序級別項目具有相同的名稱。 ORA-0000: 正常,成功完成

無法創建應用程序。

這是我的架構,萬一我做錯了什麼:

create table publisher(
PublisherName varchar2(30) not null, 
Address varchar2(30) not null, 
Phone number(20), 
constraint publisher_pk primary key (PublisherName) 
); 

create table book(
BookId number(4) not null, 
Title varchar2(50) not null, 
PublisherName varchar2(30) not null, 
constraint book_pk primary key (BookId), 
constraint book_fk foreign key (PublisherName) 
references publisher (PublisherName) 
); 

create table bookauthors(
BookId number(4) not null, 
AuthorName varchar2(30) not null, 
constraint bookauthors_pk primary key (BookId,AuthorName), 
constraint bookauthors_fk foreign key (BookId) references book (BookId) 
); 

create table librarybranch(
BranchId number(4) not null, 
BranchName varchar2(30) not null, 
Address varchar2(30) not null, 
constraint librarybranch_pk primary key (BranchId) 
); 

create table borrower(
CardNo number(4) not null, 
BName varchar2(30) not null, 
Address varchar2(30) not null, 
Phone number(20) not null, 
constraint borrower_pk primary key (CardNo) 
); 

create table bookcopies(
BookId number(4) not null, 
BranchId number(4) not null, 
No_Of_Copies number(4) not null, 
constraint bookcopies_pk primary key (BookId,BranchId), 
constraint bookcopies_fk foreign key (BookId) references book (BookId), 
constraint bookcopies2_fk foreign key (BranchId) references librarybranch (BranchId) 
); 

create table bookloans(
BookId number(4) not null, 
BranchId number(4) not null, 
CardNo number(4) not null, 
DateOut date, 
DueDate date, 
constraint bookloans_pk primary key (BookId,BranchId,CardNo), 
constraint bookloans_fk foreign key (BookId) references book (BookId), 
constraint bookloans2_fk foreign key (BranchId) references librarybranch (BranchId), 
constraint bookloans3_fk foreign key (CardNo) references borrower (CardNo) 
); 

感謝。

+0

與您的問題無關,但我認爲'bookloans'表格需要一些調整。應該將FKs 1和2合併爲一個:'約束bookloans_fk外鍵(BookId,BranchId)引用librarybranch(BookId,BranchId)' – 2012-04-11 20:26:29

+0

您還可以添加一個Check約束,即DateOut 2012-04-11 20:29:30

+0

一種強制圖書館沒有借出只有3份副本的書籍的4份(或100份)副本的方法。 (這比對模式進行簡單更改要困難) – 2012-04-11 20:30:57

回答

2

我不認爲你的模式有什麼問題;此錯誤ORA-20001是Apex應用程序引發的自定義應用程序錯誤,而不是數據庫。我會以面值:...Error page=8 item="P8_BRANCHID" id="" has same name as existing application-level item。看起來您的第8頁有一個名爲P8_BRANCHID的頁面項目,但在應用程序項目中也可能會有類似的項目。去你的申請項目,看看你是否有一個相同的名字。

+0

我將如何去申請項目? – J4RG0N 2012-04-12 01:31:36

+0

@ J4RG0N從您的Apex應用程序中,轉到共享組件,然後轉到應用程序項目。 – Wolf 2012-04-12 02:56:37