[QODBC-Desktop] Troubleshooting - Correlated subqueries in UPDATE Statement
Posted by Jack - QODBC Support on 30 March 2016 10:16 AM
|
|
Troubleshooting - Correlated subqueries in UPDATE StatementProblem Description:I would like to update the salesrep field in my existing invoices. I would like to use the salesrep value that is 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. You always need to reference the TxnID for all update operations you using QODBC. For example for Invoices the update operation would look like this: | |
|