SQLPLUS commands [message #1080] |
Thu, 28 March 2002 05:47 |
neelu
Messages: 5 Registered: December 2000
|
Junior Member |
|
|
i need to get the ouput showing the message i gave at the prompt & should ask me to enter the dept no..
but am getting a different one explained below
this query displays the employee id and name for
SQL> prompt the employees in the department you supply
the employees in the department you supply
SQL> ------------------------------------
SQL> accept depnumb number prompt"enter dept num"
enter dept num
SQL> set verify off
SQL> select empno,ename"emp name"
2 from emp
3 where deptno=&depnumb
4 order by ename;
no rows selected
SQL> set verify on
SQL> save myscript
Created file myscript
SQL> @myscript
old 3: where deptno=&depnumb
new 3: where deptno= 0
no rows selected
thanks in advance
neelu
|
|
|
|
Re: SQLPLUS commands [message #1500 is a reply to message #1080] |
Mon, 06 May 2002 22:05 |
Renuka Chawla
Messages: 1 Registered: May 2002
|
Junior Member |
|
|
Type the following command to create a file x.sql:
SQL> ed x.sql
The editor opens. Type the following lines in the editor and save the file:
accept depnumb number prompt "Enter deptno:"
select empno,ename"emp name"
from emp
where deptno=&depnumb
order by ename
Now give the following commands at the prompt:
SQL> set verify off
SQL> @x.sql
You will get this output:
Enter deptno:10
old 3: where deptno=&depnumb
new 3: where deptno= 10
EMPNO emp name
---------- ----------
7782 CLARK
7839 KING
7934 MILLER
|
|
|