Skip to Main Content

GoldenGate

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How to replace default value when GoldenGate SQLEXEC lookup causing ORA-1403 no data found ?

Selvakumar.NagulanSep 10 2016 — edited Sep 12 2016

Hi,

Below is the Replicat script

MAP ARADMIN.T539, TARGET DATASTORE.ATTRIBUTE, KEYCOLS(ENTRYID), &

-- Query block for INSTANCEID column of the table

SQLEXEC (ID LOOKUP_MOI, QUERY "select instanceid from DATASTORE.MANAGEDOBJECTINSTANCE where TROUBLEREPORTID=:TR_IN and INSTANCENAME=:I_IN", PARAMS (TR_IN = C911001001, I_IN = C911001102)),&

COLMAP (

ATTRIBUTEID=@COLSTAT (MISSING),

TROUBLEREPORTID=@IF (@STRFIND (C911001001,'ID',1)=1,@COLSTAT (NULL),C911001001),

NAME=C911003014,

VALUE=C911005010,

TYPE=C911003018,

PARENTNAME=C911005001,

INSTANCEID=@IF (@COLTEST (@GETVAL(LOOKUP_MOI.instanceid),NULL,INVALID),@COLSTAT (NULL),@GETVAL(LOOKUP_MOI.instanceid)),

ENTRYID=C1);

When the SQLEXEC couldn't find a match, it returns ORA-1403 -no data found (in SQLPLUS --> no rows selected).

When this is happening, I would like the field to be updated with NULL and in my case this update is not happening and the previous value remains the same in the database (literally meaning, the record is ignored).

Is there a way to handle this situation something like no_data_found exception in pl/sql blocks? Any help is much appreciated.

Thanks!

This post has been answered by K.Gan on Sep 11 2016
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 10 2016
Added on Sep 10 2016
7 comments
2,921 views