Try "limit 20". The hex function interprets the argument as a blob. This causes 
your integer value to be converted to text, and the hex representation of that 
text is your result.

-----Urspr?ngliche Nachricht-----
Von: sqlite-users-bounces at mailinglists.sqlite.org 
[mailto:sqlite-users-bounces at mailinglists.sqlite.org] Im Auftrag von Cecil 
Westerhof
Gesendet: Donnerstag, 21. April 2016 12:20
An: SQLite mailing list
Betreff: [sqlite] SELECT 0 gives TEXT instead of INTEGER

I have the following:
WITH RECURSIVE
expansion(byte) AS (
    SELECT 0
    UNION  ALL
    SELECT byte + 1 FROM expansion
    LIMIT  10
)
SELECT hex(byte)
FROM   expansion
;

?I would expect to get 00-09, but I get 30-39. 30 is the hex-value of the ASCII 
0. How would I get what I want. I could subtract 48, but that is not my 
preferred solution.?

--
Cecil Westerhof
_______________________________________________
sqlite-users mailing list
sqlite-users at mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


___________________________________________
 Gunter Hick
Software Engineer
Scientific Games International GmbH
FN 157284 a, HG Wien
Klitschgasse 2-4, A-1130 Vienna, Austria
Tel: +43 1 80100 0
E-Mail: hick at scigames.at

This communication (including any attachments) is intended for the use of the 
intended recipient(s) only and may contain information that is confidential, 
privileged or legally protected. Any unauthorized use or dissemination of this 
communication is strictly prohibited. If you have received this communication 
in error, please immediately notify the sender by return e-mail message and 
delete all copies of the original communication. Thank you for your cooperation.


Reply via email to