Could you try below like syntax -
select * from data_source_table where LastModifytime > '@{activity('LookupOldWaterMarkActivity').output.firstRow.WatermarkValue}'
Please don't forget to Accept Answer and Up-vote if the response helped -- Vaibhav
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
I have a pipeline on Data Factory with two modules.
Query:
SELECT * FROM Event WHERE LastModifiedDate IS NOT NULL AND LastModifiedDate < @activity('LastModifiedDate-Event').output.firstRow.LastModifiedDate Limit 10
No matter how I restructure the query I get variety of errors.
Failure happened on 'Source' side. ? ErrorCode=UserErrorOdbcOperationFailed,'Type=Microsoft.DataTransfer.Common.Shared.HybridDeliveryException,Message=ERROR [22018] [Microsoft][Support] (40550) Invalid character value for cast specification.,Source=Microsoft.DataTransfer.ClientLibrary.Odbc.OdbcConnector,''Type=System.Data.Odbc.OdbcException,Message=ERROR [22018] [Microsoft][Support] (40550) Invalid character value for cast specification.,Source=Microsoft Salesforce ODBC Driver,'
SELECT TOP 1000 * FROM Event WHERE LastModifiedDate IS NOT NULL AND LastModifiedDate < @activity("LastModified-Event").output.firstRow.LastModifiedDate ORDER BY LastModifiedDate DESC
Failure happened on 'Source' side. ErrorCode=UserErrorOdbcOperationFailed,'Type=Microsoft.DataTransfer.Common.Shared.HybridDeliveryException,Message=ERROR [HY000] [Microsoft][Salesforce] (120) SOQL_FIRST mode prepare failure: SOQL error: [Microsoft][SQLEngine] (31480) syntax error near 'SELECT TOP 1000<<< ??? >>> * FROM Event WHERE LastModifiedDate ISÂ NOTÂ NULL AND LastModifiedDate < @activity("LastModified-Event").output.firstRow.LastModifiedDate ORDER BY LastModifiedDate DESC'. SQL error: [Microsoft][SQLEngine] (31480) syntax error near 'SELECT TOP 1000 * FROM Event WHERE LastModifiedDate ISÂ NOTÂ NULL<<< ??? >>> AND LastModifiedDate < @activity("LastModified-Event").output.firstRow.LastModifiedDate ORDER BY LastModifiedDate DESC'.,Source=Microsoft.DataTransfer.ClientLibrary.Odbc.OdbcConnector,''Type=System.Data.Odbc.OdbcException,Message=ERROR [HY000] [Microsoft][Salesforce] (120) SOQL_FIRST mode prepare failure: SOQL error: [Microsoft][SQLEngine] (31480) syntax error near 'SELECT TOP 1000<<< ??? >>> * FROM Event WHERE LastModifiedDate ISÂ NOTÂ NULL AND LastModifiedDate < @activity("LastModified-Event").output.firstRow.LastModifiedDate ORDER BY LastModifiedDate DESC'. SQL error: [Microsoft][SQLEngine] (31480) syntax error near 'SELECT TOP 1000 * FROM Event WHERE LastModifiedDate ISÂ NOTÂ NULL<<< ??? >>> AND LastModifiedDate < @activity("LastModified-Event").output.firstRow.LastModifiedDate ORDER BY LastModifiedDate DESC'.,Source=Microsoft Salesforce ODBC Driver,'
Sorry for the giant images. Please let me know if you see any issues with the query.
Could you try below like syntax -
select * from data_source_table where LastModifytime > '@{activity('LookupOldWaterMarkActivity').output.firstRow.WatermarkValue}'
Please don't forget to Accept Answer and Up-vote if the response helped -- Vaibhav
One of the errors is shown for TOP. Try adding parentheses: ‘SELECT TOP(1000)…’.
Another error is about “IS NOT NULL”. Maybe this “” denotes a special space. Try removing and retyping this fragment.
Also make sure that the compared values represent valid date. Maybe even try some investigations with literal dates, such as “SELECT … AND LastModifiedDate < ’2020-12-17 09:31:26’”. Or start with the simplest query that works (SELECT * FROM Event), then add other parts gradually.