Sunday, April 28, 2013

[android help] SQLite excpetion unable to convert BLOB to string

android - SQLite excpetion unable to convert BLOB to string - Stack Overflow







Tell me more ×

Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

















In my android project I fetch one problem during retrieving data from data base. In this I try to get String value from DB like URL but when this code execute then I get this error android.database.sqlite.SQLiteException: unknown error: Unable to convert BLOB to string And only URL colomn give me this error not any other string colomn.


I didn't get where I am wrong. So friend please give me suggestion how I can resolve this problem. Here I also print my LogCat.


Thank You.



08-22 20:08:12.290: WARN/System.err(10844): android.database.sqlite.SQLiteException: unknown error: Unable to convert BLOB to string
08-22 20:08:12.300: WARN/System.err(10844): at android.database.CursorWindow.getString_native(Native Method)
08-22 20:08:12.300: WARN/System.err(10844): at android.database.CursorWindow.getString(CursorWindow.java:329)
08-22 20:08:12.300: WARN/System.err(10844): at android.database.AbstractWindowedCursor.getString(AbstractWindowedCursor.java:49)
08-22 20:08:12.300: WARN/System.err(10844): at com.catLog.ProductsDetailsHomeTab.getProductDeatilsFromDB(ProductsDetailsHomeTab.java:337)
08-22 20:08:12.300: WARN/System.err(10844): at com.catLog.ProductsDetailsHomeTab.setFlipperChild1(ProductsDetailsHomeTab.java:201)
08-22 20:08:12.300: WARN/System.err(10844): at com.catLog.Widget.ViewFlipper_ProductDetails.onRightToLeftSwipe(ViewFlipper_ProductDetails.java:68)
08-22 20:08:12.300: WARN/System.err(10844): at com.catLog.Widget.ViewFlipper_ProductDetails.onTouchEvent(ViewFlipper_ProductDetails.java:131)
08-22 20:08:12.300: WARN/System.err(10844): at android.view.View.dispatchTouchEvent(View.java:3766)
08-22 20:08:12.300: WARN/System.err(10844): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:897)
08-22 20:08:12.300: WARN/System.err(10844): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:936)
08-22 20:08:12.300: WARN/System.err(10844): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:936)
08-22 20:08:12.300: WARN/System.err(10844): at com.android.internal.policy.impl.PhoneWindow$DecorView.superDispatchTouchEvent(PhoneWindow.java:1676)
08-22 20:08:12.300: WARN/System.err(10844): at com.android.internal.policy.impl.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1112)
08-22 20:08:12.300: WARN/System.err(10844): at android.app.Activity.dispatchTouchEvent(Activity.java:2086)
08-22 20:08:12.300: WARN/System.err(10844): at com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchTouchEvent(PhoneWindow.java:1660)
08-22 20:08:12.300: WARN/System.err(10844): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:936)
08-22 20:08:12.300: WARN/System.err(10844): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:936)
08-22 20:08:12.300: WARN/System.err(10844): at com.android.internal.policy.impl.PhoneWindow$DecorView.superDispatchTouchEvent(PhoneWindow.java:1676)
08-22 20:08:12.300: WARN/System.err(10844): at com.android.internal.policy.impl.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1112)
08-22 20:08:12.300: WARN/System.err(10844): at android.app.Activity.dispatchTouchEvent(Activity.java:2086)
08-22 20:08:12.300: WARN/System.err(10844): at com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchTouchEvent(PhoneWindow.java:1660)
08-22 20:08:12.300: WARN/System.err(10844): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:936)
08-22 20:08:12.300: WARN/System.err(10844): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:936)
08-22 20:08:12.300: WARN/System.err(10844): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:936)
08-22 20:08:12.300: WARN/System.err(10844): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:936)
08-22 20:08:12.300: WARN/System.err(10844): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:936)
08-22 20:08:12.300: WARN/System.err(10844): at com.android.internal.policy.impl.PhoneWindow$DecorView.superDispatchTouchEvent(PhoneWindow.java:1676)
08-22 20:08:12.300: WARN/System.err(10844): at com.android.internal.policy.impl.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1112)
08-22 20:08:12.300: WARN/System.err(10844): at android.app.Activity.dispatchTouchEvent(Activity.java:2086)
08-22 20:08:12.300: WARN/System.err(10844): at com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchTouchEvent(PhoneWindow.java:1660)
08-22 20:08:12.300: WARN/System.err(10844): at android.view.ViewRoot.handleMessage(ViewRoot.java:1785)
08-22 20:08:12.300: WARN/System.err(10844): at android.os.Handler.dispatchMessage(Handler.java:99)
08-22 20:08:12.300: WARN/System.err(10844): at android.os.Looper.loop(Looper.java:123)
08-22 20:08:12.300: WARN/System.err(10844): at android.app.ActivityThread.main(ActivityThread.java:4627)
08-22 20:08:12.300: WARN/System.err(10844): at java.lang.reflect.Method.invokeNative(Native Method)
08-22 20:08:12.300: WARN/System.err(10844): at java.lang.reflect.Method.invoke(Method.java:521)
08-22 20:08:12.300: WARN/System.err(10844): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)
08-22 20:08:12.300: WARN/System.err(10844): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
08-22 20:08:12.300: WARN/System.err(10844): at dalvik.system.NativeStart.main(Native Method)




























How to convert BLOB to string?



Direct conversion is not possible without using some UDF, but you can extract text using SUBSTRING function:



What is the datatype of the column you are getting the error on (from what you say I think this is the URL column)? Sounds like it is of type BLOB which is a representation of an image but not a string








































lang-sql






.

stackoverflow.comm

No comments:

Post a Comment

Google Voice on T-Mobile? [General]

Google Voice on T-Mobile? So I recently switched from a GNex on Verizon to a Moto X DE on T-Mobile. I had always used Google Voice for my v...