Link to home
Create AccountLog in
Avatar of sam2929
sam2929

asked on

bigint in oracle

Hi,
Can we do bigint in oracle?
ASKER CERTIFIED SOLUTION
Avatar of paquicuba
paquicuba
Flag of United States of America image

Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
Avatar of sam2929
sam2929

ASKER

quick question is number 19 int64 or int32?
int32 ranges from -2,147,483,648 to 2,147,483,647
int64 ranges from -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807

So, number(19) maps to int64

Complete integer mapping:

Int16 : NUMBER(5).
Int32 : NUMBER(10).
Int64 : NUMBER(19).
Avatar of Sean Stuber
note,  number(19) is actually bigger than int64

it has a range of +/-  9,999,999,999,999,999,999

if you want to exactly simulate int64 then use number(19) but include a check constraint on the column to enforce the smaller limits of an int64

something like this...
ee.txt
Good point sdstuber. You can also check between -power(2,63) and power(2,63)-1