Home » SQL & PL/SQL » SQL & PL/SQL » SQLPLUS commands
SQLPLUS commands [message #1080] Thu, 28 March 2002 05:47 Go to next message
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 #1081 is a reply to message #1080] Thu, 28 March 2002 08:26 Go to previous messageGo to next message
Mahesh Rajendran
Messages: 10707
Registered: March 2002
Location: oracleDocoVille
Senior Member
Account Moderator
this is working for me
-------------------
SQL> /
old 3: where deptno=&depnumb
new 3: where deptno= 10

EMPNO emp name
---------- ----------
7782 CLARK
7839 KING
7934 MILLER

SQL> @fo
the employees in the department you supply
enter dept num : 0
old 3: where deptno=&depnumb
new 3: where deptno= 0

no rows selected
-------------
this fo.sql
-----------
SQL> get fo
1 prompt the employees in the department you supply
2 accept depnumb number prompt"enter dept num : "
3 select empno,ename"emp name"
4 from emp
5 where deptno=&depnumb
6* order by ename;
Re: SQLPLUS commands [message #1500 is a reply to message #1080] Mon, 06 May 2002 22:05 Go to previous message
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
Previous Topic: string O numbers in IN??
Next Topic: Insert Into IN
Goto Forum:
  


Current Time: Wed May 01 07:37:34 CDT 2024