Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi There
I am reading multishema nest xml and loading into oracle database. For incoming data its observe that SourceID tag is null.
If SourceID data is null then I need to use oracle sequence to load data into table.
If SourceID value is not null then this value need to be inserted into table as it is.
I am planning to load data as null values then execute an update query to using sequence generator.
Please suggest if there is another way to do it.
Thanks in Advance
You could use a db component to fire the following query IF the value you need is missing. You will need to figure out the flow of your job. But the SQL will look something like this....
SELECT mySeq.nextval FROM DUAL;
In order for this to work you will need to use a tMap to identify those records already with a value and those without. Send them to two different outputs. The output for records without a value, send to another tMap. In that tMap set the lookup to fire on every row. Then use the SQL above as the lookup.
This tutorial focuses on doing this....
Hi Richard
Thanks you for suggestion. I have gone through the provided already.
Let me put my problem in another way. We have multi schema nested XML.
XMLInput --> tXMLMap --> tuniq --> Db
output tXMLMap for child node have duplicate records, then tuniq create unique records and load into Child table.
My problem here is child node has parent sourceID and loaded into Child table as parent_sourceID. New changes Now parent sourceID can be null. So when data is loaded into child table then it is difficult to trace which parent records it belong.
I was told to used Oracle Sequence for missing Parent SourceID.
I am placing some dummy value for missing values and replacing them using update query.
Will it be possible to replace missing values in tXMLMap with Oracle sequence.
You could use a db component to fire the following query IF the value you need is missing. You will need to figure out the flow of your job. But the SQL will look something like this....
SELECT mySeq.nextval FROM DUAL;
In order for this to work you will need to use a tMap to identify those records already with a value and those without. Send them to two different outputs. The output for records without a value, send to another tMap. In that tMap set the lookup to fire on every row. Then use the SQL above as the lookup.
Hi Richard
Thanks you for help.
I have segregate pipline for Null values and inserted into tables and also loaded thashOutput(required values)
Now when third level of child table is loaded with join thashInput for missing/null values in tmap.
Best Regards
Rajender Prasad