Home » Infrastructure » Linux » To create shell script for oracle report
To create shell script for oracle report [message #221022] Fri, 23 February 2007 04:42 Go to next message
irfanr
Messages: 11
Registered: December 2006
Location: india
Junior Member
hi.

help me to create a shell script to create a report on oracle database.

i have create a script like:

1.query.sql contains

CONNECT system/manager
SPOOL /home/report.lst
select count(*) from emp;
select count(*) from dept;
SPOOL OFF
exit;

2.query.sh contains

sqlplus /nolog @ /home/query.sql

when i exec the query.sh, it created the report.lst

which looks like

count(*)
---------
15159489

count(*)
---------
585849358

i want the report to look like this

Total Row in EMP Table

count(*)
---------
15159489

Total Rows in DEPT Table

count(*)
---------
585849358

can any one help me on this

thanks
Re: To create shell script for oracle report [message #221032 is a reply to message #221022] Fri, 23 February 2007 05:20 Go to previous messageGo to next message
Mahesh Rajendran
Messages: 10707
Registered: March 2002
Location: oracleDocoVille
Senior Member
Account Moderator
oracle@mutation#cat somescript
sqlplus -s scott/tiger <<EOF
set feed off;
prompt Total Row in EMP:
select count(*) from emp;
prompt Total Row in Dept;
select count(*) from dept;
EOF
oracle@mutation#
oracle@mutation#somescript
Total Row in EMP:

  COUNT(*)
----------
        28
Total Row in Dept

  COUNT(*)
----------
         4
Re: To create shell script for oracle report [message #221039 is a reply to message #221022] Fri, 23 February 2007 06:32 Go to previous message
irfanr
Messages: 11
Registered: December 2006
Location: india
Junior Member
Hi,

Thanks a lot,

It's a fantastic reply,it working fine than what i expected..

once again i would like to thank you.

Regards
Previous Topic: Oracle 10g installation in Suse Linux 9.3
Next Topic: configure DMZ,reverse proxy with Oracle E-Business Suite
Goto Forum:
  


Current Time: Fri Mar 29 05:50:34 CDT 2024