All Forums General
arsagg 4 posts Joined 12/15
22 Dec 2015
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.

dnoeth 4628 posts Joined 11/04
22 Dec 2015

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

Dieter

arsagg 4 posts Joined 12/15
22 Dec 2015

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

dnoeth 4628 posts Joined 11/04
22 Dec 2015

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'

Dieter

arsagg 4 posts Joined 12/15
22 Dec 2015

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

You must sign in to leave a comment.