Home » RDBMS Server » Server Utilities » Creating a Batch File
Creating a Batch File [message #254845] |
Sun, 29 July 2007 09:30 ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
onelson
Messages: 1 Registered: July 2007
|
Junior Member |
|
|
Hi Everyone!
I am currently running a control file to upload data via sql loader into a temp table. Afterwards, I have to run the following scripts to insert the data from the temp table into production. I would like to know is there a way to schedule this method as a batch process or automate it upon data being loaded into a particular directory?
---Oliver
insert into saturn.slbrmap (SLBRMAP_PIDM,
SLBRMAP_ACTIVITY_DATE,
SLBRMAP_ARTP_CODE,
SLBRMAP_FROM_TERM,
SLBRMAP_TO_TERM,
SLBRMAP_PREFERED_BUILDING,
SLBRMAP_PREFERED_ROOM,
SLBRMAP_PREFERED_CAMP_CODE,
SLBRMAP_HAPS_CODE,
SLBRMAP_HAPS_DATE,
SLBRMAP_ADD_DATE)
(select swrhous_pidm,
SYSDATE,
'HOME',
'200305',
'200305',
swrhous_bldg_code,
swrhous_room_number,
'M',
'AC',
SYSDATE,
SYSDATE
from opera.swrhous
where swrhous_term_desc like '%SUMMER%'
--and swrhous_term_desc not like '%2003-2004%'
and not exists (select 'x' from saturn.slbrmap c
where c.slbrmap_to_term = '200305'
-- and c.slbrmap_haps_code in ('AC')
-- and c.slbrmap_artp_code = 'HOME'
and c.slbrmap_pidm = swrhous_pidm)
)
/
******************************************************
insert into saturn.slrrasg(SLRRASG_PIDM,
SLRRASG_BLDG_CODE,
SLRRASG_ROOM_NUMBER,
SLRRASG_TERM_CODE,
SLRRASG_RRCD_CODE,
SLRRASG_BEGIN_DATE,
SLRRASG_END_DATE,
SLRRASG_TOTAL_DAYS,
SLRRASG_TOTAL_MONTHS,
SLRRASG_TOTAL_TERMS,
SLRRASG_ASCD_CODE,
SLRRASG_ASCD_DATE,
SLRRASG_ONL_OR_BAT,
SLRRASG_ACTIVITY_DATE,
SLRRASG_AR_IND,
SLRRASG_ASSESS_NEEDED)
(select swrhous_pidm,
swrhous_bldg_code,
swrhous_room_number,
'200608',
swrhous_rrcd_code,
'05-AUG-07',
'15-DEC-07',
0,
0,
1,
'AC',
SYSDATE,
'O',
SYSDATE,
'N',
'Y'
FROM opera.swrhous
where (swrhous_room_number is not null
and swrhous_rrcd_code is not null)
and exists (select 'x' from saturn.slbrmap,saturn.slrrasg
where slbrmap_from_term = '200708'
and slbrmap_haps_code = 'AC'
and slbrmap_pidm = swrhous_pidm)
and not exists (select 'x' from saturn.slrrasg b
where b.slrrasg_term_code = '200608'
and b.slrrasg_ascd_code = 'AC'
and b.slrrasg_pidm = swrhous_pidm))
/
**********************************************************
|
|
|
|
Goto Forum:
Current Time: Fri Sep 06 23:40:50 CDT 2024
|