Data Types: Programming Languages     Last updated on          

 

Mostly in a run-time, a program needs variables to handle/manage data. To do so, in design-time, variables must be defined by what types of data they will contain. Also see: Code Shortcuts; Hardware makes software deployable; Mathematics; Script;

 

Data-type

 

C

Delphi 4

Modula-2

Java 2

 

Remark

 

…

…

…

…

…

…

…

64 bit Integer

 

Int64

 

 

 

 

 

Boolean

Non-zero is TRUE, 0 is FALSE

Boolean

Boolean

true is TRUE

false is FALSE

Boolean

 

 

Byte

 

 

Byte

 

Byte

 

 

 

Cardinal

 

 

Cardinal

 

 

 

 

 

Character

 

char

Char

char

 

 

 

Character (Unicode)

 

 

 

Char

 

2 bytes for each character

Computational

 

 

Comp

 

 

 

 

Currency

 

 

Currency

 

 

 

 

Double

 

 

Double

 

 

 

(Must be checked whether it is double precision floating point)

Extended

 

 

Extended

 

 

 

 

 

Integer

 

int

Integer

 

int

 

 

Integer (arithmetic modulo 2n)

unsigned int

 

 

 

 

 

Long Integer

 

 

LongInt

 

 

Long

 

 

 

Real

 

float

 

Real

real

Float

 

 

Real (Double Precision)

double

 

 

 

Double

 

 

Short Integer

 

 

ShortInt

 

Short

 

 

Single

 

 

Single

 

 

 

 

Small Integer

           

 

SmallInt

 

 

 

 

String

 

 

 

 

String

 

 

 

Variant

 

 

Variant

 

 

 

 

 

Wide Character

 

WideChar

 

 

 

 

Word

 

Word

 

 

 

 

…

…

…

…

…

…

…

Data type – Char in Java 2 takes two bytes for each character. But, Char in Delphi 4 does not. To prove whether 2 bytes or 1 byte, char is needed to be tested by Java, and by Delphi, while testing, bit-wise check between ASCII and Unicode.

Note: Width of a processor’s data bus can be called Word. Since processor may vary, thus Word data-type is machine dependent. At one time, in an instruction, Word contains the largest amount of data which can be fetched into a processor. Data-type Word is nothing to do with word-processing.  

 

Data Type: SQL (Database)

The following table contains data-types of SQL language in Microsoft SQL Servers. Data-type’s value and usage may vary among Relational Database Management System(RDBMS)s – Oracle, DB2, Informix, Open-Ingres, FoxPro, and so on.

 

Data-type

SQL 89 Standard

SQL 92 Standard

RDBMS

Value

Remark

…

…

…

…

…

…

UDT, User Defined Type MS SQL Server 2005
XML data     MS SQL Server 2005    
           

binary

 

binary

MS SQL 7.0

8000 byte maximum; fixed length

Binary data

varbinary

 

binary varying

MS SQL 7.0

8000 byte maximum, variable length

Binary data

bit

 

bit

MS SQL 7.0

Either 0(zero) or 1(one)

Also see: Computing Measurement

char

 

character

MS SQL 7.0

8000 characters maximum; fixed length

Unicode character set is not included; see: Character Set

varchar

 

character varying

MS SQL 7.0

8000 characters maximum; variable length

Unicode character set is not included; see: Character Set

cursor

 

cursor

MS SQL 7.0

Reference to cursor

 

datetime

 

datetime

MS SQL 7.0

From 1/1/1753 to 12/31/9999

3/100 second accuracy; Date data

decimal

 

decimal

MS SQL 7.0

From (-1.0E + 38)-1 to          

         (1.0E + 38)-1

Numeric exactly

float

 

double precision

MS SQL 7.0

From (-1.79E + 308) to     

         (1.79E + 308)

Numeric approximately

float

 

float

MS SQL 7.0

From (-1.79E + 308) to     

         (1.79E + 308)

For floating point calculation: float n where n = 1-53; Numeric approximately

real

 

float

MS SQL 7.0

From (-1.79E + 308) to     

         (1.79E + 308)

For floating point calculation: float n where n = 1-24; Numeric approximately

image

 

image

MS SQL 7.0

2,147,483,647 byte maximum; variable length

Binary data

int

 

integer

MS SQL 7.0

From  -2,147,483,648  to 2,147,483,647

Integer data

money

 

money

MS SQL 7.0

From -922,337,203,685,477.5808  to 922,337,203,685,477.5807

Money data

nvarchar

 

national char varying

MS SQL 7.0

4000 characters maximum; variable length

Unicode character set only

nchar

 

national character

MS SQL 7.0

4000 characters maximum;       fixed length

Unicode character set only

ntext

 

national text

MS SQL 7.0

1,073,741,823 characters maximum; variable length

Unicode character set only

decimal

 

numeric

MS SQL 7.0

From (-1.0E + 38)-1 to          

         (1.0E + 38)-1

Numeric exactly

smalldatetime

 

small datetime

MS SQL 7.0

From 1/1/1900 to 6/6/2079

1 minute accuracy; Date data

smallint

 

small integer

MS SQL 7.0

From -32,768 to 32,767

Integer data

smallmoney

 

small money

MS SQL 7.0

From -214,748.3648 to 214,748.3647

Money data

text

 

text

MS SQL 7.0

2,147,483,647 characters maximum; variable length

Unicode character set is not included; See: Character Set

timestamp

 

timestamp

MS SQL 7.0

Unique number of the database

Unique database data

tinyint

 

tiny integer

MS SQL 7.0

From 0 to 255

Integer data

uniqueidentifier

 

unique identifier

MS SQL 7.0

Unique identifier; GUID

Unique global data

…

…

…

…

…

…

 

Data Type: OS Windows

Data Type Reference Remark
...    
sint32 RFC1213 Signed bit included in instruction to processor; 32 bit quantity
string RFC1213  
uint32 RFC1213 Unsigned: signed bit not included in instruction to processor; 32 bit quantity
...    

 

 

Up