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
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))
/
**********************************************************
Re: Creating a Batch File [message #254853 is a reply to message #254845] Sun, 29 July 2007 10:32 Go to previous message
Michel Cadot
Messages: 68728
Registered: March 2007
Location: Saint-Maur, France, https...
Senior Member
Account Moderator
Use external table and Oracle job/scheduler.

Regards
Michel
Previous Topic: Fnd_Global.User_ID
Next Topic: 9i to 10g upgrade through import error
Goto Forum:
  


Current Time: Wed Dec 25 09:53:39 CST 2024