Home Tutorials Forums Articles Blogs Movies Library Employment Press
Old 12-13-2009, 09:37 AM   #1
Wmusson
Registered User
 
Join Date: Dec 2009
Posts: 1
Default Air, sqlite and blob

Dec 9, 2009 2:51 PM
Loading SQLite blob data

Hi,

I'm trying to load a png as a blob, the database is populated from another application and when I execute the SQL query I get the following error:

RangeError: Error #2006: The supplied index is out of bounds.
at flash.data::SQLStatement/internalExecute()
at flash.data::SQLStatement/execute()

If I store it from within the Air application as a bytearray then everything is okay, it's only when I use the external application to store the data that it goes wrong. The image does need to be stored in the database from an external non-Air application.

Thanks in advance

Will

Last edited by Wmusson; 12-13-2009 at 09:40 AM.
Wmusson is offline   Reply With Quote
Old 02-03-2011, 09:32 PM   #2
danfogg
Registered User
 
Join Date: Feb 2011
Posts: 1
Lightbulb Air, sqlite and blob, use CAST

Hi,

I ran into the same issue and found a way around this in case anyone else comes hunting for a solution:

Check out help.adobe.com and search for CAST syntax with sqlite. I'd post the exact link but this forum won't allow urls in a post unless you have more than 50 posts, lame.

Basically you have to use CAST on your blob selects or you get that error.


example from the doc:

stmt.text = "SELECT CAST(data AS ByteArray) AS data FROM pictures;";


I've also verified that this cast works ok even if the blob is null, which might be useful for some of you out there as well.


Cheers
danfogg is offline   Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 03:32 PM.

///
Follow actionscriptorg on Twitter

 


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.