所以我想将 mysql 查询转换为 sqlite,其中有十六进制代码的图像,当我在 sqlite 浏览器中运行相同的查询时,它给了我一个错误,正确的方法是什么。
Result: hex literal too big: 0x73616666726f6e2e6a7067
At line 1:
INSERT INTO `test` (`id`, `yeild`, `image`, `city`, `info`, `fertilizer`) VALUES
(9, 'Wheat', 0x77686561742e6a7067, 'Bangalore', 'Weather that is comfortable for humans is also good for wheat. Wheat needs 12\r\nto 15 inches (31 to 38 centimetres) of water to produce a')
CREATE TABLE IF NOT EXISTS `test` (
`id` int(11) NOT NULL PRIMARY KEY,
`yeild` varchar(40) NOT NULL,
`image` blob NOT NULL,
`city` varchar(50) NOT NULL,
`info` varchar(60000) NOT NULL,
`fertilizer` varchar(5000) NOT NULL);
您想要插入 blob 文字,而不是数字:
X'77686561742e6a7067'
From 文档:
十六进制整数文字被解释为 64 位二进制补码整数,因此精度限制为 16 位有效数字。
and
BLOB 文字是包含十六进制数据且前面带有单个“x”或“X”字符的字符串文字。示例:X'53514C697465'
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)