在现有SQLite记录中更新BLOB字段的语法? [英] syntax to UPDATE a BLOB field in an existing SQLite record?

查看:802
本文介绍了在现有SQLite记录中更新BLOB字段的语法?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用Python对现有SQLite记录中的UPDATE字段UPDATE的语法是什么?我创建了一个13x13的浮点数组,并希望使用该数组更新表中的特定记录(即使用WHERE子句).

What is the syntax to UPDATE a BLOB field in an existing SQLite record, using Python? I create a 13x13 array of floats and want to Update a specific record (i.e. using a WHERE clause) in my table with that array.

正确的UPDATE语法是什么?

该数组具有以下形式:

[ 4.65640926e+00  5.59250259e+00  5.28963852e+00  1.60680866e+00
  -3.39492680e-01 -4.76834650e-01 -4.76834650e-01 -2.29132240e-01
   1.49733067e+00  1.51563072e+00  1.49733067e+00  9.53471420e-01
  -1.40306473e+00]

 [ 5.28963852e+00  5.34537315e+00  5.05013466e+00  1.48362923e+00
  -3.69843300e-01 -4.76834650e-01 -4.76834650e-01 -2.29132240e-01
   7.60705290e-01  1.49733067e+00  9.53471420e-01  3.05504260e-01
  -1.40306473e+00]

总共13行的13个子数组.

Totaling 13 rows of 13 sub-arrays.

谢谢你, 比尔

推荐答案

SQL的语法是:-

UPDATE mytable SET myblobcolumn = x'ffeedd' WHERE your_where_clause;

哪里

  • mytable 是表名
  • myblobcolumn 是要更新的列的名称,
  • your_where_clause 是选择标准,
  • x'ffeedd'是字节数组值,已转换为十六进制,用于更新列.
  • mytable is the table name,
  • myblobcolumn is the name of the column that is to be updated,
  • your_where_clause is the selection criteria,
  • x'ffeedd' is the byte array value, converted to hexadecimal, that is to be used to update the column.

显然,以上只是表示形式,您必须替换适当的值

SQLite版本3中的数据类型

这篇关于在现有SQLite记录中更新BLOB字段的语法?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆