-
Notifications
You must be signed in to change notification settings - Fork 716
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
'SELECT' returns an object with 'rows.length' but no 'rows.items' #441
Comments
Please specify which platform(s), which Xcode version in case of iOS, and a small test program to reproduce the issue thanks! |
Nvm, sorry! Tried a few more things and it works. Thanks for writing a great plugin! |
@benshope Any idea what did you do? I'm having this same issue after I upgraded cordova, cordova project version and cordova plugins including this plugin. Same thing happens on iOS and Android. I have database that is holding blop images. The result comes out just fine when I example COUNT images that I have in my database.
And the output is 2191 like it should be. But when I try to fetch the actual image BLOP
The rows length is 1 like it should be, but when I try to access it by item(0) it is completely empty. cordova 6.0.0 |
@osro I think you meant that you tried to fetch an image BLOB. The storage and retrieval of the BLOB data type is currently not supported by this project. A version that supports retrieval of BLOB data is available with a different licensing scheme at: https://github.com/litehelpers/Cordova-sqlite-evfree-ext |
Yep, that was it 😄 Thanks! |
@benshope I am having the same problem and I am just trying to read a string from the database. Can you tell me what you did to solve this problem? |
@doc-brown please raise a new issue in https://github.com/litehelpers/Cordova-sqlite-help with a self-contained demo if you are having this kind of an issue. |
The code in this question will not work since it is missing the location setting. The accepted solution is NOT recommended since it will miss over 2 years of updates, including a couple data loss risk issues #666 and #716 that were discovered and fixed over the past year. I would like to ask anyone facing this kind of an issue to discuss in https://github.com/litehelpers/Cordova-sqlite-help/issues, with self-contained reproduction code. I would also like to recommend giving https://github.com/brodybits/cordova-sqlite-storage-starter-app a try. |
@doc-brown @osro sorry for the late response to some questions, what I think might have fixed my problem is that things have to be fetched from the sql response object using EDIT: after reading the comment below, I realized that it was not a |
@benshope thanks for commenting. Your response indicates that you are using some kind of a library to access the data in the sql response object, which would probably not work the same for most other users. In general the row object is accessed in the following forms: resultSet.rows.item(rowIndex).columnName // individual column from a row
resultSet.rows.item(rowIndex) // full row object So far I have seen the following possible causes of this kind of issue:
|
@brodybits Yes, you're totally right, it wasn't |
I am having the same issue as this person:
http://stackoverflow.com/questions/32973678/cordova-sqlite-query-rows-length-0-but-items-throws-exception
My sql
SELECT
returns an object withrows.length
but norows.item
. My script works fine in Chrome. I attempted to downgrade, but that did not appear to solve the problem. Any idea what might be going on?The text was updated successfully, but these errors were encountered: