Export BIGINT with signed value to a file

General
Fan

Export BIGINT with signed value to a file

Hi All, I am trying to export a BIGINT column which has signed value of -1 to a file. Then I am using this file to load the data back to a table say TABLE1. I noticed that the file doesn't contain the signed value neither the table1 contains -1. Instead it has 1. It is losing the sign. How can this be fixed. I have already tried to search this forum however, couldn't find anything that could help. Please advise.

4 REPLIES
Junior Contributor

Re: Export BIGINT with signed value to a file

How did you export the BIGINT, as a string? Check the FORMAT, maybe you simply omited the sign.

Fan

Re: Export BIGINT with signed value to a file

Dnoeth, I am using the following:
(BIGINT , FORMAT '999999999999999')
(CHAR(15))
Junior Contributor

Re: Export BIGINT with signed value to a file

Missing sign :-)

(BIGINT , FORMAT '-(15)9') (CHAR(16))

for up to 15 digits.

Btw, BIGINT stores up to 19 digits, the default format is '-(19)9'

Fan

Re: Export BIGINT with signed value to a file

That worked exactly as I needed. Thank you so much to help a beginner. Much needed!!