On 2016-03-13 23:14, jungle Boogie wrote:
> 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.

It does not matter.

>> 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?

``hex'' does not make use of an affinity - it ignores an affinity of an 
argument.

>> 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).

Column with any affinity can contain TEXT (or INTEGER disjointly)
storage. There is no affinity which cannot contain TEXT nor INTEGER.
Affinity does not matter --- whatever affinity, the results of ``hex'' 
will be the same.

>> 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?

Yes, and ``printf'' is probably the best method to achieve the desired 
results.

-- best regards

Cezary H. Noweta

Reply via email to