i have the query for external object named as test__x.
I am writing the query to get the data using OData 4.0 in external data sourse by applying the NOT EQUAL TO logic with != OR <> OR NOT IN operators then facing an error stating as below.
SQL:
select id,status__c from current_year_order_summary__x where status__c NOT IN('C') LIMIT 2000
Error:
"Error received from the external system: 500:
com.informatica.cloud.api.adapter.runtime.exception.ReadException:
java.sql.SQLException: [Teradata Database] [TeraJDBC 15.10.00.14]
[Error 3707] [SQLState 42000] Syntax error, expected something like a
'SUCCEEDS' keyword or a 'MEETS' keyword or a
'PRECEDES' keyword or an 'IN' keyword or a
'CONTAINS' keyword between the word 'status__c ' and
'|'."
In OData 4, the equality and inequality operators are eq and ne.
Related
I'm using SQLAlchemy UNION, ORDER_BY is not working, it throwing this
error
Can't resolve label reference for ORDER BY/ GROUP BY/ DISTINCT etc. Textual SQL expression 'LastName' should be explictly declared as text('LastName')
query1 = db.query(Employee.LastName).filter(Employee.Age == 30)
query2 = db.query(Employee.LastName).filter(Employee.Salary > 25000)
result = query1.union(query2).order_by('LastName').all()
Then I tried the below line too, but it didn't work, its throwing this error
(pyodbc.ProgrammingError)('42S22',"[42S22][Microsoft][ODBC Driver 17 for SQL Server][SQL Server] invalid column name 'LastName'. [SQL Server] Statement(s) could not be prepared. (8180)
result = query1.union(query2).order_by(text('LastName').all()
I have the following code:
$extracting = $dbNew->query("SELECT *, Format(Date_Sheet, 'Short Date') AS modifiedDate FROM AccessDB WHERE modifiedDate LIKE '%2021%'");
Having the following error:
Fatal error: Uncaught PDOException: SQLSTATE[07002]: COUNT field incorrect: -3010 [Microsoft Access Driver] Too few parameters. Expected 1.
The problem is the "modifiedDate" because if I replace it with the "Date_Sheet" access field after the database table, I can run the query without issues.
Thank you in advance!
I'm working in Azure Data Factory V2, attempting to query from a Salesforce object where the LastModifiedDate in the object is greater than or equal to a recent date. I've been receiving syntax errors on extremely simple SOQL queries, queries that work just fine in Salesforce Workbench. Below, I've listed examples of queries I've run in the ADF Copy Data activity, along with the errors I received when debugging the pipeline.
Query 1
Select Id from "Object" WHERE LastModifiedDate >=
#{formatDateTime(activity('Yesterday').output.firstRow.Yesterday,'yyyy-MM-ddTHH:mm:ssZ')}
Result 1
{
"errorCode": "2200",
"message": "Failure happened on 'Source' side. ErrorCode=UserErrorOdbcOperationFailed,'Type=Microsoft.DataTransfer.Common.Shared.HybridDeliveryException,Message=ERROR [HY000] [Microsoft][Salesforce] (120) SOQL_FIRST mode prepare failure:\nSOQL error: [Microsoft][Salesforce] (30) Syntax error or access violation when parsing SOQL.\nSQL error: [Microsoft][SQLEngine] (31480) syntax error near 'Select Id from \"Object\" WHERE LastModifiedDate >= 2018-08-13T16<<< ??? >>>:05:06Z'.,Source=Microsoft.DataTransfer.ClientLibrary.Odbc.OdbcConnector,''Type=System.Data.Odbc.OdbcException,Message=ERROR [HY000] [Microsoft][Salesforce] (120) SOQL_FIRST mode prepare failure:\nSOQL error: [Microsoft][Salesforce] (30) Syntax error or access violation when parsing SOQL.\nSQL error: [Microsoft][SQLEngine] (31480) syntax error near 'Select Id from \"Object\" WHERE LastModifiedDate >= 2018-08-13T16<<< ??? >>>:05:06Z'.,Source=Microsoft Salesforce ODBC Driver,'",
"failureType": "UserError",
"target": "Event Fix Pipeline"
}
Query 2
SELECT Id FROM "Object" WHERE LastModifiedDate >= 2018-08-14T00:00:00Z
Result 2
{
"errorCode": "2200",
"message": "Failure happened on 'Source' side. ErrorCode=UserErrorOdbcOperationFailed,'Type=Microsoft.DataTransfer.Common.Shared.HybridDeliveryException,Message=ERROR [HY000] [Microsoft][Salesforce] (120) SOQL_FIRST mode prepare failure:\nSOQL error: [Microsoft][Salesforce] (30) Syntax error or access violation when parsing SOQL.\nSQL error: [Microsoft][SQLEngine] (31480) syntax error near 'SELECT Id FROM \"Object\" WHERE LastModifiedDate >= 2018-08-14T00<<< ??? >>>:00:00Z'.,Source=Microsoft.DataTransfer.ClientLibrary.Odbc.OdbcConnector,''Type=System.Data.Odbc.OdbcException,Message=ERROR [HY000] [Microsoft][Salesforce] (120) SOQL_FIRST mode prepare failure:\nSOQL error: [Microsoft][Salesforce] (30) Syntax error or access violation when parsing SOQL.\nSQL error: [Microsoft][SQLEngine] (31480) syntax error near 'SELECT Id FROM \"Object\" WHERE LastModifiedDate >= 2018-08-14T00<<< ??? >>>:00:00Z'.,Source=Microsoft Salesforce ODBC Driver,'",
"failureType": "UserError",
"target": "Event Fix Pipeline"
}
What could be causing this syntax error?
Removing the quotation marks around Object seems to solve your problem.
SELECT Id FROM Object WHERE LastModifiedDate >= 2018-08-14T00:00:00Z.
I tested the query with quotation marks in Salesforce Developer Console and got "Unknown error parsing query", so I believe it's an invalid SOQL query with the quotation marks.
Lol, In my case it was a semicolon at the end of the SOQL statement.
Very often we are unable to use Partitioned reads in Netezza connector.
Example
When partitioned read = Yes and Generated SQL at Runtime = Yes this works:
SELECT "Firma", "KundeNr", "ArtikkelNr"," LagerstedNr"
FROM dwhusr."TI_FT_Salg"
When Generated SQL at Runtime = No and the query is Autogenerated by DataStage (or we write it our selves) the query looks like this:
SELECT "Firma", "KundeNr", "ArtikkelNr"," LagerstedNr"
FROM dwhusr."TI_FT_Salg"
WHERE mod(datasliceid,[[node-count]])=[[node-number]]
It will then throw an error:
DB_TI_FT_Salg: Unexpected ODBC error occurred. Reason: [SQLCODE=42000][Native=27] ERROR: 'SELECT "Firma", "KundeNr", "ArtikkelNr"," LagerstedNr" FROM dwhusr."TI_FT_Salg" where mod(datasliceid,[[node-count]])=[[node-number]] limit 0'
error ^ found "[" (at char 102) expecting an identifier found a keyword (CC_NZMetadataHelper::describeResultSet, file CC_NZMetadataHelper.cpp, line 5 622)
Please help!
Getting this error with the following query in SQL Server 2012.
AND Invoice_Header.Invoice_date >= '2005-02-28'
AND(LTRIM(RTRIM(#carrierselect)))
--Error on this line of code
AND CATEGORY IN ('MEDP', 'MEDG')
AND invoice_status_code <> 'L'
Your error is here:
AND(LTRIM(RTRIM(#carrierselect)))
You do not have any comparison that will result to a boolean value. You must have forgotten to put something there:
AND(LTRIM(RTRIM(#carrierselect))) = 'something'