Home » SQL & PL/SQL » SQL & PL/SQL » Re: New - Not using Oracle Reporting Tools - Need Help Please
Re: New - Not using Oracle Reporting Tools - Need Help Please [message #8608] Wed, 03 September 2003 09:36 Go to next message
Tracy
Messages: 43
Registered: January 2000
Member
Sorry for any confusion, this is all new - I am trying to write it in PL/SQL, and I am still a little confused on how to get the table name to print and how to line up the actual results with the proper header.

Thanks,
Tracy
Re: New - Not using Oracle Reporting Tools - Need Help Please [message #8613 is a reply to message #8608] Thu, 04 September 2003 01:14 Go to previous message
Maaher
Messages: 7065
Registered: December 2001
Senior Member
Look at the script below:
REM remove the header of columns
SET HEADING OFF
REM remove the 'xx rows selected.' after a query
SET FEEDB OFF

REM emp title + underline
SELECT 'EMP' FROM DUAL
/

REM emp data
SELECT '---' FROM DUAL
/
SELECT ename
  FROM emp
/

REM dept title + underline
SELECT 'DEPT' FROM DUAL
/
SELECT '----' FROM DUAL
/

REM dept data
SELECT dname
  FROM dept
/

REM reset sql*plus environment
SET FEEDB 6
SET HEADING ON
Assuming this script is stored under c:myscriptsscript.sql, you'll get the following in SQL*Plus:
SQL> @c:myscriptsscript.sql

EMP

---

SMITH
ALLEN
WARD
JONES
MARTIN
BLAKE
CLARK
SCOTT
KING
TURNER
ADAMS
JAMES
FORD

MILLER

DEPT

----

ACCOUNTING
RESEARCH
SALES
OPERATIONS
f
abcv
A
C
SQL>
HTH,

MHE
Previous Topic: Updating rows in a trigger
Next Topic: UTL_FILE problem
Goto Forum:
  


Current Time: Thu Mar 28 08:20:31 CDT 2024