parsing error in Databricks SQL endpoint
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-10-2023 10:51 PM
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
- Labels:
-
Databricks SQL
-
DBSQL
-
SQL
-
SQL Endpoint
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-11-2023 12:09 AM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-11-2023 03:04 AM
Yes they are delta tables

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-11-2023 06:54 AM
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!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-11-2023 11:09 AM
@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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-12-2023 09:50 AM
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}

