Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

What is the syntax required for the creation of a cursor?

Answer Posted / prasad

Example For cursor Syntax:

Declare Cursor:

EXEC SQL DECLARE CUST_ITM CURSOR
FOR
SELECT
OWN_CUS_NO,

OWN_CUS_ITM_SUF_NO
FROM
NPJXTII
WHERE SCK_NO = :SCK-
NO
AND SCK_DT = :NPS-ORIG-TRANS-
DT

AND SCK_LN_ITM_SEQ_NO = :SCK-LN-ITM-SEQ-
NO

END-
EXEC.

Open Cursor:

EXEC SQL OPEN CUST_ITM
END-EXEC.

Fetch Cursor:

EXEC SQL FETCH CUST_ITM
INTO :OWN-CUS-NO,
:OWN-CUS-ITM-SUF-NO
END-EXEC.


Close Cursor:

EXEC SQL CLOSE CUST_ITM
END-EXEC.

Is This Answer Correct ?    12 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the difference between drop table and delete table?

1212


Mention data types used in db2 ?

1161


DB2 can implement a join in three ways using a merge join, a nested join or a hybrid join. Explain the differences?

2852


If I have a view which is a join of two or more tables, can this view be updateable?

1139


File not opened because library is *PROD and debug is UPDPROD(*NO). ? what may be the reason? how to solve it..?

2947


What does db2 stand for?

1026


Why do we need reorg in db2?

989


What is commit in db2?

1058


What is the use of predicate?

1043


What is a plan and package in db2?

1104


Name the various locking levels available?

1093


How can you count the number of rows from a table tab?

1093


Is db2 free?

1096


How to create db2 table in mainframe?

1154


Is db2 a mainframe database?

1002