SQL datatype

data typecompatibilitydeskripsirangebytes
BOOLEANbooleantrue and false1
BIT
intege0 and 11
TINYINTBYTEinteger0 to 2551
SMALLINTinteger-32768 to 327672
INT
COUNTER (INT IDENTITY)
SERIAL (INT IDENTITY)
integer-2147483648
to
2147483647
4
BIGINTinteger-9223372036854775808
to
9223372036854775807
8
REALfloating point-3.40E+38 to 3.40E+384
DOUBLEfloating point-1.79E+308 to 1.79E+3088
FLOAT
like DOUBLE
MONEYfixed point with a scale 4-922,337,203,685,477.5808
to
+ 922,337,203,685,477.580
8
SMALLMONEYfixed point with a scale 4-214,748.3648
to
214,748.3647
4
NUMERIC[(p[,s])]NUMBER [(p[,s])]
VARNUM [(p[,s])]
fixed point
with a variable precision and scale
p – precision
s – scale
precision
1-9
10-19
20-29
30-3

6
10
14
18
DECIMAL[(p[,s])]like NUMERIC
CHAR[(n)]CHARACTER[(n)]n – length1 to 65532+2*n
NCAHAR[(n)]n – length1 to 65532+2*n
VARCHAR[(n)]VARCHAR2[(n)] n – length0 to 65535variable 2 to 2 + 2*n
NVARCHAR[(n)]NVARCHAR2[(n)] n – length0 to 65535variable 2 to 2 + 2*n
LONGVARCHARTEXTLONG0 to 2,147,483,64712+2*n
LONGNVARCHARNTEXT0 to 2,147,483,64712+2*n
CLOB0 to 2,147,483,64712+2*n
NCLOB0 to 2,147,483,64712+2*n
BINARY[(n)]1 to 655352+n
VARBINARY[(n)] RAWvariable length binary data1 to 65535variable
2 to 2+n
LONGVARBINARYIMAGELONG RAWvariable length large binary data0 to 2,147,483,64712+n
BLOBlarge binary data with handle0 to 2,147,483,64712+n
DATE date4
TIMEtime4
TIMESTAMPDATETIMEtimestamp8
SMALLDATETIMEdate and time with a precision of a minute4
UNIQUEIDENTIFIER 16 byte unique identifier16
JAVA_OBJECTSQL_VARIANT any Java object 0 to 2,147,483,647 variable

Tinggalkan komentar