Re: Constructed Select and Row Count
Posted in 1993
Dave Snyder writes: |> In article <duhonCAu35B.MFt@netcom.com> duhon@netcom.com (Joey Duhon) writes: |> } I'm doing a select with a "construct" (using a cursor) in 4GL. |> } I was hoping that after opening (or at least after the 1st fetch) |> } sqlerrd[3] would have the wor count. I can't seem to get this value |> } anyway i try. |> } Is there a trick to getting this value, or should i give up? |> } |> The sqlerrd[3] value will only hold the correct value for a SELECT after all |> the rows have been selected. Under SE, thats after you fetch the last row. |> Under ONLINE, that all depends on how many rows have been selected and the |> size of your buffers. Actually, your second point applies to both OnLine and SE. sqlerrd[3] is filled in when the engine knows how many rows are returned. It knows this when the engine retrieves the last row. Since both engines pass a buffer full of rows to the front end, this value could become available before you actually fetch the last row (it will be there when your fetch causes the last buffer full of data to be sent from the engine). The mechanism for passing tuples back to the front end is the same for SE and OnLine (this is not to be confused with buffering the original data from the database). Dave Disclaimer: These opinions are not those of Informix Software, Inc. ************************************************************************** "I look back with some satisfaction on what an idiot I was when I was 25, but when I do that, I'm assuming I'm no longer an idiot." - Andy Rooney