char(1) =============================================UPDATE info SET "Protype"=97 WHERE tape_id='OW-0411';ERROR: column "Protype" is of type "char" but expression is of type integer SQL 状态: 42804 建议:You will need to rewrite or cast the expression. 字符:21 小弟才接触这个数据库,提示类型不对!不晓得有没有函数把97转换为BYTE的!默认是INTEGER ------------------------------------------------------------------------ 数据库字节大小相关,主要是做单机版,就是脱离数据库运行,这个时候需要预先导出数据库为特定的结构所以字节大小变动就影响到处以及以后的使用!
'a' = 97UPDATE info SET "Protype"='a' WHERE tape_id='OW-0411';
== 思想重于技巧 ==
谢谢liuyann 最后照这样计算我存在数据库中的是a,而不是97了!在使用的时候就不能查询 SELECT * FROM info where Protype=97 了 呵呵!!
据我对postgres数据库的了解,感觉做不到你需要的那些 可以在整数和 bit 之间来回转换。例子: 44::bit(10) 0000101100 44::bit(3) 100 cast(-44 as bit(12)) 111111010100 '1110'::bit(4)::integer 14
定义smallint~
=============================================UPDATE info
SET "Protype"=97
WHERE tape_id='OW-0411';ERROR: column "Protype" is of type "char" but expression is of type integer
SQL 状态: 42804
建议:You will need to rewrite or cast the expression.
字符:21
小弟才接触这个数据库,提示类型不对!不晓得有没有函数把97转换为BYTE的!默认是INTEGER
------------------------------------------------------------------------
数据库字节大小相关,主要是做单机版,就是脱离数据库运行,这个时候需要预先导出数据库为特定的结构所以字节大小变动就影响到处以及以后的使用!
SET "Protype"='a'
WHERE tape_id='OW-0411';
最后照这样计算我存在数据库中的是a,而不是97了!在使用的时候就不能查询
SELECT * FROM info where Protype=97 了
呵呵!!
可以在整数和 bit 之间来回转换。例子: 44::bit(10) 0000101100
44::bit(3) 100
cast(-44 as bit(12)) 111111010100
'1110'::bit(4)::integer 14