PASSTHRU('MERGE INTO ASADE.SIMPLE TA USING ( SELECT ( SNO) FROM ASADE.SIMPLE) AC ON ( TA.SNO = SNO )WHEN MATCHED THEN UPDATE SET TA.SNAME = '||SNAME||' WHEN NOT MATCHED
THEN INSERT(SNO,SNAME) VALUES('|| SNO ||','||SNAME||')');
I was trying on the same lines but was not able to achieve it.
Joined: 10 Feb 2003 Posts: 6076 Location: Somewhere over the Rainbow this side of Never-never land.
I'd build the SQL as a complete string and then pass it to passthru.
Then in the debugger or via user trace you can see the complete string easily and check for syntax errors. _________________ WMQ User since 1999
MQSI/WBI/WMB/'Thingy' User since 2002
Linux user since 1995
Every time you reinvent the wheel the more square it gets (anon). If in doubt think and investigate before you ask silly questions.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum