2

My WebSQL contains images in plain text format(dataURIs). I'm capturing photo data and saving it in an HTML5 WebSQL databse. How I can find the size of data saved?

When I use a SELECT query to retrieve this I'm getting a too large resultset error: 'TOO_LARGE_ERR'.

Can anybody help me to find this?

Thank You.

Paul Sweatte
  • 24,148
  • 7
  • 127
  • 265
nim007
  • 2,958
  • 3
  • 16
  • 28

1 Answers1

2

Use the length function with the LIMIT clause:

SELECT length(datauris) FROM foo LIMIT 1,1

References

Paul Sweatte
  • 24,148
  • 7
  • 127
  • 265
  • 1
    Thanks for your reply. But this doesn't work for me. I wants to know the size of this websql database in MB. Can you help me to get any solution for holding large data in websql? I already have the data in the db. But after a particular limit it is showing error. We are working with Android devices. – nim007 Jul 04 '12 at 11:18
  • Use one of [several functions](http://stackoverflow.com/questions/6364577/how-to-get-the-current-sqlite-database-size-or-package-size-in-android) to get the current size. There is a [5mb](http://stackoverflow.com/questions/10260951/web-sql-storage-limitations-in-chrome-and-android) limit by default, but you can increase it for [websites](http://stackoverflow.com/questions/9784777/increasing-5mb-storage-limit-in-chrome). Refer to a [similar question](http://stackoverflow.com/questions/4039735/html5-web-sql-db-maximum-table-size) for more help. – Paul Sweatte Jul 04 '12 at 18:29
  • But this I want to do with Mobile device which support android or iOS. there only i'm getting the mentioned error. Please help. – nim007 Jul 10 '12 at 07:14