这些小活动你都参加了吗?快来围观一下吧!>>
电子产品世界 » 论坛首页 » 嵌入式开发 » MCU » 嵌入式数据库Empress数据类型

共1条 1/1 1 跳转至

嵌入式数据库Empress数据类型

菜鸟
2008-06-20 09:19:16     打赏

一 .Empress数据类型:

类型

说明

Character

CHAR or CHARACTER (length, type)
TEXT (print length, primary storage, overflow storage, # of direct pointers to extents)

NLSCHAR or NLSCHARACTER (length, type)
NLSTEXT (print length, primary storage, overflow storage, # of direct pointers to extents)

Date

DATE (format)
TIME (format)
MICROTIMESTAMP (format)

Decimal

DECIMAL or DEC (maximum digits, number of decimal places)
DOLLAR (maximum dollar digits, format)

Float

REAL
FLOAT (number of decimal places)
LONGFLOAT or DOUBLE PRECISION

Integer

INTEGER or INT
LONGINTEGER
SHORTINTEGER or SMALLINT

User Interpreted
(Byte Stream)

MULTIMEDIA or BULK (# of bytes printed, primary storage, overflow storage, # of direct pointers to extents)

 

 

类型

范围

 

 

CHAR

1 to maximum value of C int, typically 231-1 bytes

NLSCHAR

1 to maximum value of C int, typically 231-1 bytes

TEXT

1 to maximum value of C int, typically 231-1 bytes

NLSTEXT

1 to maximum value of C int, typically 231-1 bytes

DATE

Using the format yyyymmdd, it is 00000101 to 99991231(January 1, 0000 to December 31, 9999)

TIME

January 1, 1970 00:00:00 to December 31, 2035 23:59:59

MICROTIMESTAMP

January 1, 0000 00:00:00.000000 to December 31, 9999 23:59:59.999999

DECIMAL

1 to 38 digits

DOLLAR

1 to 13 digits

REAL

System dependent - 4-byte single precision float.

FLOAT

System dependent - If the number of decimal places is between 1 and 6, it is 4-byte single precision float; if it is between 7 and 12, it is 8-byte double precision float.

LONGFLOAT

System dependent - 8-byte double precision float.

INTEGER

-32767 to 32767 (215-1)

LONGINTEGER

-2147483647 to 2147483647 (231-1)

SHORTINTEGER

-127 to 127 (27-1)

BULK

1 to maximum value of C int, typically 231-1 bytes

 

1.1  CHAR/CHARACTER

 

CHAR [ (length [, type]) ]

length:需要存储的字符最大字节数;默认是25;

type:存储类型,可以是1、2、3。默认是1;

 

type=1:只能存储可打印字符并去掉头部和尾部的空格;

type=2:只能存储可打印字符但不去掉头部和尾部的空格;

type=3:能够存储所有的ASCII字符(NULL除外)。

 

“    John P. Doe   “与“John P. Doe”
当type=1时:这两个字符一样;
当type=2或3时:这两个字符不同。
 
1.2 TEXT
   
   TEXT [ (display [, primary [, overflow [, extents ]]])];
    display:但用SQL语句查询时每行显示的字符数;默认是20;
primary:主表存储的字符数;最小为0;默认是20;
overflow:每个溢出存储器存储的字符数,最小为16,默认是20;
extents:指向溢出存储器的指针数;默认是1;
 

1.3 NLSCHAR \ NLSCHARACTER (length, type)

NLSTEXT (print length, primary storage, overflow storage, # of direct pointers to extents)

与前面所讲的CHAR和TEXT完全一样,只不过在存储时将字符转换成ISO Latin1字符集储存。

 

2.1 DATE

 

   DATE [ (type) ]

   type:日期储存格式,默认是0;

 

Type

Format

Year Range

Example

0

yyyymmdd

0000-9999

19980627

1

dd aaaaaaaaa yyyy

0000-9999

27 June 1998

2

aaaaaaaaa dd, yyyy

0000-9999

June 27, 1998

3

mm/dd/yy

nn00-nn99 *

06/27/98

4

dd/mm/yy

nn00-nn99 *

27/06/98

5

dd aaa yy

nn00-nn99 *

27 Jun 98

6

aaa dd, yy

nn00-nn99 *

Jun 27, 98

7

mm/dd/yyyy

0000-9999

06/27/1998

8

dd/mm/yyyy

0000-9999

27/06/1998

 

2.2 TIME

 

TIME [(type)]

Type:时间存储格式,默认是0;

 

Type

Format

Year Range

Example

0

yyyymmddhhmmss

1970-2035

19980828145615

1

dd aaaaaaaaa yyyy hh:mm:ss

1970-2035

28 August 1998 14:56:15

2

aaaaaaaaa dd, yyyy hh:mm:ss

1970-2035

August 28, 1998 14:56:15

3

mm/dd/yy hh:mm:ss

1970-2035

08/28/98 14:56:15

4

dd/mm/yy hh:mm:ss

1970-2035

28/08/98 14:56:15

5

dd aaa yy hh:mm:ss

1970-2035

28 Aug 98 14:56:15

6

aaa dd, yy hh:mm:ss

1970-2035

Aug 28, 98 14:56:15

7

mm/dd/yyyy hh:mm:ss

1970-2035

08/28/1998 14:56:15

8

dd/mm/yyyy hh:mm:ss

1970-2035

28/08/1998 14:56:15

 

2.3 MICROTIMESTAMP

 

MICROTIMESTAMP [(type)]

type:存储格式,默认是0;

 

Type

Format

Year Range

Example

 

 

 

 

0

yyyymmddhhmmssffffff

0000-9999

19980828145615234599

1

dd aaaaaaaaa yyyy hh:mm:ss.ffffff

0000-9999

28 August 1998 14:56:15.234599

2

aaaaaaaaa dd, yyyy hh:mm:ss.ffffff

0000-9999

August 28, 1998 14:56:15.234599

3

mm/dd/yy hh:mm:ss.ffffff

nn00-nn99 *

08/28/98 14:56:15.234599

4

dd/mm/yy hh:mm:ss.ffffff

nn00-nn99 *

28/08/98 14:56:15

5

dd aaa yy hh:mm:ss.ffffff

nn00-nn99 *

28 Aug 98 14:56:15.234599

6

aaa dd, yy hh:mm:ss.ffffff

nn00-nn99 *

Aug 28, 98 14:56:15.234599

7

mm/dd/yyyy hh:mm:ss.ffffff

0000-9999

08/28/1998 14:56:15.234599

8

dd/mm/yyyy hh:mm:ss.ffffff

0000-9999

28/08/1998 14:56:15.234599

 

3.1 DECIMAL\DEC

  

   DECIMAL [(total_digits [, decimal_places])]

  

   total_digits:指定存储十进制数据时,所能存储的位数,包括符号和小数点;默认是1;

   decimal_places:小数点后面的位数;默认是0;

  例如:

输入      (5,2)      (4,2)      (6,4)      (6,0)      (2,0)
   
   -10        -10.00     -10.00     -10.0000   -10        -10
   .4         0.40       0.40       0.4000     0          0
   1.234567   1.23       1.23       1.2346     1          1
   1.5        1.50       1.50       1.5000     2          2
   10         10.00      10.00      10.0000    10         10
   12.34      12.34      12.34      12.3400    12         12
   21.9       21.90      21.90      21.9000    22         22
   123.4      123.40     ***        ***        123        ***

 

3.2 DOLLAR

 

   DOLLAR [ (max_digits [ , type])]

 

4            REAL

FLOAT

LONGFLOAT or DOUBLE PRECISION

 

5    INTEGER or INT

SHORTINTEGER or SMALLINT

LONGINTEGER

5         User Interpreted Data

 

BULK
|MULTIMEDIA

| [(display [, primary [, overflow [, extents]]])];

 

Display:在用SQL查询时每行显示的字节数,数据以十六进制显示;

Primary:储存在主表中的字节数;

Overflow:每个溢出存储器存储的字符数;
extents:指向溢出存储器的指针数; 
 

 

 

 

 

 

 




关键词: 嵌入式     数据库     Empress     数据     类型     存储         

共1条 1/1 1 跳转至

回复

匿名不能发帖!请先 [ 登陆 注册 ]