我正在尝试将两个字节串插入到带有 VARBINARY 列的 SAP HANA 表中,但我不断收到语法错误。
我的两个字节串看起来像:
STRING1 = b'G\xa2ac\xa0av\xf6'
type(STRING1) == <class 'bytes'>
STRING2 = b'708ca7fbb701799bb387f2e50deaca402e8502abe229f705693d2d4f350e1ad6'
type(STRING2) == <class 'bytes'>
我插入值的查询如下所示:
INSERT INTO testTable VALUES(
CAST(b'708ca7fbb701799bb387f2e50deaca402e8502abe229f705693d2d4f350e1ad6' AS VARBINARY),
CAST(b'G\xa2ac\xa0av\xf6' AS VARBINARY));
我还尝试查询文档的建议方式:
INSERT INTO testTable VALUES(
CAST(x'708ca7fbb701799bb387f2e50deaca402e8502abe229f705693d2d4f350e1ad6' AS VARBINARY),
CAST(x'G\xa2ac\xa0av\xf6' AS VARBINARY));
也:
INSERT INTO testTable VALUES(
b'708ca7fbb701799bb387f2e50deaca402e8502abe229f705693d2d4f350e1ad6',
b'G\xa2ac\xa0av\xf6');
但是所有这些都给了我一些语法错误。任何帮助将不胜感激。谢谢!