Exception Handling raised by Oracle

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
gulshanr
Participant
Posts: 14
Joined: Thu Feb 26, 2004 1:08 pm

Exception Handling raised by Oracle

Post by gulshanr »

I am eager to know how to handle exception raised by Oracle.
We are using a file and then looking a database for some additional fields. We are experienceing a probelm in lookup. We are using RDB on VAX as lookup. We have problem with date field. Date field in RDB is having a date with year as 5 Digit while in input file its 4 Digit. Oracle does not understand the 5 digit year and we getting exception INVALID NUMBER (while using to_char function). Is there any way to by pass the bad record and continue with remaining record. We are using following query

Code: Select all

SELECT MEMBER_MEDICARE.HIC_NUM,MEMBER_MEDICARE.HMO_ID,
MEMBER_MEDICARE.SUBSCBR_NUM,MEMBER_MEDICARE.MBR_SUFFIX,
TO_CHAR(MEMBER_MEDICARE.BEG_EFF_DATE, 'YYYYMMDD'),
TO_CHAR(MEMBER_MEDICARE.END_EFF_DATE ,'YYYYMMDD')
FROM MEMBER_MEDICARE MEMBER_MEDICARE
WHERE MEMBER_MEDICARE.HIC_NUM='431327774D' AND MEMBER_MEDICARE.HMO_ID='H0543' 
AND (MEMBER_MEDICARE.BEG_EFF_DATE <= MEMBER_MEDICARE.END_EFF_DATE OR MEMBER_MEDICARE.END_EFF_DATE IS NULL)
AND TO_CHAR(MEMBER_MEDICARE.BEG_EFF_DATE,'YYYYMMDD') <= '20040701'
AND (TO_CHAR(MEMBER_MEDICARE.END_EFF_DATE,'YYYYMMDD') >= '20040731' OR MEMBER_MEDICARE.END_EFF_DATE IS NULL)
AND MEMBER_MEDICARE.BEG_EFF_DATE < SYSDATE
ORDER BY MEMBER_MEDICARE.BEG_EFF_DATE DESC
LIMIT TO 1 ROW
To_char for BEg_eff_date is problem for us. Any help on this will be highly appreciated.

My scenario is as below

Code: Select all

input_file --> transformer   --> output file (All Valid Record)
                     ^
                     |
                   RDB Lookup
WoMaWil
Participant
Posts: 482
Joined: Thu Mar 13, 2003 7:17 am
Location: Amsterdam

Post by WoMaWil »

Have you tried to write your data into a hash file and using the hashfile as lookup or to divide in Oracle the sting in a year, month and day part and then concatinating it.
roy
Participant
Posts: 2598
Joined: Wed Jul 30, 2003 2:05 am
Location: Israel

Post by roy »

Hi,
You'll probably get what you need by writing a transform routine that changes the date formats.
transform routines can be placed in the lookup key column to wrap your source date data column and hence pass the date in the correct format for your lookup.

IHTH,
Roy R.
Time is money but when you don't have money time is all you can afford.

Search before posting:)

Join the DataStagers team effort at:
http://www.worldcommunitygrid.org
Image
Post Reply