'a...">

Sqlite char, ascii function

Is there any work in sqlite to cover the lack of char () "and" ascii () functions?

For instance:

char(97) => 'a'
ascii('a') => 97
+5
source share
6 answers

I suppose if you really wanted to, you could create an ASCII Table with a column ASCIICHARand a column ASCIICODEand populate it with an ASCII table. Then your queries can be executed in queries / subqueries:

SELECT ASCIICHAR FROM ASCIITABLE WHERE ASCIICODE = 97;

True, although Richard J. Ross III comments on the money - if you use SQLite, you probably get access to it through your calling code, could the calculations be done?

+4
source

I know this is too late, but:

SELECT unicode('a') --ascii('a')
SELECT char(97)     --char(97)

Hope this helps :)

+3
source

SQLite, , CHAR():

SELECT CHAR(97) -- Result is 'a'

HEX():

SELECT HEX('a') -- Result is 61 (hexadecimal, is equal to 97 decimal)

ASCII , ...

+2

, sqlite ASCII :

select * from segments where substr(name, 1, 1) < 'A' or substr(name, 1, 1) > 'Z' and substr(name, 1, 1) < 'a';

: 0-9 ASCII < ''

0

You can implement your own version of ascii based on the sqlite extension library located on this site: http://sqlite.1065341.n5.nabble.com/Extension-functions-for-SQLite-in-C-for-free-td18942 .html

I modified this code to add features, not yours. It should be pretty simple.

0
source

All Articles