Hi Swathi,
Your query is very long and I see a lot of trim :). Since you know the joining condtions and fields very well, an explanation is given in this link:
http://www.info.teradata.com/HTMLPubs/DB_TTU_14_00/index.html#page/General_Reference/B035_1096_111A/Database.26.1885.html
Explanation:
The search condition must fully specify an equality constraint on the primary index and partition column(s) between the source and target table. Other set of conditions must be ANDed with primary index and partition column conditions. If an expression/column is selected for the target primary index in the INSERT part of the MERGE statement, that expression must be matched with the target primary index on the ON clause. Expression should also not involve a non-deterministic UDF/UDM or RANDOM function
Cheers,
Raja
Hi Swathi,
Your query is very long and I see a lot of trim :). Since you know the joining condtions and fields very well, an explanation is given in this link:
http://www.info.teradata.com/HTMLPubs/DB_TTU_14_00/index.html#page/General_Reference/B035_1096_111A/Database.26.1885.html
Explanation:
The search condition must fully specify an equality constraint on the primary index and partition column(s) between the source and target table. Other set of conditions must be ANDed with primary index and partition column conditions. If an expression/column is selected for the target primary index in the INSERT part of the MERGE statement, that expression must be matched with the target primary index on the ON clause. Expression should also not involve a non-deterministic UDF/UDM or RANDOM function
Cheers,
Raja