How to push TIBCO Data Virtualization ADD_MONTHS function to Microsoft SQL Server?

How to push TIBCO Data Virtualization ADD_MONTHS function to Microsoft SQL Server?

book

Article ID: KB0076320

calendar_today

Updated On:

Products Versions
TIBCO Data Virtualization All supported versions

Description

This article explains about the process of pushing the TDV ADD_MONTHS function into the SQL Server data source.

Resolution

The corresponding SQL Server function for the TDV ADD_MONTH () is DATEADD(datepart, number, date) function .
Example:

TDV: ADD_MONTHS('2012-06-01', 3)
SQL Server: DATEADD(month, 3, '2012-06-01')

Copy the following code snippet entry under "[TDV Install  Directory]/conf/adapters/custom/sqlserver[version]/sqlserver_[version]_values.xml" , save the file and then restart the TDV services.
<common:attribute xmlns:common="http://www.compositesw.com/services/system/util/common">
<common:name>/custom/ADD_MONTHS(@date,~number)</common:name>
<common:type>STRING</common:type>
<common:value>DATEADD(month,$2,$1)</common:value>
<common:configID>ADD_MONTHS(@date,~number)</common:configID>
</common:attribute>
<ns1:attribute xmlns:ns1="http://www.compositesw.com/services/system/util/common">
<ns1:name>/custom/ADD_MONTHS(@timestamp,~number)</ns1:name>
<ns1:type>STRING</ns1:type>
<ns1:value>DATEADD(month,$2,$1) </ns1:value>
<ns1:configID>ADD_MONTHS(@timestamp,~number)</ns1:configID>
</ns1:attribute

Issue/Introduction

How to push TIBCO Data Virtualization ADD_MONTHS function to Microsoft SQL Server?