Joined: 01 Sep 2006 Posts: 2104 Location: Silicon Valley
I finally read the manual.
INCLUDE can only be specified when the
MERGE statement is nested in the FROM clause of a SELECT statement.
But how do I resolve my -433 problem? The NAME column is VARCHAR(128)
MERGE INTO PEDRO.TABLE1 AS A
VALUES ( 168 ,'TB','QUOC7001','TBOC7001_BASE','' ,'' )) AS B
(SCOPEID,TYPE,QUALIFIER ,NAME , COLNAME,AUTHLEVEL)
ON A.SCOPEID = B.SCOPEID
AND A.TYPE = B.TYPE
AND A.QUALIFIER = B.QUALIFIER
AND A.NAME = B.NAME
WHEN NOT MATCHED
INSERT( SCOPEID, TYPE, QUALIFIER, NAME, COLNAME, AUTHLEVEL)
(B.SCOPEID, B.TYPE, B.QUALIFIER, B.NAME, B.COLNAME, B.AUTHLEVEL)