Don't know how to fix.............. keyboard input |
尚未結案
|
tabobomber
一般會員 發表:8 回覆:9 積分:3 註冊:2005-04-07 發送簡訊給我 |
this is the code that I have: PROMPT ---------------------------------------------------------------------------;
PROMPT Details of Patients entered from the keyboard. PROMPT Patient Table
PROMPT -------------------------------------------------------------;
SELECT * FROM Patient; PROMPT Enter the PatientID as number (For Example: 2005)
ACCEPT PatientID char PROMPT 'PatientID: ' PROMPT Enter the Surname
ACCEPT Surname char PROMPT 'Surname: ' PROMPT Enter the GivenNames:
ACCEPT GivenNames char PROMPT 'GivenNames: ' PROMPT Enter the Address:
ACCEPT Address char PROMPT 'Address: ' PROMPT Enter the DateOfBirth:
ACCEPT DATE PROMPT 'Date of Birth:(DD/MON/YYYY): '
PROMPT -------------------------------------------------------------; SET VERIFY OFF
SET FEEDBACK ON PROMPT -------------------------------------------------------------;
INSERT INTO PATIENT values (&patientID, '&Surname', '&GivenNames', 'Address', '', TO_DATE('dateOfBirth', 'DD/MON/YYYY'),''); but can't store in the database and wanna know what code shoule I put in if dateof bith unknown. thx
|
tabobomber
一般會員 發表:8 回覆:9 積分:3 註冊:2005-04-07 發送簡訊給我 |
I have solved the problem, but what about if the date in unknown? PROMPT Enter the PatientID as number (For Example: 2005)
ACCEPT PatientID char PROMPT 'PatientID: ' PROMPT Enter the Surname
ACCEPT Surname char PROMPT 'Surname: ' PROMPT Enter the GivenNames:
ACCEPT GivenNames char PROMPT 'GivenNames: ' PROMPT Enter the Address:
ACCEPT Address char PROMPT 'Address: ' PROMPT Enter the DateOfBirth:
PROMPT ACCEPT Date PROMPT 'Date of Birth:(DD/MON/YYYY): '
PROMPT -------------------------------------------------------------; SET VERIFY OFF
SET FEEDBACK ON PROMPT -------------------------------------------------------------;
INSERT INTO PATIENT values (&patientID, '&Surname', '&GivenNames', '&Address', '', TO_DATE('&DD,&MON,&YYYY', 'DD/MON/YYYY'),''); PROMPT Patient Table
PROMPT -------------------------------------------------------------;
SELECT * FROM Patient; PROMPT Enter Admission Record
PROMPT -------------------------------------------------------------; INSERT INTO admission VALUES(&patientID,'03-MAR-05','03-APR-05',null,null,null); SELECT * FROM Admission; spool off
|
tabobomber
一般會員 發表:8 回覆:9 積分:3 註冊:2005-04-07 發送簡訊給我 |
YEAH,fix it!!!! hahaha HAPPY PROMPT ---------------------------------------------------------------------------;
PROMPT Details of Patients entered from the keyboard. PROMPT Enter the PatientID as number (For Example: 2005)
ACCEPT PatientID char PROMPT 'PatientID: ' PROMPT Enter the Surname
ACCEPT Surname char PROMPT 'Surname: ' PROMPT Enter the GivenNames:
ACCEPT GivenNames char PROMPT 'GivenNames: ' PROMPT Enter the Address:
ACCEPT Address char PROMPT 'Address: ' PROMPT Enter the DateOfBirth:
PROMPT ACCEPT Date PROMPT 'Date of Birth:(DD/MON/YYYY): '
PROMPT -------------------------------------------------------------; SET VERIFY OFF
SET FEEDBACK ON PROMPT -------------------------------------------------------------;
INSERT INTO PATIENT values (&patientID, '&Surname', '&GivenNames', '&Address', '', TO_DATE(&DDMONYYYY, 'DD/MON/YYYY'),''); PROMPT Patient Table
PROMPT -------------------------------------------------------------;
SELECT * FROM Patient; PROMPT Enter Admission Record
PROMPT -------------------------------------------------------------; INSERT INTO admission VALUES(&patientID,'&admissionDate','&dischargeDate',null,null,null); SELECT * FROM Admission; spool off
|
本站聲明 |
1. 本論壇為無營利行為之開放平台,所有文章都是由網友自行張貼,如牽涉到法律糾紛一切與本站無關。 2. 假如網友發表之內容涉及侵權,而損及您的利益,請立即通知版主刪除。 3. 請勿批評中華民國元首及政府或批評各政黨,是藍是綠本站無權干涉,但這裡不是政治性論壇! |