---
title: "Here’s Difference Between Describe Vs. Declare Cursor in DB2"
description: "The DESCRIBE CURSOR  -statement obtains information about the result set that is associated with the cursor. The information, such as column information, is put into a descriptor. DESCRIBE. Use DESCRI..."
url: https://srinimf.com/2015/12/25/2-best-differences-of-db2-declare-cursor-and-describe-cursor/
date: 2015-12-25
modified: 2026-10-10
author: "Srini"
image: https://i0.wp.com/srinimf.com/wp-content/uploads/2015/12/pexels-photo-3776180.jpeg?fit=1880%2C1253&ssl=1
categories: ["DB2"]
tags: ["Declare Cursor Vs Describe Cursor in DB2"]
type: post
lang: en
---

# Here’s Difference Between Describe Vs. Declare Cursor in DB2

The **DESCRIBE CURSOR** -statement obtains information about the result set that is associated with the cursor. The information, such as column information, is put into a descriptor.

## DESCRIBE

Use DESCRIBE CURSOR for result set cursors from **stored procedure**s. The cursor must be defined with the ALLOCATE CURSOR statement.

**Example 1:**

Place information about the result set associated with cursor C1 into the descriptor named by :sqlda1.

Related[How to access “IMS DB” database using SQL Queries(1 of 2)](https://srinimf.com/2015/10/06/how-to-access-ims-db-database-using-sql-queries1-of-2/)

```
EXEC SQL DESCRIBE CURSOR C1 INTO :sqlda1
```

**Example 2:**

Place information about the result set associated with the cursor named by :hv1 into the descriptor named by :sqlda2.

```
EXEC SQL DESCRIBE CURSOR :hv1 INTO :sqlda2
```

So, the [DESCRIBE CURSOR ](http://www.ibmsystemsmag.com/ibmi/developer/general/Better-Results/?page=4) is a part of Stored procedures.

## DECLARE

The **DECLARE CURSO**R statement -defines a cursor. This statement can only be embedded in an application program. It is not an executable statement. It must not be specified in Java.

Related posts

- [PLI program using DB2 top ideas](https://srinimf.com/2012/08/23/pl1-db2-program-coding/)DateAugust 23, 2012
- [Two Types of PLSQL Cursors: What are those?](https://srinimf.com/2022/01/23/two-types-of-plsql-cursors-what-are-those/)DateJanuary 23, 2022
- [DB2 Rowset to Fetch Multi-rows Easily](https://srinimf.com/2010/10/16/db2-we-can-fetch-multi-rows-with-cursor/)DateOctober 16, 2010

### Share this:

-
- [Tweet](https://twitter.com/share)
- [![](https://i0.wp.com/assets.pinterest.com/images/pidgets/pinit_fg_en_rect_gray_20.png)](https://www.pinterest.com/pin/create/link/?url=https%3A%2F%2Fsrinimf.com%2F2015%2F12%2F25%2F2-best-differences-of-db2-declare-cursor-and-describe-cursor%2F&media=https%3A%2F%2Fi0.wp.com%2Fsrinimf.com%2Fwp-content%2Fuploads%2F2015%2F12%2Fpexels-photo-3776180.jpeg%3Ffit%3D1200%252C800%26ssl%3D1&description=Here%27s%20Difference%20Between%20Describe%20Vs.%20Declare%20Cursor%20in%20DB2)
-
- [Share on Tumblr](https://www.tumblr.com/share)
- [Share on WhatsApp (Opens in new window) WhatsApp](https://srinimf.com/2015/12/25/2-best-differences-of-db2-declare-cursor-and-describe-cursor/?share=jetpack-whatsapp)
- [More](#)
-

- [Print (Opens in new window) Print](https://srinimf.com/2015/12/25/2-best-differences-of-db2-declare-cursor-and-describe-cursor/?share=print)
- [Share on Reddit (Opens in new window) Reddit](https://srinimf.com/2015/12/25/2-best-differences-of-db2-declare-cursor-and-describe-cursor/?share=reddit)
- [Share on Telegram (Opens in new window) Telegram](https://srinimf.com/2015/12/25/2-best-differences-of-db2-declare-cursor-and-describe-cursor/?share=telegram)
- [Email a link to a friend (Opens in new window) Email](mailto:?subject=%5BShared%20Post%5D%20Here%27s%20Difference%20Between%20Describe%20Vs.%20Declare%20Cursor%20in%20DB2&body=https%3A%2F%2Fsrinimf.com%2F2015%2F12%2F25%2F2-best-differences-of-db2-declare-cursor-and-describe-cursor%2F&share=email)
-

### Like this:

Like Loading…