View previous topic :: View next topic
|
Author |
Message |
ursprasanna Warnings : 2 New User
Joined: 15 May 2006 Posts: 20 Location: chennai
|
|
|
|
When know that If there is a multiple row select for a select statement then , the select ends up with a sqlabend.
By using cursor we can handle this problem.
I would like to know whether this problem can be handled with out using cursor .
If so how??
Thanks,
Prasanna Subramaniam. |
|
Back to top |
|
|
guptae
Moderator
Joined: 14 Oct 2005 Posts: 1208 Location: Bangalore,India
|
|
|
|
Hi,
There is two approch.
1) use the cursor
2) stregthentr ur where clause so that u will get only 1 row.
Correction r welcome |
|
Back to top |
|
|
die7nadal
Active User
Joined: 23 Mar 2005 Posts: 156
|
|
|
|
Prasanna
It all depends on what u are trying to do with your SELECT Stmt.
1) If you want to fetch all rows no matter what - CURSOR is needed.
2) If you know that all the rows returned are dups and wish to fetch just a single row. You could use SELECT DISTINCT, or FETCH FIRST 1 ROWS ONLY.
3) If all you wanna know is, if the query returns any rows, you could check for the SQLCODE after the query for -811. |
|
Back to top |
|
|
|