dbTalk Databases Forums  

SPOOL INTO A JOB

comp.databases.oracle.misc comp.databases.oracle.misc


Discuss SPOOL INTO A JOB in the comp.databases.oracle.misc forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
CenturionX
 
Posts: n/a

Default SPOOL INTO A JOB - 09-05-2008 , 02:36 PM






Hello everybody,

I'm working with Oracle 10g.
I have a report generated by a sql script. This script runs in a
windows task.
I have to generate this report from the database now.
The report like that (I modified it for confidential issues):
set feedback off
set pages 50
set lines 80

COL TIMESTAMP NEW_VALUE xTIMESTAMP noprint format a1 trunc
COL BAR FORM a7 HEADING 'BAR'
COL COMPONENT FORM a15 heading 'COMPONENT'
COL AGGBALANCE heading 'AGG. BALANCE'

break on BAR skip 1

ttitle center 'MY REPORT' skip 1-
center '====================================' skip 2
btitle left ' ' skip 2 -
left 'Time of Report: ' xTIMESTAMP skip 2 -
center 'Page: ' format 999 SQL.PNO
spool D:\Reports\reportname.txt

SELECT sysdate from dual
/
spool off
btitle off
ttitle off
clear breaks
clear computes
clear columns


My question is if i can run that script like this from a job.

Thanks.

Reply With Quote
  #2  
Old   
sybrandb@hccnet.nl
 
Posts: n/a

Default Re: SPOOL INTO A JOB - 09-05-2008 , 05:24 PM






On Fri, 5 Sep 2008 12:36:00 -0700 (PDT), CenturionX
<darwinbaldrich (AT) gmail (DOT) com> wrote:

Quote:
Hello everybody,

I'm working with Oracle 10g.
I have a report generated by a sql script. This script runs in a
windows task.
I have to generate this report from the database now.
The report like that (I modified it for confidential issues):
set feedback off
set pages 50
set lines 80

COL TIMESTAMP NEW_VALUE xTIMESTAMP noprint format a1 trunc
COL BAR FORM a7 HEADING 'BAR'
COL COMPONENT FORM a15 heading 'COMPONENT'
COL AGGBALANCE heading 'AGG. BALANCE'

break on BAR skip 1

ttitle center 'MY REPORT' skip 1-
center '====================================' skip 2
btitle left ' ' skip 2 -
left 'Time of Report: ' xTIMESTAMP skip 2 -
center 'Page: ' format 999 SQL.PNO
spool D:\Reports\reportname.txt

SELECT sysdate from dual
/
spool off
btitle off
ttitle off
clear breaks
clear computes
clear columns


My question is if i can run that script like this from a job.

Thanks.
Yes, obviously.

Next question to be expected 'How'
My answer: You didn't ask that. Also you didn't specify an exact
version and a platform.

--
Sybrand Bakker
Senior Oracle DBA


Reply With Quote
  #3  
Old   
sybrandb@hccnet.nl
 
Posts: n/a

Default Re: SPOOL INTO A JOB - 09-05-2008 , 05:24 PM



On Fri, 5 Sep 2008 12:36:00 -0700 (PDT), CenturionX
<darwinbaldrich (AT) gmail (DOT) com> wrote:

Quote:
Hello everybody,

I'm working with Oracle 10g.
I have a report generated by a sql script. This script runs in a
windows task.
I have to generate this report from the database now.
The report like that (I modified it for confidential issues):
set feedback off
set pages 50
set lines 80

COL TIMESTAMP NEW_VALUE xTIMESTAMP noprint format a1 trunc
COL BAR FORM a7 HEADING 'BAR'
COL COMPONENT FORM a15 heading 'COMPONENT'
COL AGGBALANCE heading 'AGG. BALANCE'

break on BAR skip 1

ttitle center 'MY REPORT' skip 1-
center '====================================' skip 2
btitle left ' ' skip 2 -
left 'Time of Report: ' xTIMESTAMP skip 2 -
center 'Page: ' format 999 SQL.PNO
spool D:\Reports\reportname.txt

SELECT sysdate from dual
/
spool off
btitle off
ttitle off
clear breaks
clear computes
clear columns


My question is if i can run that script like this from a job.

Thanks.
Yes, obviously.

Next question to be expected 'How'
My answer: You didn't ask that. Also you didn't specify an exact
version and a platform.

--
Sybrand Bakker
Senior Oracle DBA


Reply With Quote
  #4  
Old   
sybrandb@hccnet.nl
 
Posts: n/a

Default Re: SPOOL INTO A JOB - 09-05-2008 , 05:24 PM



On Fri, 5 Sep 2008 12:36:00 -0700 (PDT), CenturionX
<darwinbaldrich (AT) gmail (DOT) com> wrote:

Quote:
Hello everybody,

I'm working with Oracle 10g.
I have a report generated by a sql script. This script runs in a
windows task.
I have to generate this report from the database now.
The report like that (I modified it for confidential issues):
set feedback off
set pages 50
set lines 80

COL TIMESTAMP NEW_VALUE xTIMESTAMP noprint format a1 trunc
COL BAR FORM a7 HEADING 'BAR'
COL COMPONENT FORM a15 heading 'COMPONENT'
COL AGGBALANCE heading 'AGG. BALANCE'

break on BAR skip 1

ttitle center 'MY REPORT' skip 1-
center '====================================' skip 2
btitle left ' ' skip 2 -
left 'Time of Report: ' xTIMESTAMP skip 2 -
center 'Page: ' format 999 SQL.PNO
spool D:\Reports\reportname.txt

SELECT sysdate from dual
/
spool off
btitle off
ttitle off
clear breaks
clear computes
clear columns


My question is if i can run that script like this from a job.

Thanks.
Yes, obviously.

Next question to be expected 'How'
My answer: You didn't ask that. Also you didn't specify an exact
version and a platform.

--
Sybrand Bakker
Senior Oracle DBA


Reply With Quote
  #5  
Old   
sybrandb@hccnet.nl
 
Posts: n/a

Default Re: SPOOL INTO A JOB - 09-05-2008 , 05:24 PM



On Fri, 5 Sep 2008 12:36:00 -0700 (PDT), CenturionX
<darwinbaldrich (AT) gmail (DOT) com> wrote:

Quote:
Hello everybody,

I'm working with Oracle 10g.
I have a report generated by a sql script. This script runs in a
windows task.
I have to generate this report from the database now.
The report like that (I modified it for confidential issues):
set feedback off
set pages 50
set lines 80

COL TIMESTAMP NEW_VALUE xTIMESTAMP noprint format a1 trunc
COL BAR FORM a7 HEADING 'BAR'
COL COMPONENT FORM a15 heading 'COMPONENT'
COL AGGBALANCE heading 'AGG. BALANCE'

break on BAR skip 1

ttitle center 'MY REPORT' skip 1-
center '====================================' skip 2
btitle left ' ' skip 2 -
left 'Time of Report: ' xTIMESTAMP skip 2 -
center 'Page: ' format 999 SQL.PNO
spool D:\Reports\reportname.txt

SELECT sysdate from dual
/
spool off
btitle off
ttitle off
clear breaks
clear computes
clear columns


My question is if i can run that script like this from a job.

Thanks.
Yes, obviously.

Next question to be expected 'How'
My answer: You didn't ask that. Also you didn't specify an exact
version and a platform.

--
Sybrand Bakker
Senior Oracle DBA


Reply With Quote
  #6  
Old   
CenturionX
 
Posts: n/a

Default Re: SPOOL INTO A JOB - 09-11-2008 , 03:55 PM



Hello Sybrand,

Thanks for respond.
I'll change the question.

I'm working with Oracle 10.2.0.4.0 on Windows.

I created a job to execute a .bat file

JOB:
---------
begin
dbms_scheduler.create_job (
job_name =>'DEL_ALERT_LOG',
job_type =>'executable',
job_action =>'c:\windows\system32\cmd.exe /c H:\Reports\Programs
\wip_inventory_dbp.bat > nul',
enabled => true,
auto_drop => true
);
commit;
end;
/

..BAT file
-------------
:ELETE OLD LOG FILE
DEL wip_inventory_dbp.log

::GENERATE REPORT
ECHO. >> wip_inventory_dbp.log
ECHO Generating report... >> wip_inventory_dbp.log
ECHO. >> wip_inventory_dbp.log
sqlplus cms/cms@LEGACY_JACKSONVILLE_DEV @H:\Reports\Programs
\wip_inventory.sql

The only thing that executes right is the sqlplus command, The rest:
del, echo, doesn't work (just DOS commands does nothing).
How can i fix it.
I need a log file to follow the process and i need to add more dos
commands in the script.

Thanks for your help.

Reply With Quote
  #7  
Old   
CenturionX
 
Posts: n/a

Default Re: SPOOL INTO A JOB - 09-11-2008 , 03:55 PM



Hello Sybrand,

Thanks for respond.
I'll change the question.

I'm working with Oracle 10.2.0.4.0 on Windows.

I created a job to execute a .bat file

JOB:
---------
begin
dbms_scheduler.create_job (
job_name =>'DEL_ALERT_LOG',
job_type =>'executable',
job_action =>'c:\windows\system32\cmd.exe /c H:\Reports\Programs
\wip_inventory_dbp.bat > nul',
enabled => true,
auto_drop => true
);
commit;
end;
/

..BAT file
-------------
:ELETE OLD LOG FILE
DEL wip_inventory_dbp.log

::GENERATE REPORT
ECHO. >> wip_inventory_dbp.log
ECHO Generating report... >> wip_inventory_dbp.log
ECHO. >> wip_inventory_dbp.log
sqlplus cms/cms@LEGACY_JACKSONVILLE_DEV @H:\Reports\Programs
\wip_inventory.sql

The only thing that executes right is the sqlplus command, The rest:
del, echo, doesn't work (just DOS commands does nothing).
How can i fix it.
I need a log file to follow the process and i need to add more dos
commands in the script.

Thanks for your help.

Reply With Quote
  #8  
Old   
CenturionX
 
Posts: n/a

Default Re: SPOOL INTO A JOB - 09-11-2008 , 03:55 PM



Hello Sybrand,

Thanks for respond.
I'll change the question.

I'm working with Oracle 10.2.0.4.0 on Windows.

I created a job to execute a .bat file

JOB:
---------
begin
dbms_scheduler.create_job (
job_name =>'DEL_ALERT_LOG',
job_type =>'executable',
job_action =>'c:\windows\system32\cmd.exe /c H:\Reports\Programs
\wip_inventory_dbp.bat > nul',
enabled => true,
auto_drop => true
);
commit;
end;
/

..BAT file
-------------
:ELETE OLD LOG FILE
DEL wip_inventory_dbp.log

::GENERATE REPORT
ECHO. >> wip_inventory_dbp.log
ECHO Generating report... >> wip_inventory_dbp.log
ECHO. >> wip_inventory_dbp.log
sqlplus cms/cms@LEGACY_JACKSONVILLE_DEV @H:\Reports\Programs
\wip_inventory.sql

The only thing that executes right is the sqlplus command, The rest:
del, echo, doesn't work (just DOS commands does nothing).
How can i fix it.
I need a log file to follow the process and i need to add more dos
commands in the script.

Thanks for your help.

Reply With Quote
  #9  
Old   
CenturionX
 
Posts: n/a

Default Re: SPOOL INTO A JOB - 09-11-2008 , 03:55 PM



Hello Sybrand,

Thanks for respond.
I'll change the question.

I'm working with Oracle 10.2.0.4.0 on Windows.

I created a job to execute a .bat file

JOB:
---------
begin
dbms_scheduler.create_job (
job_name =>'DEL_ALERT_LOG',
job_type =>'executable',
job_action =>'c:\windows\system32\cmd.exe /c H:\Reports\Programs
\wip_inventory_dbp.bat > nul',
enabled => true,
auto_drop => true
);
commit;
end;
/

..BAT file
-------------
:ELETE OLD LOG FILE
DEL wip_inventory_dbp.log

::GENERATE REPORT
ECHO. >> wip_inventory_dbp.log
ECHO Generating report... >> wip_inventory_dbp.log
ECHO. >> wip_inventory_dbp.log
sqlplus cms/cms@LEGACY_JACKSONVILLE_DEV @H:\Reports\Programs
\wip_inventory.sql

The only thing that executes right is the sqlplus command, The rest:
del, echo, doesn't work (just DOS commands does nothing).
How can i fix it.
I need a log file to follow the process and i need to add more dos
commands in the script.

Thanks for your help.

Reply With Quote
  #10  
Old   
CenturionX
 
Posts: n/a

Default Re: SPOOL INTO A JOB - 09-11-2008 , 05:29 PM



Hello Malcom,

You are the man.

That's exactly what was failing.

I specified the current directory and now my .bat file is working
fine.

Thanks a lot.

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.