Can someone help me with the prompts command? [message #371519] |
Wed, 01 November 2000 19:11 |
Chris
Messages: 128 Registered: November 1998
|
Senior Member |
|
|
The block below will not run on Oracle 8. It completely ignores the accept/prompt and then just promps on the & parts in declare for about 2 variables and then just fails. Very frustrating. Can anyone help me out on this?
create sequence Emp_no_Seq
increment by 1
start with 7000
maxvalue 8000
nocache
nocycle;
10. Create and populate 'mytable". with dept_no,dept_name,dept_location,dept_manager. Write the PL?SQL block that will populate your table. Insert at least five entries. Show your table on completion. Use you sequence (#9) for dept_no.
SET SERVEROUTPUT OFF
SET VERIFY OFF
ACCEPT p_deptno PROMPT 'Please enter the department number:';
ACCEPT p_deptname PROMPT 'Please enter the department name:';
ACCEPT p_deptloc PROMPT 'Please enter the department location:';
ACCEPT p_deptmgr PROMPT 'Please enter the department manager:';
DECLARE
V_deptno mytable.dept_no%TYPE := '&p_deptno';
V_deptname mytable.dept_name%TYPE:= '&p_deptname' ;
v_deptloc mytable.dept_loc%TYPE := '&p_deptloc' ;
v_deptmgr mytable.dept_mgr%TYPE := '&p_deptmgr' ;
BEGIN
CREATE TABLE MYTABLE(
dept_no VARCHAR2(20),
emp_no VARCHAR2(20)
dept_name VARCHAR2(20),
dept_loc VARCHAR2(20),
dept_mgr VARCHAR2(20),
;
insert into mytable (dept_no, emp_no, dept_name, dept_loc,dept_mgr)
values (v_deptno, emp_no_Seq.nextval, v_deptname,v_deptloc,v_deptmgr);
END;
|
|
|
|