cancel
Showing results for 
Search instead for 
Did you mean: 
Data Engineering
Join discussions on data engineering best practices, architectures, and optimization strategies within the Databricks Community. Exchange insights and solutions with fellow data engineers.
cancel
Showing results for 
Search instead for 
Did you mean: 

parsing error in Databricks SQL endpoint

Vijesh
New Contributor II

I have two tables EMPLOYEE & EMPLOYEE_ROLE. I'm trying to Update a column with a value from another column. I'm using SQL server join but i get an error -

[parse_syntax_error] Syntax error at or near 'FROM' line 3.

UPDATE C

SET C.title = B.title

FROM EMPLOYEE C

INNER JOIN EMPLOYEE_ROLE B

ON C.emp_id = B.emp_id

AND C.emp_name = B.emp_name

5 REPLIES 5

poet_RY
New Contributor III

From the documentation, update statement is only supported for Delta Lake tables.

https://docs.databricks.com/sql/language-manual/delta-update.html. Can you check if your tables are delta

Vijesh
New Contributor II

Yes they are delta tables

Anonymous
Not applicable

Hi @Vijesh V​ 

Thank you for posting your question in our community! We are happy to assist you.

To help us provide you with the most accurate information, could you please take a moment to review the responses and select the one that best answers your question?

This will also help other community members who may have similar questions in the future. Thank you for your participation and let us know if you need any further assistance! 

kumarPerry
New Contributor II

@Vijesh V​ , you can use merge statement like below code snipplet:

merge into EMPLOYEE C

using EMPLOYEE_ROLE B

ON C.emp_id = B.emp_id AND C.emp_name = B.emp_name

when matched then

update set  C.title = B.title

sensanjoy
Contributor

Hi @Vijesh V​ 

Try to use merge into to perform cdc between tables :

MERGE INTO target a

USING source b

ON {merge_condition}

WHEN MATCHED THEN {matched_action}

WHEN NOT MATCHED THEN {not_matched_action}

Connect with Databricks Users in Your Area

Join a Regional User Group to connect with local Databricks users. Events will be happening in your city, and you won’t want to miss the chance to attend and share knowledge.

If there isn’t a group near you, start one and help create a community that brings people together.

Request a New Group