If seg file having 10 records
ex:eid
1
2
"
"
10
if oracle database having 100 records
ex:eid
1
2
"
"
100
how to delete matched records permenently from oracle
database using datastage ?
Answers were Sorted based on User's Feedback
we can delete in 2 ways:
1) in TGT Oracle Stage,
select 'Write Mode' as 'DELETE'
and write the delete Query as
"DELETE FROM EMP_TGT
WHERE EID IN (SELECT EID FROM EMP_SRC)"
2)Select 'Write Mode' as 'UPDATE' and write some dummy update query(This statement will not execute as WHERE condition 1=2) as
"UPDATE EMP SER EID='1111' WHERE 1=2"
then write delete query in 'Run before SQL statemets' as
"DELETE FROM EMP_TGT
WHERE EID IN (SELECT EID FROM EMP_SRC)"
| Is This Answer Correct ? | 4 Yes | 0 No |
Answer / vaibhav
We can perform inner join between seq file & oracle stage and then in target oracle stage have write method as Delete where we can specify delete query using orchestrate incoming rows..
| Is This Answer Correct ? | 3 Yes | 0 No |
Simple job:
SEQ>>>ORACLE_STAGE.
in ORCL_STAGE: SPECIFY WRITE METHOD: DELETE ROWS
specify the matching column as key column in column definition.
| Is This Answer Correct ? | 2 Yes | 0 No |
Answer / shilpasagarg
1)The approach is to load the seq file data into one
temporary table say EMP_TEMP. (SEQ -> ODBC Stage (Oracle
(EMP_TEMP table)
EMP_TEMP contains
eid
1
2
"
"
10
2)Then take the ODBC Stage to connect to Oracle DB (EMP
table).
EMP table contains
eid
1
2
"
"
100
Here use the below query to delete the matched EID's
permanantly from oracle DB
DELETE EMP
FROM EMP
INNER JOIN EMP_TEMP
ON EMP.EID=EMP_TEMP.EID
| Is This Answer Correct ? | 0 Yes | 3 No |
what is the difference between lookup stage reject link and merge stage reject link in datastage Parallel jobs? interm of output in Merge Reject link and Look Up Reject link ?
Hi Friends, I have a input data like, class_id Marks 101 50 101 60 101 40 102 90 102 35 And i want my output data like class_id Marks Rank 101 50 2 101 60 1 101 40 3 102 90 1 102 35 2 how to do this in datastage?
8 Answers Cognizant, HCL, TIAA CREF,
Create a job to load all unique products in one table and the duplicate rows in to another table. The first table should contain the following output A D The second target should contain the following output B B B C C Q2. Create a job to load each product once into one table and the remaining products which are duplicated into another table. The first table should contain the following output A B C D The second table should contain the following output B B C
how to get the unique records on multiple columns by using sequential file stage only
project Steps,hits, Project level HArd things,Solved methods?
What are the prerequisites for join stage
Difference between the Sequence and Sequencer in DS?
Define oconv () and iconv () functions in datastage?
How to find value from a column in a dataset?
what are the different type of errors in datastage?
How to remove duplicates in transformer stage? in parallel mode
i have a small question for datastage, After the desinging (i.e., transformations and loading)part, what we can do?