View previous topic :: View next topic
|
Author |
Message |
johnsingh
New User
Joined: 11 May 2005 Posts: 22
|
|
|
|
hi,
1> How to link with db2 and cobol and what is utility to link between them.
2> What is plan.
3> what is cursor.
Thanking in advance. |
|
Back to top |
|
|
Rupesh.Kothari
Member of the Month
Joined: 27 Apr 2005 Posts: 463
|
|
|
|
HI,
DB2 has a mechanism called a cursor to allow an application program to
retrieve a set of rows. You can use a cursor to retrieve rows from a table
or from a result set returned by a stored procedure.
You can retrieve and process a set of rows that satisfy the search conditions of an SQL statement. However, when you use a program to select the rows, the program cannot process all the rows at once. The program must process the rows one at a time.
For more information refer manual for DB2
Regards
Rupesh |
|
Back to top |
|
|
Anbudan
New User
Joined: 07 Sep 2005 Posts: 26 Location: Germany
|
|
|
|
2> What is plan.
Hi
Plan is used for DB2 Pgms.
You have to create Package and plan for a DB2 pgm.
Anbudan |
|
Back to top |
|
|
johnsingh
New User
Joined: 11 May 2005 Posts: 22
|
|
|
|
hi all,
Thanks of valuable time. |
|
Back to top |
|
|
anadhamohan
New User
Joined: 27 Sep 2005 Posts: 25 Location: india
|
|
|
|
hi john,
The utility used to join cobol & db2 is IKJEFT01, you have to use this in JCL segment in the exec statment to make this work, also there is other utility called DSNHPC which is also used to join cobol-db2.
Impossible is often Untried |
|
Back to top |
|
|
karthi_ind
Active User
Joined: 24 Feb 2004 Posts: 131 Location: Chennai
|
|
|
|
Hi,
Cursor is used to retrieve more that one rows. The steps involved in cursor is
1) Declare cursor
2) Open cursor - Which activates Cursor
3) Fetch cursor - Retrieves rows frm Table
4) Close cursor
Once commit is issued , cursor vll be closed. To avoid this thre is an option in cursor, WITH HOLD option.
If you want to update particular columns in a table, u can specify it
in the cursor by using FOR UPDATE OF option.
Suppose if u want to update or delete a particular row in a cursor u can use use WHERE CURRENT OF cursor name OPTION .
In a COBOL-DB2 program if u are not using cursor for retrieving more than one row. instead ur usng Select u will get -811 SQLCODE.
which means Select retrieves more than one rows.
Corrections are welcome....
Karthi G. |
|
Back to top |
|
|
|