線上訂房服務-台灣趴趴狗聯合訂房中心
發文 回覆 瀏覽次數:863
推到 Plurk!
推到 Facebook!

My Tables have problem....

尚未結案
tabobomber
一般會員


發表:8
回覆:9
積分:3
註冊:2005-04-07

發送簡訊給我
#1 引用回覆 回覆 發表時間:2005-05-05 12:37:37 IP:131.217.xxx.xxx 未訂閱
there are 3 tables already there... and I have to create 2 more tables to link with... but mine table not working... can somebody please help? The Given Tables: Member Tables(1): CREATE TABLE member( memberNo char(3) primary key, Surname varchar(15) not null, GivenName varchar(15), street varchar(20), suburb varchar(20), postcode char(4), phone varchar(15), dateOfBirth date, dateJoined date, gender char(1), feesPaid number(5,2), registrationNumber number, CONSTRAINT registrationNumber_un UNIQUE (registrationNumber)); Match Table(2): CREATE TABLE match( grade CHAR(1), round NUMBER(1), rubber NUMBER(1), won number(1), lost number(1), CONSTRAINT match_pk PRIMARY KEY (grade, round, rubber)); Fixture Table(3): CREATE TABLE fixture ( week NUMBER(1), home char(2), away CHAR(2), CONSTRAINT fixture_pk PRIMARY KEY (home, away), CONSTRAINT home_fk FOREIGN KEY (home) REFERENCES club (mnemonic), CONSTRAINT away_fk FOREIGN KEY (away) REFERENCES club (mnemonic)); The following are the tables that I create..... Team Table: (I have problem with this one.....) drop table team; CREATE TABLE team( grade CHAR(1), round NUMBER(1), position NUMBER(1), registrationNumber number, Surname varchar(15) not null, GivenName varchar(15), CONSTRAINT registrationNumber_un UNIQUE (registrationNumber), constraint TEAM_pk primary key (grade,round)); Table Club: CREATE TABLE club( clubcode char(2) primary key, clubName varchar(20), clubLocation varchar(20)); INSERT INTO club VALUES('RQ','Raquet','String Lane'); INSERT INTO club VALUES('RL','Royal','Royal Park'); INSERT INTO club VALUES('SG','Sunny Glades','Sunny Glades'); INSERT INTO club VALUES('WH','whites','City Park'); Please can somebody help me?
cashxin2002
版主


發表:231
回覆:2555
積分:1937
註冊:2003-03-28

發送簡訊給我
#2 引用回覆 回覆 發表時間:2005-05-05 14:35:33 IP:202.62.xxx.xxx 未訂閱
Hi.    Please show the Error Message. I think you can try to check the Key Words in your Table the first. Example: 'Round' is the Key Word in Delphi.    ================================= 有空來瞅瞅我﹗因為我是您的朋友﹐有您真好﹗ ================================
------
忻晟
tabobomber
一般會員


發表:8
回覆:9
積分:3
註冊:2005-04-07

發送簡訊給我
#3 引用回覆 回覆 發表時間:2005-05-05 14:53:47 IP:131.217.xxx.xxx 未訂閱
I'm using Oracle 9 this is the error message it happens when I try to insert the next data, it's alright for the first one, but not the second one.... SQL> INSERT INTO Team VALUES('A',6,2,2321,'Hawkins','Steven'); INSERT INTO Team VALUES('A',6,2,2321,'Hawkins','Steven') * ERROR at line 1: ORA-00001: unique constraint (KSYKWOK.TEAM_PK) violated
cashxin2002
版主


發表:231
回覆:2555
積分:1937
註冊:2003-03-28

發送簡訊給我
#4 引用回覆 回覆 發表時間:2005-05-05 15:09:44 IP:202.62.xxx.xxx 未訂閱
Hi.    The same data has been in table already, check the unique key.    ================================= 有空來瞅瞅我﹗因為我是您的朋友﹐有您真好﹗ ================================
------
忻晟
系統時間:2024-06-28 2:35:26
聯絡我們 | Delphi K.Top討論版
本站聲明
1. 本論壇為無營利行為之開放平台,所有文章都是由網友自行張貼,如牽涉到法律糾紛一切與本站無關。
2. 假如網友發表之內容涉及侵權,而損及您的利益,請立即通知版主刪除。
3. 請勿批評中華民國元首及政府或批評各政黨,是藍是綠本站無權干涉,但這裡不是政治性論壇!