Operating System - HP-UX
1753846 Members
7773 Online
108807 Solutions
New Discussion

Re: Running an Oracle SQL script fron cron

 
SOLVED
Go to solution
Yogeeraj_1
Honored Contributor

Re: Running an Oracle SQL script fron cron

hi tom,

> How do I ouput only the results of my query (including the header) and get each record to appear on a single line?


The results of your query should be sent to a file which you can use later.

the command that you must include in your script is:

spool /
...
spool off

For each record to appear on a single line, you should use the command:
set linesize


hope this helps!

kind regards
yogeeraj
No person was ever honoured for what he received. Honour has been the reward for what he gave (clavin coolidge)
Tom Grill
Occasional Contributor

Re: Running an Oracle SQL script fron cron

My report spools fine with one exception. I'd like for the header to be saved. I did try 'set heading on' but that didn't work. If I output my select statement without spooling, the header appears. Any advice?
Yogeeraj_1
Honored Contributor

Re: Running an Oracle SQL script fron cron

try to include the line:

set pagesize 1000

other setting that you may wish to look into that i usually use in our scripts are:
SET ARRAYSIZE 1
SET FEEDBACK off
SET SERVEROUT on
SET PAGESIZE 66
SET NEWPAGE 6
SET LINESIZE 75
SET PAUSE off
SET VERIFY off



hope this helps!

kind regards
yogeeraj
No person was ever honoured for what he received. Honour has been the reward for what he gave (clavin coolidge)
spex
Honored Contributor

Re: Running an Oracle SQL script fron cron

Hi Tom,

Try 'set head on'.

PCS
adithya7
New Member

Re: Running an Oracle SQL script fron cron

Hello Yogeeraj,

I want to schedule a cronjob to compile a package on every day at 7:00 AM with specified user.

Details:

Username : apps

pwd : Deployed#777

ALTER PACKAGE APPS.EQU_BIS_PK COMPILE

Please provide me the cronjob for the above details.

 

Thanks & Regards,

Adithya