I looked to do that but there doesn't seem to be any way of finding that out without reading to the end of the table. I think it is the same with SQLite.Is there any chance to add a property (String or Number) e.g. "RowCount", to know the rows that the query returned before reading the data ?
It's a convenience to read the entire table at once and the length of the returned array will tell you how many rows. Why can't you use it?I don't know if function ReadRemainingRows is for this use, but i can't work with it.
There's probably a bug in it thenAs for the ReadRemainingRows, i tryied to test it but it always returns ArrayLen = 1 and when i try to read it, it seems to be empty or null.
mssql1.ExecuteQuery("Select nickname From Employees")
array2() = Mssql1.ReadRemainingRows
Msgbox(ArrayLen(array2()))
Msgbox(array2(0,0))
There was another bug that I missed in ReadRemainingRows which was using a wrong property to size the array. Corrected in version 1.8.RemainingRows now return as ArrayLen the number of rows retrieved + 1.
That is correct behaviour. It is the same as you doing multiple ReadRows. The data is in the two dimensional array that is returned by ReadRemainingRows. You can use ReadRemainingRows immediately after ExecuteQuery to get the whole table or use Advance and ReadRow to get the data one row at a time. Using ReadRemainingRows after using Advance and ReadRow one or more times will return only the data in the unread part of the table. It seems to be common to SQL databases that tables returned from queries can only be read once in a forward direction.However the main issue is that after executing ReadRemainingRows, the Advance method returns false and you can't read the data.
I don't understand this unless you are trying to execute ReadRemainingRows again in which case it is expected behaviour as the table has been read to the end.Also, Array(0,0) returns the same error but this is not an issue.
fields() = Mssql.FieldInfo
data() = Mssql.ReadRemainingRows
For i = 0 To ArrayLen(data()) - 1
For j = 0 To ArrayLen(fields()) - 1
Msgbox(data(i,j))
Next
Next
ArrayLen(fields()) returns 7
ArrayLen(data()) returns 17
You only need to post once about a problem. I have replied to your other post.
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?