<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Randhir Gupta</title>
    <description>The latest articles on DEV Community by Randhir Gupta (@randhir_gupta_fb4150dd063).</description>
    <link>https://dev.to/randhir_gupta_fb4150dd063</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3551932%2F217feefb-b4d7-4d15-a9d7-a4abe49aab43.jpg</url>
      <title>DEV Community: Randhir Gupta</title>
      <link>https://dev.to/randhir_gupta_fb4150dd063</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/randhir_gupta_fb4150dd063"/>
    <language>en</language>
    <item>
      <title>Automating Database Logic with Triggers + Cursors in Oracle SQL</title>
      <dc:creator>Randhir Gupta</dc:creator>
      <pubDate>Wed, 08 Oct 2025 09:40:47 +0000</pubDate>
      <link>https://dev.to/randhir_gupta_fb4150dd063/automating-database-logic-with-triggers-cursors-in-oracle-sql-4n39</link>
      <guid>https://dev.to/randhir_gupta_fb4150dd063/automating-database-logic-with-triggers-cursors-in-oracle-sql-4n39</guid>
      <description>&lt;p&gt;Oracle SQL is more than just storing and retrieving data — it can react automatically to changes and process multiple rows efficiently.&lt;/p&gt;

&lt;p&gt;In this tutorial, we’ll explore how to automate database logic using:&lt;br&gt;
Triggers – to automatically log or react to changes in a table&lt;br&gt;
Cursors – to process rows one by one in PL/SQL&lt;/p&gt;

&lt;p&gt;Step 1: Create Tables&lt;br&gt;
We’ll start with two tables: one for workers, and one for salary change logs.&lt;br&gt;
Step 2: Insert Sample Data&lt;br&gt;
Step 3: Create a Trigger&lt;br&gt;
Step 4: Test the Trigger&lt;br&gt;
Step 5: Use a Cursor to Loop Through Wor&lt;/p&gt;

&lt;p&gt;Step 6: Key Takeaways&lt;/p&gt;

&lt;p&gt;Triggers can automatically enforce rules or log changes without application code&lt;br&gt;
Cursors allow row-by-row processing for complex logic in PL/SQL&lt;br&gt;
Combining triggers + cursors helps automate workflows like audits, notifications, and reports&lt;br&gt;
Thanks to &lt;a class="mentioned-user" href="https://dev.to/santhoshnc"&gt;@santhoshnc&lt;/a&gt; for his guidance and support&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhvni3bzcnyjif8fuchge.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhvni3bzcnyjif8fuchge.jpg" alt=" " width="800" height="391"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fd7sdcu2v293lepdj6ct5.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fd7sdcu2v293lepdj6ct5.jpg" alt=" " width="800" height="390"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fd6jti44y4a8ur9av2454.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fd6jti44y4a8ur9av2454.jpg" alt=" " width="800" height="391"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2hvr04wsup0lvoetcpcd.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2hvr04wsup0lvoetcpcd.jpg" alt=" " width="800" height="391"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fyr9w5b0xo1y77f2uaw5p.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fyr9w5b0xo1y77f2uaw5p.jpg" alt=" " width="800" height="390"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fj5vytvdwmdds0mhvw0tq.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fj5vytvdwmdds0mhvw0tq.jpg" alt=" " width="800" height="399"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>beginners</category>
      <category>ai</category>
      <category>programming</category>
    </item>
  </channel>
</rss>
