|
View previous topic :: View next topic
|
| Author |
Message |
rohanthengal
Active User
.jpg)
Joined: 19 Mar 2009 Posts: 206 Location: Globe, India
|
|
|
|
I have come across some scenario based on the example given below:
TAB1
COL1 COL2
----- -----
A 10
B 20
C 30
D 40
E 50
DECLARE c1 CURSOR WITH HOLD FOR
SELECT * FROM tab1 ORDER BY col_1;
OPEN c1;
FETCH c1;
FETCH c1;
FETCH c1;
COMMIT;
FETCH c1;
CLOSE c1;
FETCH c1;
What would be the last value obtained for COL2?
40 OR 50. Pls give some explanation as well ! |
|
| Back to top |
|
 |
GuyC
Senior Member
Joined: 11 Aug 2009 Posts: 1281 Location: Belgium
|
|
|
|
interview question?
progam will not precompile: col_1 is an undefined name.
and if you meant COL1 :
the last value obtained for col2 is 40
the last error received is -501
No explanation should be needed by anyone with basic SQL knowledge. |
|
| Back to top |
|
 |
|
|