RE: ACCEPT command wont work
"David, Romeo B. (Govt)" <[email protected]> Tue, 25 Feb 2003 13:40:09 -0500
| Newsgroups | gmane.comp.db.oracle.devel |
|---|---|
| Message-ID | <LYRIS-1796914-887860-2003.02.25-18.39.09--gcdod-oracle#[email protected]> |
What is the version of SQLPLUS you are using?
Try to put CHAR, NUMBER, DATE, FORMAT before the word PROMPT,
example: ACCEPT p_name CHAR PROMPT 'Please enter the Patient Name :'
ACCEPT p_first_vis DATE FORMAT 'DD-MON-YYYY' PROMPT 'Please Enter
the First Visit Date:'
ACCEPT p_age NUMBER FORMAT 999 PROMPT 'Please Enter the age:'
Note: although a DATE or a NUMBER variable was entered you still have to
remember these are always text variables so you have to still do TO_NUMBER,
or TO_DATE when addressing those.
-----Original Message-----
From: Andy [mailto:[email protected]]
Sent: Tuesday, February 25, 2003 12:48 PM
To: Oracle
Subject: [oracle] ACCEPT command wont work
Hello,
ACCEPT p_name PROMPT 'Please enter the Patient Name :'
ACCEPT p_address PROMPT 'Please enter the address :'
ACCEPT p_sex PROMPT 'Please enter the Sex :'
ACCEPT p_age PROMPT 'Please enter the age :'
ACCEPT p_contact PROMPT 'Please enter the contact no:'
ACCEPT p_first_vis PROMPT 'Please enter the First Visit Date :'
ACCEPT p_last_vis PROMPT 'Please enter the Last Visit Date :'
INSERT INTO patient
(no,name,address,sex,age,contact_no,first_visit,last_visit)
VALUES (patient_no.NEXTVAL,UPPER
('&name'),'&p_address','&p_sex',&age,&contact,TO_DATE
('&first_vis'),TO_DATE('&last_vis'))
/
I am getting :
ACCEPT p_name PROMPT 'Please enter the Patient Name :'
*
ERROR at line 1:
ORA-00900: invalid SQL statement
After I run the run and enter the value for the prompt .
Please advise.
Thanks
---
Change your mail options at http://p2p.wrox.com/manager.asp or
to unsubscribe send a blank email to %%email.unsub%%.
---
Change your mail options at http://p2p.wrox.com/manager.asp or
to unsubscribe send a blank email to [email protected].