Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in NYC Sept 4th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Rajender
Creator
Creator

Use Oracle sequence while loading into oracle table

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

Labels (2)
1 Solution

Accepted Solutions
Anonymous
Not applicable

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.

View solution in original post

4 Replies
Anonymous
Not applicable

Rajender
Creator
Creator
Author

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.

 

 

 

Anonymous
Not applicable

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.

Rajender
Creator
Creator
Author

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