<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/busting-sql-migration-myths-how-new-sql-features-make-lift-and-shift-to-lakehouse-easier-kxiunoslw" -->

---
title: Busting SQL Migration Myths: How New SQL Features Make...
description: A detailed walkthrough shows how a legacy Oracle stored procedure (with nested cursors, temp tables, and multi-statement transactions) can be translated...
canonical: https://daily.dev/posts/busting-sql-migration-myths-how-new-sql-features-make-lift-and-shift-to-lakehouse-easier-kxiunoslw
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Busting SQL Migration Myths: How New SQL Features Make Lift-and-Shift to Lakehouse Easier | daily.dev
og:description: A detailed walkthrough shows how a legacy Oracle stored procedure (with nested cursors, temp tables, and multi-statement transactions) can be translated...
og:url: https://daily.dev/posts/busting-sql-migration-myths-how-new-sql-features-make-lift-and-shift-to-lakehouse-easier-kxiunoslw
og:image: https://api.daily.dev/og/posts/kxIUnOSLW.png
og:image:alt: Busting SQL Migration Myths: How New SQL Features Make Lift-and-Shift to Lakehouse Easier
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Busting SQL Migration Myths: How New SQL Features Make Lift-and-Shift to Lakehouse Easier

**[databricks](https://daily.dev/sources/databricks)** · 11 min read · 0 upvotes · 0 comments

## Summary

A detailed walkthrough shows how a legacy Oracle stored procedure (with nested cursors, temp tables, and multi-statement transactions) can be translated line-by-line into Databricks SQL scripting rather than rewritten in Python/Spark. It covers procedure syntax differences, session-scoped temp tables, native cursor support (OPEN/FETCH/CLOSE, CONTINUE HANDLER FOR NOT FOUND, LEAVE/ITERATE) added since Databricks Runtime 18.1, and BEGIN ATOMIC blocks that provide transactional semantics with row-level rather than table-level conflict detection (contrasted with Oracle and Snowflake's table-level locking). The piece claims migration timelines can be cut 50-75% and points to an Agentic Code Converter tool to help teams try it on their own procedures.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://www.databricks.com/blog/busting-sql-migration-myths-how-new-sql-features-make-lift-and-shift-lakehouse-easier>

## Questions this post answers

### Does Databricks SQL scripting support cursors like Oracle PL/SQL?

Yes, Databricks SQL scripting supports cursors natively with OPEN, FETCH, and CLOSE syntax since Databricks Runtime 18.1. The Oracle %NOTFOUND attribute maps to a CONTINUE HANDLER FOR NOT FOUND, and loop labels with LEAVE replace EXIT WHEN, allowing legacy cursor-based validation loops to be translated with minimal logic changes.

_Teams migrating Oracle procedures to Databricks can find translation patterns like this shared on daily.dev._

### How do I replace Oracle's GLOBAL TEMPORARY TABLE with ON COMMIT PRESERVE ROWS in Databricks?

Use a session-scoped CREATE TEMP TABLE in Databricks instead, dropping the table first if it needs to be re-runnable in the same session, since CREATE OR REPLACE TEMP TABLE is not yet supported. No EXECUTE IMMEDIATE or ON COMMIT PRESERVE ROWS clause is needed, since the session scoping is implicit.

_Engineers evaluating lakehouse migration options track syntax gaps like this via daily.dev._

### How does transaction locking differ between BEGIN ATOMIC on Databricks and Oracle or Snowflake?

BEGIN ATOMIC on Databricks provides automatic commit on success and rollback on failure with row-level conflict detection, meaning concurrent batches only conflict if they touch the same rows. Oracle and Snowflake instead use table-level locking, which forces serial execution of concurrent batch jobs writing to the same table.

_Anyone weighing lakehouse transaction semantics against Oracle or Snowflake can compare notes on daily.dev._

## Similar posts on daily.dev

- [10 Data Warehouse Migration Myths Blocking AI-readiness \(and Your Blueprint for Seamless Modernization\)](https://daily.dev/posts/10-data-warehouse-migration-myths-blocking-ai-readiness-and-your-blueprint-for-seamless-modernizati-c23bis8g2) · databricks · 0 upvotes · 0 comments
- [Navigating a Synapse Migration to Databricks](https://daily.dev/posts/navigating-a-synapse-migration-to-databricks-twgyvrqdw) · databricks · 0 upvotes · 0 comments
- [Migrate SQL Server multi-result-set procedures to PostgreSQL](https://daily.dev/posts/migrate-sql-server-multi-result-set-procedures-to-postgresql-23i71owdn) · AWS Database Blog · 0 upvotes · 0 comments

---

Tags: [#sql](https://daily.dev/tags/sql), [#big-data](https://daily.dev/tags/big-data), [#databricks](https://daily.dev/tags/databricks)

[View this post on daily.dev](https://daily.dev/posts/busting-sql-migration-myths-how-new-sql-features-make-lift-and-shift-to-lakehouse-easier-kxiunoslw)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"Busting SQL Migration Myths: How New SQL Features Make Lift-and-Shift to Lakehouse Easier","url":"https://daily.dev/posts/busting-sql-migration-myths-how-new-sql-features-make-lift-and-shift-to-lakehouse-easier-kxiunoslw","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/busting-sql-migration-myths-how-new-sql-features-make-lift-and-shift-to-lakehouse-easier-kxiunoslw"},"datePublished":"2026-08-20T19:18:19.946Z","dateModified":"2026-09-14T06:19:06.884Z","description":"A detailed walkthrough shows how a legacy Oracle stored procedure (with nested cursors, temp tables, and multi-statement transactions) can be translated...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/1f5b49cdbb90507a43379b7c56f45317?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/1f5b49cdbb90507a43379b7c56f45317?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"databricks","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"databricks","logo":"https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/fa7aa720f2db4d1eba826814730482c8","url":"https://daily.dev/sources/databricks"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/busting-sql-migration-myths-how-new-sql-features-make-lift-and-shift-to-lakehouse-easier-kxiunoslw","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"sql,big-data,databricks","timeRequired":"PT11M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"databricks","item":"https://daily.dev/sources/databricks"},{"@type":"ListItem","position":3,"name":"Busting SQL Migration Myths: How New SQL Features Make Lift-and-Shift to Lakehouse Easier"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/busting-sql-migration-myths-how-new-sql-features-make-lift-and-shift-to-lakehouse-easier-kxiunoslw#faq","mainEntity":[{"@type":"Question","name":"Does Databricks SQL scripting support cursors like Oracle PL/SQL?","acceptedAnswer":{"@type":"Answer","text":"Yes, Databricks SQL scripting supports cursors natively with OPEN, FETCH, and CLOSE syntax since Databricks Runtime 18.1. The Oracle %NOTFOUND attribute maps to a CONTINUE HANDLER FOR NOT FOUND, and loop labels with LEAVE replace EXIT WHEN, allowing legacy cursor-based validation loops to be translated with minimal logic changes. Teams migrating Oracle procedures to Databricks can find translation patterns like this shared on daily.dev."}},{"@type":"Question","name":"How do I replace Oracle's GLOBAL TEMPORARY TABLE with ON COMMIT PRESERVE ROWS in Databricks?","acceptedAnswer":{"@type":"Answer","text":"Use a session-scoped CREATE TEMP TABLE in Databricks instead, dropping the table first if it needs to be re-runnable in the same session, since CREATE OR REPLACE TEMP TABLE is not yet supported. No EXECUTE IMMEDIATE or ON COMMIT PRESERVE ROWS clause is needed, since the session scoping is implicit. Engineers evaluating lakehouse migration options track syntax gaps like this via daily.dev."}},{"@type":"Question","name":"How does transaction locking differ between BEGIN ATOMIC on Databricks and Oracle or Snowflake?","acceptedAnswer":{"@type":"Answer","text":"BEGIN ATOMIC on Databricks provides automatic commit on success and rollback on failure with row-level conflict detection, meaning concurrent batches only conflict if they touch the same rows. Oracle and Snowflake instead use table-level locking, which forces serial execution of concurrent batch jobs writing to the same table. Anyone weighing lakehouse transaction semantics against Oracle or Snowflake can compare notes on daily.dev."}}]}
```

