adspace
1.new record it will insert but changes of natural key
is not present in taget i want
to update (here key is composite natural key )can any one
help this to explan how to do
Answer Posted / Satish Chandra Singh
In Data Stage, if you need to update a record with a composite natural key that does not exist in the target, you can use the UPDATE_MATCH statement. This allows you to match on multiple columns and perform updates even when the natural key is not present exactly as it was previously. Here's an example:
Assuming your source dataset has a composite natural key (Column1, Column2) and target dataset has the same structure.
```sql
UPDATE_MATCH TargetDataset
SET
Column1 = SourceDataset.Column1,
Column2 = SourceDataset.Column2,
OtherColumns = SourceDataset.OtherColumns
FROM SourceDataset
WHERE Column1 = TargetDataset.Column1 AND Column2 = TargetDataset.Column2;
```
This statement will match records based on the composite natural key and update them if they exist in the target dataset.
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
Demonstrate experience in maintaining quality process standards?
create a job that splits the data in the Jobs.txt file into
four output files. You will direct the data to the
different output files using constraints. • Job name:
JobLevels
• Source file: Jobs.txt
• Target file 1: LowLevelJobs.txt
− min_lvl between 0 and 25 inclusive.
− Same column types and headings as Jobs.txt.
− Include column names in the first line of the output file.
− Job description column should be preceded by the
string “Job
Title:” and embedded within square brackets. For example, if
the job description is “Designer”, the derived value
is: “Job
Title: [Designer]”.
• Target file 2: MidLevelJobs.txt
− min_lvl between 26 and 100 inclusive.
− Same format and derivations as Target file 1.
• Target file 3: HighLevelJobs.txt
− min_lvl between 101 and 500 inclusive.
− Same format and derivations as Target file 1.
• Rejects file: JobRejects.txt
− min_lvl is out of range, i.e., below 0 or above 500.
− This file has only two columns: job_id and reject_desc.
− reject_desc is a variable-length text field, maximum
length
100. It should contain a string of the form: “Level out of
range:
Source has 2 columns: USA,NewYork INDIA,MUMBAI INDIA,DELHI UDS,CHICAGO INDIA,PUNE i want data in target like below: INDIA,MUMBAI1 INDIA,DELHI2 INDIA,PUNE3 USA,NEWYORK1 USA,CHICAGO2
Have you have ever worked in unix environment and why it is useful in datastage?
1)what is the size of Fact table and dimension table? 2)how to find the size of Fact table and dimension table? 3)how to implement the surrogate key in transform stage? 4)write the configuration file path? 5)how many types of datasets explain? 6)diff b/w developed projects and migration projects? 7)how to delete the header and footer file of the sequencer file? 8)how can u call the parameters in DS in unix environment? 9) how much data ur getting daily ? 10)
1)s.key generate 1 to 700 records today. tomorrow another 400 will updated how to update the records using s.key generator? 2)source is like :-- DB --> T/F stage1 --> seq1file T/f 1 is linking with T/F2 ---> seq 2 how to load the data? in source i given some conditions those r going in seq1. The another data will going to seq2 how to do this ?