

{"id":27182,"date":"2018-09-03T10:05:01","date_gmt":"2018-09-03T10:05:01","guid":{"rendered":"https:\/\/data-flair.training\/blogs\/?p=27182"},"modified":"2021-03-11T21:00:36","modified_gmt":"2021-03-11T15:30:36","slug":"cursor-in-sql","status":"publish","type":"post","link":"https:\/\/data-flair.training\/blogs\/cursor-in-sql\/","title":{"rendered":"Cursor in SQL &#8211; Types, Uses, and Terminologies"},"content":{"rendered":"<p>In this tutorial, we will try to learn about the Cursors in SQL. In this article, we will learn in-depth about the Cursor, its types and properties. We will also have a look at the steps we need to follow to create and use a cursor. Let us now dive into Cursors in SQL.<\/p>\n<h3>What are Cursors in SQL?<\/h3>\n<p>Cursors are user-defined iterative variables that allow us to access the query results or the results of the stored procedure.<\/p>\n<p>Cursors are objects we define using a Declare statement and take a Select statement as the parameter. The Select statement returns the result, which then becomes the iterator space of the cursor.<\/p>\n<p>Cursors are supported on the stored procedures.<\/p>\n<p>To understand stored procedures in detail, make sure to have a look at the stored procedure tutorial. They are read-only variables and are helpful to read the data i.e., they can\u2019t update, delete or insert the records.<\/p>\n<h3>Properties of SQL Cursors<\/h3>\n<p>Some of the major properties of SQL cursors are as follows:<\/p>\n<p><strong>1. Asensitive<\/strong><\/p>\n<p>We have two types of cursors available to us one is Asensitive Cursor and the other variation is the Insensitive Cursor.<\/p>\n<p>An asensitive cursor points to the data, while the insensitive cursor creates and uses a temporary copy of the data.<\/p>\n<p>An asensitive cursor is faster and efficient than the insensitive cursor because it avoids making a temporary copy of data.<\/p>\n<p>While using asensitive cursor, we need to be careful as if we update the data when a asensitive cursor is at work, the data would update and the results could cause ambiguity. SQL cursor is asensitive.<\/p>\n<p><strong>2. Read-only<\/strong><\/p>\n<p>When we talk about the SQL cursor, it is read-only i.e., it is not able to update, or delete the data.<\/p>\n<p>Cursors are read-only objects and thus can\u2019t update, delete or insert data in the database.<\/p>\n<p><strong>3. Non-scrollable<\/strong><\/p>\n<p>The SQL cursor is non-scrollable i.e, we can traverse only in one direction. Also, we can&#8217;t skip the rows or jump to rows in the query result.<\/p>\n<p>When we use a cursor, we can\u2019t access the data in reverse order as random access is under the check of the controller. Also, we don\u2019t have the freedom to jump to specific result sets in the query output.<\/p>\n<h3>Types of Cursor<\/h3>\n<p><strong>1. Explicit Cursor<\/strong><\/p>\n<p>An explicit cursor requires a declaration by the user by the use of the SELECT statement. It goes over each record but only a single row is processed at a time. Once the reading of one row is complete it moves to another row.<\/p>\n<p><strong>2. Implicit Cursor<\/strong><\/p>\n<p>An implicit cursor is put internally by SQL whenever the user runs any DML query. Also, implicit cursors are made for one single row of the database.<\/p>\n<p>Thus, implicit cursors are put on a trigger whenever one column is being shown by the Select statement.<\/p>\n<h3>Demo Database<\/h3>\n<p>Let us now have a look at our demo database &#8211; DataFlair.<br \/>\n<strong>Query:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">USE DataFlair;\r\nSELECT * FROM DataFlair ;\r\n<\/pre>\n<p><strong>Output:<\/strong><\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/09\/demo-database.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-87005\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/09\/demo-database.png\" alt=\"SQL Demo Database\" width=\"1920\" height=\"1032\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/09\/demo-database.png 1920w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/09\/demo-database-300x161.png 300w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/09\/demo-database-1024x550.png 1024w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/09\/demo-database-150x81.png 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/09\/demo-database-768x413.png 768w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/09\/demo-database-1536x826.png 1536w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/09\/demo-database-720x387.png 720w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/09\/demo-database-520x280.png 520w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/09\/demo-database-320x172.png 320w\" sizes=\"auto, (max-width: 1920px) 100vw, 1920px\" \/><\/a><\/p>\n<h3>Cursors in Deep<\/h3>\n<p>Let us now look at the steps of creating and using a cursor:<\/p>\n<ul>\n<li>\n<h4>How to create a Cursor in SQL<\/h4>\n<\/li>\n<\/ul>\n<p><strong>Syntax:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">DECLARE cursor_name CURSOR FOR select_statement ;\r\n<\/pre>\n<p><strong>Example:<\/strong> Let us now create a cursor called DataFlair_emp using our DataFlair database to find the details of the employees at DataFlair.<br \/>\n<strong>Query:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">DELIMITER \/\/\r\nCREATE PROCEDURE DataFlair_emp()\r\nBEGIN\r\n    Declare ID varchar(5);\r\n    Declare cur1 CURSOR FOR  SELECT emp_id FROM DataFlair;\r\n    SELECT *  FROM DataFlair;\r\nEND \/\/\r\nDELIMITER ;\r\n\r\n<\/pre>\n<p><strong>Output:<\/strong><\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/09\/open-a-cursor.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-87006\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/09\/open-a-cursor.png\" alt=\"Create cursor in SQL\" width=\"1920\" height=\"1032\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/09\/open-a-cursor.png 1920w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/09\/open-a-cursor-300x161.png 300w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/09\/open-a-cursor-1024x550.png 1024w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/09\/open-a-cursor-150x81.png 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/09\/open-a-cursor-768x413.png 768w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/09\/open-a-cursor-1536x826.png 1536w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/09\/open-a-cursor-720x387.png 720w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/09\/open-a-cursor-520x280.png 520w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/09\/open-a-cursor-320x172.png 320w\" sizes=\"auto, (max-width: 1920px) 100vw, 1920px\" \/><\/a><\/p>\n<ul>\n<li>How to fetch a Cursor in SQL<\/li>\n<\/ul>\n<p><strong>Syntax:\u00a0<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">FETCH cursor_name INTO var_name;\r\n<\/pre>\n<p><strong>Example:<\/strong> Let us now try to fetch the extracted data from the Select statement into the ID variable.<br \/>\n<strong>Query:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">DELIMITER \/\/\r\nCREATE PROCEDURE DataFlair_emp()\r\nBEGIN\r\n    Declare ID varchar(5);\r\n    Declare cur1 CURSOR FOR  SELECT emp_id FROM DataFlair;\r\n    SELECT *  FROM DataFlair;\r\n    OPEN cur1;\r\n    FETCH cur1 INTO ID;\r\nEND \/\/\r\nDELIMITER ;\r\n<\/pre>\n<p><strong>Output:<\/strong><\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/09\/fetch-from-a-cursor.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-87008\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/09\/fetch-from-a-cursor.png\" alt=\"Fetch Cursor in SQL\" width=\"1920\" height=\"1032\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/09\/fetch-from-a-cursor.png 1920w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/09\/fetch-from-a-cursor-300x161.png 300w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/09\/fetch-from-a-cursor-1024x550.png 1024w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/09\/fetch-from-a-cursor-150x81.png 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/09\/fetch-from-a-cursor-768x413.png 768w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/09\/fetch-from-a-cursor-1536x826.png 1536w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/09\/fetch-from-a-cursor-720x387.png 720w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/09\/fetch-from-a-cursor-520x280.png 520w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/09\/fetch-from-a-cursor-320x172.png 320w\" sizes=\"auto, (max-width: 1920px) 100vw, 1920px\" \/><\/a><\/p>\n<p>&nbsp;<\/p>\n<ul>\n<li>\n<h4>How to close a Cursor in SQL<\/h4>\n<\/li>\n<\/ul>\n<p><strong>Syntax:\u00a0<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">CLOSE cursor_name ;\r\n<\/pre>\n<p><strong>Example:<\/strong> Let us now create a procedure which automatically closes the existing cursor.<br \/>\n<strong>Query:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">DELIMITER \/\/\r\nCREATE PROCEDURE DataFlair_emp()\r\nBEGIN\r\n    Declare ID varchar(5);\r\n    Declare cur1 CURSOR FOR  SELECT emp_id FROM DataFlair;\r\n    SELECT *  FROM DataFlair;\r\n    OPEN cur1;\r\n    FETCH cur1 INTO ID;\r\n    CLOSE cur1;\r\nEND \/\/\r\nDELIMITER ;\r\n<\/pre>\n<p><strong>Output:<\/strong><\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/09\/close-a-cursor.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-87009\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/09\/close-a-cursor.png\" alt=\"close a cursor in SQL\" width=\"1920\" height=\"1032\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/09\/close-a-cursor.png 1920w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/09\/close-a-cursor-300x161.png 300w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/09\/close-a-cursor-1024x550.png 1024w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/09\/close-a-cursor-150x81.png 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/09\/close-a-cursor-768x413.png 768w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/09\/close-a-cursor-1536x826.png 1536w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/09\/close-a-cursor-720x387.png 720w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/09\/close-a-cursor-520x280.png 520w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/09\/close-a-cursor-320x172.png 320w\" sizes=\"auto, (max-width: 1920px) 100vw, 1920px\" \/><\/a><\/p>\n<ul>\n<li>\n<h4>How to Deallocate a Cursor in SQL<\/h4>\n<\/li>\n<\/ul>\n<p><strong>Syntax:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">DEALLOCATE cursorName;\r\n<\/pre>\n<p><strong>Example:<\/strong> Let us now deallocate the existing cursor.<br \/>\n<strong>Query:\u00a0<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">DEALLOCATE cur1;\r\n<\/pre>\n<p><strong>Output:<\/strong><\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/09\/deallocation.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-87010\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/09\/deallocation.png\" alt=\"deallocate cursor in SQL\" width=\"1920\" height=\"1032\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/09\/deallocation.png 1920w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/09\/deallocation-300x161.png 300w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/09\/deallocation-1024x550.png 1024w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/09\/deallocation-150x81.png 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/09\/deallocation-768x413.png 768w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/09\/deallocation-1536x826.png 1536w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/09\/deallocation-720x387.png 720w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/09\/deallocation-520x280.png 520w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/09\/deallocation-320x172.png 320w\" sizes=\"auto, (max-width: 1920px) 100vw, 1920px\" \/><\/a><\/p>\n<h3>Summary<\/h3>\n<p>In this tutorial, we have seen how to create a cursor and utilize them. As we have seen in the tutorial, the cursor is only for read-only operations and other operations are held in a restricted mode.<\/p>\n<p>We have seen the properties of cursors and also the steps to create and dispose of the cursor.<\/p>\n<p>In this tutorial, we have seen every step with examples.<\/p>\n<p>We need to follow four major steps for a Cursor i.e Declaration of a cursor, Opening a cursor, fetching the data from the cursor, and at last closing the cursor.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this tutorial, we will try to learn about the Cursors in SQL. In this article, we will learn in-depth about the Cursor, its types and properties. We will also have a look at&#46;&#46;&#46;<\/p>\n","protected":false},"author":6,"featured_media":87004,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[66],"tags":[3216,3217,8917,13436,13437,13543,13544,15037,15678],"class_list":["post-27182","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-sql","tag-cursor-in-sql-example","tag-cusrsor-in-pl-sql","tag-mssql-cursor","tag-sql-cursor-example","tag-sql-cursor-tutorial","tag-sql-server-cursor","tag-sql-server-cursor-example","tag-types-of-cursor-in-sql","tag-what-is-cursor-in-sql"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.8 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Cursor in SQL - Types, Uses, and Terminologies - DataFlair<\/title>\n<meta name=\"description\" content=\"SQL cursor tutorial,what is cursor in SQL,sql server cursor,sql cursor example,Types of cursor in SQL,Use of cursor in SQL,types of locks in SQL\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/data-flair.training\/blogs\/cursor-in-sql\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Cursor in SQL - Types, Uses, and Terminologies - DataFlair\" \/>\n<meta property=\"og:description\" content=\"SQL cursor tutorial,what is cursor in SQL,sql server cursor,sql cursor example,Types of cursor in SQL,Use of cursor in SQL,types of locks in SQL\" \/>\n<meta property=\"og:url\" content=\"https:\/\/data-flair.training\/blogs\/cursor-in-sql\/\" \/>\n<meta property=\"og:site_name\" content=\"DataFlair\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/DataFlairWS\/\" \/>\n<meta property=\"article:published_time\" content=\"2018-09-03T10:05:01+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2021-03-11T15:30:36+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/09\/SQL-Cursor.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1200\" \/>\n\t<meta property=\"og:image:height\" content=\"628\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"DataFlair Team\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@DataFlairWS\" \/>\n<meta name=\"twitter:site\" content=\"@DataFlairWS\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"DataFlair Team\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"5 minutes\" \/>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Cursor in SQL - Types, Uses, and Terminologies - DataFlair","description":"SQL cursor tutorial,what is cursor in SQL,sql server cursor,sql cursor example,Types of cursor in SQL,Use of cursor in SQL,types of locks in SQL","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/data-flair.training\/blogs\/cursor-in-sql\/","og_locale":"en_US","og_type":"article","og_title":"Cursor in SQL - Types, Uses, and Terminologies - DataFlair","og_description":"SQL cursor tutorial,what is cursor in SQL,sql server cursor,sql cursor example,Types of cursor in SQL,Use of cursor in SQL,types of locks in SQL","og_url":"https:\/\/data-flair.training\/blogs\/cursor-in-sql\/","og_site_name":"DataFlair","article_publisher":"https:\/\/www.facebook.com\/DataFlairWS\/","article_published_time":"2018-09-03T10:05:01+00:00","article_modified_time":"2021-03-11T15:30:36+00:00","og_image":[{"width":1200,"height":628,"url":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/09\/SQL-Cursor.jpg","type":"image\/jpeg"}],"author":"DataFlair Team","twitter_card":"summary_large_image","twitter_creator":"@DataFlairWS","twitter_site":"@DataFlairWS","twitter_misc":{"Written by":"DataFlair Team","Est. reading time":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/data-flair.training\/blogs\/cursor-in-sql\/#article","isPartOf":{"@id":"https:\/\/data-flair.training\/blogs\/cursor-in-sql\/"},"author":{"name":"DataFlair Team","@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/person\/2c58ecb4f73a39f0ef993f1ddfcd7b89"},"headline":"Cursor in SQL &#8211; Types, Uses, and Terminologies","datePublished":"2018-09-03T10:05:01+00:00","dateModified":"2021-03-11T15:30:36+00:00","mainEntityOfPage":{"@id":"https:\/\/data-flair.training\/blogs\/cursor-in-sql\/"},"wordCount":716,"commentCount":0,"publisher":{"@id":"https:\/\/data-flair.training\/blogs\/#organization"},"image":{"@id":"https:\/\/data-flair.training\/blogs\/cursor-in-sql\/#primaryimage"},"thumbnailUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/09\/SQL-Cursor.jpg","keywords":["Cursor in SQL Example","Cusrsor in PL SQL","mssql cursor","sql cursor example","SQL cursor tutorial","sql server cursor","sql server cursor example","Types of cursor in SQL","what is cursor in SQL"],"articleSection":["SQL Tutorials"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/data-flair.training\/blogs\/cursor-in-sql\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/data-flair.training\/blogs\/cursor-in-sql\/","url":"https:\/\/data-flair.training\/blogs\/cursor-in-sql\/","name":"Cursor in SQL - Types, Uses, and Terminologies - DataFlair","isPartOf":{"@id":"https:\/\/data-flair.training\/blogs\/#website"},"primaryImageOfPage":{"@id":"https:\/\/data-flair.training\/blogs\/cursor-in-sql\/#primaryimage"},"image":{"@id":"https:\/\/data-flair.training\/blogs\/cursor-in-sql\/#primaryimage"},"thumbnailUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/09\/SQL-Cursor.jpg","datePublished":"2018-09-03T10:05:01+00:00","dateModified":"2021-03-11T15:30:36+00:00","description":"SQL cursor tutorial,what is cursor in SQL,sql server cursor,sql cursor example,Types of cursor in SQL,Use of cursor in SQL,types of locks in SQL","breadcrumb":{"@id":"https:\/\/data-flair.training\/blogs\/cursor-in-sql\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/data-flair.training\/blogs\/cursor-in-sql\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/data-flair.training\/blogs\/cursor-in-sql\/#primaryimage","url":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/09\/SQL-Cursor.jpg","contentUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/09\/SQL-Cursor.jpg","width":1200,"height":628,"caption":"SQL Cursor"},{"@type":"BreadcrumbList","@id":"https:\/\/data-flair.training\/blogs\/cursor-in-sql\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Blog Home","item":"https:\/\/data-flair.training\/blogs\/"},{"@type":"ListItem","position":2,"name":"Searching for Groups of Scala Regex","item":"https:\/\/data-flair.training\/blogs\/tag\/searching-for-groups-of-scala-regex\/"},{"@type":"ListItem","position":3,"name":"Cursor in SQL &#8211; Types, Uses, and Terminologies"}]},{"@type":"WebSite","@id":"https:\/\/data-flair.training\/blogs\/#website","url":"https:\/\/data-flair.training\/blogs\/","name":"DataFlair","description":"Learn Today. Lead Tomorrow.","publisher":{"@id":"https:\/\/data-flair.training\/blogs\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/data-flair.training\/blogs\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/data-flair.training\/blogs\/#organization","name":"DataFlair","url":"https:\/\/data-flair.training\/blogs\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/logo\/image\/","url":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/07\/Data-Flair.png","contentUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/07\/Data-Flair.png","width":106,"height":48,"caption":"DataFlair"},"image":{"@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/DataFlairWS\/","https:\/\/x.com\/DataFlairWS","https:\/\/www.linkedin.com\/company\/dataflair-web-services-pvt-ltd\/","https:\/\/www.youtube.com\/user\/DataFlairWS"]},{"@type":"Person","@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/person\/2c58ecb4f73a39f0ef993f1ddfcd7b89","name":"DataFlair Team","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/1ce4a0e3e542444fc73bbebf83e89e8b73e2d95ccb1fcee64da9945f078b97c5?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/1ce4a0e3e542444fc73bbebf83e89e8b73e2d95ccb1fcee64da9945f078b97c5?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/1ce4a0e3e542444fc73bbebf83e89e8b73e2d95ccb1fcee64da9945f078b97c5?s=96&d=mm&r=g","caption":"DataFlair Team"},"description":"The DataFlair Team provides industry-driven content on programming, Java, Python, C++, DSA, AI, ML, data Science, Android, Flutter, MERN, Web Development, and technology. Our expert educators focus on delivering value-packed, easy-to-follow resources for tech enthusiasts and professionals.","url":"https:\/\/data-flair.training\/blogs\/author\/dfteam2\/"}]}},"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/27182","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/users\/6"}],"replies":[{"embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/comments?post=27182"}],"version-history":[{"count":5,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/27182\/revisions"}],"predecessor-version":[{"id":87011,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/27182\/revisions\/87011"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/media\/87004"}],"wp:attachment":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/media?parent=27182"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/categories?post=27182"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/tags?post=27182"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}