Advertisement
shahirahrashid

PL SQL 16th April

Apr 15th, 2014
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.70 KB | None | 0 0
  1. create or replace procedure newpatient
  2. (ptid patient.pt_id%type,
  3. ptlname patient.pt_lname%type,
  4. ptfname patient.pt_fname%type,
  5. dob patient.ptdob%type,
  6. docid patient.doc_id%type)
  7. as
  8. begin
  9. insert into patient (pt_id, pt_lname, pt_fname, ptdob, doc_id)
  10. values (ptid, ptlname, ptfname, dob, docid);
  11. end newpatient;
  12. /
  13.  
  14. accept ptid prompt 'Enter patient id: '
  15. accept ptlname prompt 'Enter patient last name: '
  16. accept ptfname prompt 'Enter patient first name: '
  17. accept dob prompt 'Enter patient date of birth: '
  18. accept docid prompt 'Enter patient's doctor id: '
  19.  
  20. begin
  21. newpatient ('&ptid', '&ptlname', '&ptfname', '&dob',
  22. '&docid');
  23.  
  24. dbms_output.put_line('The data is successfully entered');
  25.  
  26. end;
  27. /
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement