View previous topic :: View next topic |
Author |
Message |
badri5 Banned
Joined: 27 Jun 2006 Posts: 18 Topics: 16
|
Posted: Wed Sep 02, 2009 9:42 am Post subject: cursor Logic |
|
|
I am stuck up with the logic of a cursor.
Select a from table a
If sqlcode = 0 from table a---( i have to use declare,fetch and close .ie from fetch sqlcode = 0) i am selecting b from table b--i am selecting many records
Then
select b from table b
If sqlcode = 0
where will i close the cursor |
|
Back to top |
|
 |
dbzTHEdinosauer Supermod
Joined: 20 Oct 2006 Posts: 1411 Topics: 26 Location: germany
|
Posted: Wed Sep 02, 2009 9:56 am Post subject: |
|
|
Quote: | where will i close the cursor |
which cursor?
you will get more help when you describe the scenario a 'little better'. _________________ Dick Brenholtz
American living in Varel, Germany |
|
Back to top |
|
 |
badri5 Banned
Joined: 27 Jun 2006 Posts: 18 Topics: 16
|
Posted: Wed Sep 02, 2009 10:06 am Post subject: |
|
|
Select a from table a
where b = : b
And c = 'F'
If SQLCODE = 0----(I have to check sqlcode = 0 for fetch.But lastly close cursor will come.it will close cursor for and checking sqlcode = 0)without closing the cursor i can't go to the next select.how will i handle this
Select a
From table b
Where a = from input file
And b = 'F'
and c = 'E' |
|
Back to top |
|
 |
kolusu Site Admin

Joined: 26 Nov 2002 Posts: 12378 Topics: 75 Location: San Jose
|
|
Back to top |
|
 |
|
|