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

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

问题描述

使用 Python 在现有 SQLite 记录中 UPDATE BLOB 字段的语法是什么?我创建了一个 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 语法?

What is the proper UPDATE syntax?

数组的形式如下:

[ 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天全站免登陆