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...


I am getting a error multiple row fetched while executing a
Cobol-DB2 program.How can I solve it without using a cursor.

Answers were Sorted based on User's Feedback



I am getting a error multiple row fetched while executing a Cobol-DB2 program.How can I solve it w..

Answer / marekj

I mean you want to fetch only the first row and the select
statement is correct. You have to use "fetch first 1 row
only" eg.
select name
from peoples
where name like 'A%'
fetch first 1 row only;

Is This Answer Correct ?    15 Yes 1 No

I am getting a error multiple row fetched while executing a Cobol-DB2 program.How can I solve it w..

Answer / nadeem

Select statement fetches only one row from table..make sure
ur program doesn fetch multiple rows..cursor is the only
way to fetch multiple rows to my knowledge..

Is This Answer Correct ?    5 Yes 1 No

I am getting a error multiple row fetched while executing a Cobol-DB2 program.How can I solve it w..

Answer / anamika

DB2 doesnt support 'TOP' clause. Please ignore my prev
reply.

Is This Answer Correct ?    4 Yes 2 No

I am getting a error multiple row fetched while executing a Cobol-DB2 program.How can I solve it w..

Answer / raja mohan reddy

As of my knowledge,we cannot fetch multiple rows with out
using cursor in cobol db2, Let us see the breif explanation

When you are trying to fetch multiple rows with select
statement using perform loop it gives the result as
fetches the first row while fetching the second row program
will be end with sqlcode.

Here is the only one way to fetch multiple rows from db2
table using cobol. Please follw the following steps.

1.Declare a cursor ( we have to code SELECT statement with
our criteria)
2.Open the cursor
3.fetch the rows using cursor
4.Close the cursor

Please Let me know if you find any mis stated information

Is This Answer Correct ?    2 Yes 1 No

I am getting a error multiple row fetched while executing a Cobol-DB2 program.How can I solve it w..

Answer / anju

To my knowledge, we can use fetch clause in a singleton
select inside COBOL.

Is This Answer Correct ?    0 Yes 1 No

I am getting a error multiple row fetched while executing a Cobol-DB2 program.How can I solve it w..

Answer / nk

Try using one of the group functions, for example, MAX or
SUM.

Is This Answer Correct ?    2 Yes 4 No

I am getting a error multiple row fetched while executing a Cobol-DB2 program.How can I solve it w..

Answer / ram.g

Pass the unique key to fetch the row from the table

Is This Answer Correct ?    0 Yes 3 No

I am getting a error multiple row fetched while executing a Cobol-DB2 program.How can I solve it w..

Answer / anamika

You cannot use 'Fetch first 1 row only' in a singleton
select in COBOL. Instead u can use 'SELECT TOP <colname>'
to get the first row in the result set.

Is This Answer Correct ?    0 Yes 5 No

Post New Answer

More DB2 Interview Questions

I have a table name Table1 which contain columns Cust_no, car_model, country, salesamt. The records are 101, Fiat, India, 12345 2nd record is 102, Tata, USA, 98743 3rd record is 101, indica, India, 65342 4th record is 103, Toyota, UK, 64522 5th record is 103, Maruti, USA, 98632 and so on..... Now my question is write sql query which will give me detail about the sum of sales amount in perticular country

2 Answers   IBM,


List down the data types in the db2 database.

0 Answers  


How can you display the current date & current time ?

1 Answers   Cap Gemini,


What is the use of COMMAREA ?Minimum how much data we can pass from it?

7 Answers   Cap Gemini,


how can u nderstand the sql stmts executed successfully or not ?

1 Answers   TCS,


Why db2 is called db2?

0 Answers  


What is the role of data manager in the db2 database?

0 Answers  


how to get duplicate records from tables?write qurey for this?

4 Answers   ANZ,


When do you specify the isolation level?

0 Answers  


What is the difference between a package and a plan?

6 Answers   Infosys, L&T, Mphasis,


how do you resolve -818 error in db2. where we have to see time stamp token. i said by seeing in load module and plan .is it correct or not. give clear explination for how to see time stamp token

2 Answers   IBM, TRD,


what is the use of bind parameter, Replace?

5 Answers   IBM,


Categories