Hi Keith,
On 13 March 2016 at 13:31, Keith Medcalf <kmedcalf at dessus.com> wrote:
> On Sunday, 13 March, 2016 13:36 -07:00, jungle Boogie <jungleboogie0 at 
> gmail.com> wrote:
>> Here it is in decimal: (select code from sidemeters)
>> "0"
>> "1"
>> "2"
>> "5"
>> "6"
>> "7"
>> "28"
>> "29"
>> "30"
>> "31"
>
> Assuming that your quotes mean that the value is TEXT, not a number.
> You can check this by running:
>
>      select code, typeof(code) from sidemeters;

It's an integer. The quotes come from copying a sample from sqlite
manager. Sorry to have omitted that from my previous message.

>
> You will note that the printf function wants to cast the "code" to an 
> integer, then outputs the hex representation of the integer.
> The hex() function treats the item as a "blob" and converts the actual bytes 
> stored into hex.
>
> They are two entirely different things.
>
> So really the question is, what is the declared column affinity of the "code" 
> column in you table definition and what is the actual type of the data stored?
>
> Based on the results you have obtained, I would suspect that the column 
> affinity is "integer" and you are storing either text or integer (it is 
> immaterial which in this particular case).
>
> In order for hex() to generate output, it "converts" the integer into a blob 
> (text) and outputs the hexified result.
>
>

So does that mean it can't convert it from the decimal integer to a
hexadecimal result, like I'm doing with printf?

-- 
-------
inum: 883510009027723
sip: jungleboogie at sip2sip.info
xmpp: jungle-boogie at jit.si

Reply via email to