Home » SQL & PL/SQL » SQL & PL/SQL » how to set prompt off
how to set prompt off [message #323357] Wed, 28 May 2008 05:20 Go to next message
M.Shakeel Azeem
Messages: 226
Registered: September 2006
Senior Member
Dear All,

i have a sql script named as emp.sql which contains the following

set verify off 
set heading off
set feedback off
spool c:\emp_info.txt
declare
cursor emp_c1 is
select * from emp where deptno=&Please_Give_Dept_No.;
begin
for c1 in emp_c1 loop
dbms_output.put_line(c1.empno||';'||c1.ename||';'||c1.job||';'||c1.deptno||';');
end loop;
end;
/
spool off


when i run the scipt as
SQL>@c:\emp.sql;
the output is
Enter value for please_give_dept_no: 10
7782;CLARK;MANAGER;10;                                                                                                     
7839;KING;PRESIDENT;10;                                                                                                    
7934;MILLER;CLERK;10;


but i want to have output like the following

7782;CLARK;MANAGER;10;                                                                                                
7839;KING;PRESIDENT;10;                                                                                                    
7934;MILLER;CLERK;10; 

Please suggest how to do it?

Re: how to set prompt off [message #323439 is a reply to message #323357] Wed, 28 May 2008 08:33 Go to previous message
joy_division
Messages: 4644
Registered: February 2005
Location: East Coast USA
Senior Member
Sheesh, over 200 messages and you didn't think to put the spool command AFTER the user prompt?
Previous Topic: is it possible to Retrieve All the rows also need some more functional columns
Next Topic: How to translate PSQL to Oracle PL/SQL
Goto Forum:
  


Current Time: Sat Dec 10 07:11:11 CST 2016

Total time taken to generate the page: 0.14615 seconds