当我将数字数据从DB2导出到del文件时,

dm7nw8vv  于 2022-11-07  发布在  DB2
关注(0)|答案(1)|浏览(287)

服务器是centOS7,db2版本是v11.1_linuxx64_expc。在另一台服务器(也是centOS7)上,我安装了db2客户端(centOS7 && v11.1.4fp5_linuxx64_client)。
测试用例:

create table TEST_REAL( c_double DOUBLE, c_real REAL) data capture changes;

insert into TEST_REAL values(-1.79E+308,3.402823e+38);

远程导出,详细说明如下:

db2 catalog tcpip node p115 remote $ip server $port
db2 catalog db database at node p115
db2 connect to database user $user using &password
db2 export to $path/filename.del of del select * from TEST_REAL

数据导出成功。然后我检查文件名.del,它是

-1.79000000000000E+308,3.40282E+038

科学计数,丢失了最后3个(3.40282E+038,与3.402823e+38比较),当我将数据导出到del文件时,如何获得准确性数据?

rur96b6h

rur96b6h1#

基于此支持文档“Some considerations about the literal expressions of the floating point numbers on DB2 CLP, Import, Export“,该体验是预期的。该支持文档也链接到此definition of number types in Db2
一个建议的解决方案是使用IXF文件格式。它以二进制格式存储数字,而不转换为字符串。

相关问题