[QODBC-Desktop] Troubleshooting - Correlated subqueries in UPDATE Statement
Posted by Jack - QODBC Support on 30 March 2016 10:16 AM
|
|
Troubleshooting - Correlated subqueries in the UPDATE StatementProblem Description:I want to update the salesrep field in my existing invoices. I want to use the salesrep value stored in the Customer file. I would normally do this in SQL using a correlated subquery. When I run the following query: update Invoice set SalesReprefFullName = (select SalesRepRefFullName from Customer where Invoice.CustomerrefFullName = Company.FullName), I get the following error: [QODBC] Expected lexical element not found: Solution:Sorry, even your nested SELECT statement is invalid. It would be best if you always referenced the TxnID for all update operations using QODBC. For example, for Invoices, the update operation would look like this: | |
|