On Tue, May 28, 2013 at 3:06 PM, Dave Wellman
<dwell...@ward-analytics.com>wrote:

> Is there a way to extract the content of a column/row in its 'stored'
> format
> - i.e. the actual bytes?  So that it's 'fairly' easy to read! I have a
> utility that will look at the hex bytes of any file, but the entire
> database
> is (understandably) quite complex.
>
>
>
> Let me explain the problem that I'm facing and someone might point me in a
> better direction.
> <snip>
>
>
Maybe the typeof() function could help?

http://www.sqlite.org/lang_corefunc.html#typeof

For instance:

create table test (col);
insert into test values (1);
insert into test values ('1');
insert into test values (1.0);
select col, typeof(col) as type from test;

col type
1    integer
1    text
1    real

and for a possible data fix:

update test set col = cast(trim(col) as integer) where typeof(col) <>
'integer';
select col, typeof(col) as type from test;

col type
1    integer
1    integer
1    integer

--
Constantine Yannakopoulos
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to