cancel
Showing results for 
Search instead for 
Did you mean: 
Data Engineering
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}

Welcome to Databricks Community: Lets learn, network and celebrate together

Join our fast-growing data practitioner and expert community of 80K+ members, ready to discover, help and collaborate together while making meaningful connections. 

Click here to register and join today! 

Engage in exciting technical discussions, join a group with your peers and meet our Featured Members.