Search notes:

SQLite: blob datatype

A value whose data type is blob can be created with the functions zeroblob(n) and randomblob(n) or the «blob literal» x'…'.
A hexadecimal representation of the blob-value is returned by the functions hex(blob_value) or quote(blob_value).
create table t (
   c1,
   c2
);

insert into t values (zeroblob(5), x'deadbeef');

.mode column
.width 16 16
.header on
select
   hex  (c1) c1_hex  ,
   hex  (c2) c2_hex  ,
   quote(c1) c1_quote,
   quote(c2) c2_quote
from
   t;
--
-- c1_hex            c2_hex            c1_quote       c2_quote
-- ----------------  ----------------  -------------  -----------
-- 0000000000        DEADBEEF          X'0000000000'  X'DEADBEEF'
Github repository about-sqlite, path: /datatypes/blob/use.sql

See also

SQLite data types

Index

Fatal error: Uncaught PDOException: SQLSTATE[HY000]: General error: 8 attempt to write a readonly database in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php:78 Stack trace: #0 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(78): PDOStatement->execute(Array) #1 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(30): insert_webrequest_('/notes/developm...', 1758203808, '216.73.216.150', 'Mozilla/5.0 App...', NULL) #2 /home/httpd/vhosts/renenyffenegger.ch/httpsdocs/notes/development/databases/SQLite/datatypes/blob/index(64): insert_webrequest() #3 {main} thrown in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php on line 78