MIN problem
Posted in 1996
Anybody seen this or have an explanation? I seem to be encountering a strange error with a MIN statement. I prepare and declare a cursor for a statement to SELECT MIN() of a column in a table. I put an OPEN/FETCH/CLOSE into a loop to FETCH/show the min value. The min value doesn't get the min value every time. Instead it loops through all the values of that column in order. After it reaches the last one, it returns a -2147483648 (or NULL), then starts again with the real minimum value and counts up again. Nobody is adding or deleting rows while I'm doing this either (the minimum value is not changing). If I do a "live" SELECT (as opposed to a prepared one) and put it in the same loop, it gets the same value every time, the REAL minimum value. In the meantime, the prepared/declared cursor in the same loop is still counting up - EXACT SAME SELECT (except for the INTO clause). I'm using compiled ESQL/C Version 6.04.UC1, and Online Version 7.13.UC1 on a Sun Sparc 1000. -- __________________________________________________________________________ Joel Schumacher JCPenney Co. - UNIX Network Systems jschumac@uns-dv1.jcpenney.com 12700 Park Central Pl (214) 591-7543 Dallas TX 75251