I am facing an issue with the below Merge statement
My records is has data like this :- [[1,2,3] , [7,8,9], [5,7,8]]
which I am assigning to 'vals = [str(i) for i in records])'.
Also the above code which I found on the internet is the syntax for MySQL and not Oracle. I think I would need to select from dual for the values on the fly
cur.execute(('MERGE INTO NETSUITE.NET_TRANSACTION_LINES_EV as Target '
'USING (SELECT * FROM '
'(VALUES vals) '
'AS s (TRANSACTION_ID, TRANSACTION_LINE_ID, UNIQUE_KEY) '
') AS Source '
'ON Target.UNIQUE_KEY = Source.UNIQUE_KEY '
'WHEN NOT MATCHED THEN '
'INSERT (TRANSACTION_ID, TRANSACTION_LINE_ID, UNIQUE_KEY) VALUES (Source.TRANSACTION_ID, Source.TRANSACTION_LINE_ID, Source.UNIQUE_KEY) '
'WHEN MATCHED THEN '
'UPDATE SET TRANSACTION_ID=Source.TRANSACTION_ID, TRANSACTION_LINE_ID =Source.TRANSACTION_LINE_ID;'
.format( vals = [str(i) for i in records])))i am passing values on the fly.My records is has data like this :- [[1,2,3] , [7,8,9], [5,7,8]]
which I am assigning to 'vals = [str(i) for i in records])'.
Also the above code which I found on the internet is the syntax for MySQL and not Oracle. I think I would need to select from dual for the values on the fly
