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}

Join 100K+ Data Experts: Register Now & Grow with Us!

Excited to expand your horizons with us? Click here to Register and begin your journey to success!

Already a member? Login and join your local regional user group! If there isn’t one near you, fill out this form and we’ll create one for you to join!