Link to home
Start Free TrialLog in
Avatar of sunhux
sunhux

asked on

Sql script to spool / save to a disk file (in YYYYMMDD.spl) a select output

I'm no sql scripting person & need an sql script to
print out (ie save to disk file) the list of dormant
users from our Oracle DB for last 30 days:

select * from ACTION_LOG where ACTION_DTTM >= trunc(sysdate-30)
  and ACTION_CD in ('SORAS') order by ACTION_DTTM DESC;

Will need someone to prefix it with
set spool ....   DormantAccts_YYYYMMDD.spl

to save output to a spool file which we'll email out
ASKER CERTIFIED SOLUTION
Avatar of johnsone
johnsone
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of slightwv (䄆 Netminder)
slightwv (䄆 Netminder)

johnsone's memory is much better than mine and he should get the points.

Small correction:  You need two periods when using a variable like that:
spool DormantAccts_&dt..spl
I've done it a few times.....