on 10-20-2015 8:16 PM
Hi
I have a source file in one DB and target file in another DB.
I want to delete records in the target file where targetfile.month=sourcefile.month
How can I achieve this?
I tried to use scripts with variables
Example :
$variable1 = sql('DB1', 'select month from sourcefile');
sql('DB2', ' delete from target file where month = {$variable1} ')
But apparently since $variable1 can hold only one value I am not getting the results I want. I have multiple values for the first statement above and its not fixed. How do I store multiple values in a variable or create an array? please eplain with the format for any function if we have one.
Cheers.
Using DS Designer 14.2.1.568
You can implement a delete in a data flow, too.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
If you don't trust me, check How to delete records? - Enterprise Information Management - SCN Wiki for a detailed explanation with screenshots et al.
Are the DBs on same server? Use a post load command on the target table.
Some thing like this -
Delete from table1 inner join table2 on table1.month = table2.month
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
95 | |
11 | |
11 | |
10 | |
9 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.