I have a two table named test1
and test2
i want to move data from test1 to test2 in a way like if a condition matches update data else insert in to database.I have successfully done the oracle query which i posted down.I have to achieve two more tasks
**1>I have to move the operation in to console c# application
2>i have to remove the leading blank spaces for entries t2_fNAME and ACCOUNT_NUMBER** How i can achieve this task do i need to do ado.net c# code if so how to do it
merge into test2 a
using test1 b
on (a.t2_NAME = b.t1_NAME)
when matched then update
set a.t2_fNAME = b.t1_fNAME,
a.ACCOUNT_NUMBER = b.ACCOUNT_NO,
when not matched then
insert (t2_slno,t2_NAME,t2_fNAME,ACCOUNT_NUMBER)
values (t2_NODE_SEQ.NEXTVAL, b.t1_NAME,b.t1_fNAME,b.ACCOUNT_NO);