免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 3003 | 回复: 1
打印 上一主题 下一主题

!关于decimal数据类型的问题??请指教! [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2003-05-09 09:48 |只看该作者 |正序浏览
在安装的DB2中,怎么没找到decmail.h头文件?
如何定义DECIMAI类型的宿主变量?

论坛徽章:
0
2 [报告]
发表于 2003-05-12 09:51 |只看该作者

!关于decimal数据类型的问题??请指教!

不用定义,他和c有对应的数据类型
SQL Column Type(TNTA1)  C/C++ Data Type  SQL Column Type Description  

SMALLINT
(500 or 501)


short
short int
sqlint16

16-bit signed integer  

INTEGER
(496 or 497)


long
long int
sqlint32(TNTA1A)

32-bit signed integer  

BIGINT
(492 or 493)


long long
long
__int64
sqlint64(TNTA1B)

64-bit signed integer  

REAL(TNTA2)
(480 or 481)

float  Single-precision floating point  

DOUBLE(TNTA3)
(480 or 481)

double  Double-precision floating point  

DECIMAL(p,s)
(484 or 485)

No exact equivalent; use double  Packed decimal
(Consider using the CHAR and DECIMAL functions to manipulate packed decimal fields as character data.)


CHAR(1)
(452 or 453)

char  Single character  

CHAR(n)
(452 or 453)

No exact equivalent; use char[n+1] where n is large enough to hold the data
1<=n<=254
Fixed-length character string  

VARCHAR(n)
(448 or 449)


struct tag {
short int;
char[n]
}
  
1<=n<=32 672

Non null-terminated varying character string with 2-byte string length indicator  
Alternately use char[n+1] where n is large enough to hold the data
1<=n<=32 672
null-terminated variable-length character string Note: Assigned an SQL type of 460/461.  


LONG VARCHAR
(456 or 457)


struct tag {
short int;
char[n]
}
  
32 673<=n<=32 700

Non null-terminated varying character string with 2-byte string length indicator  

CLOB(n)
(408 or 409)


sql type is
clob(n)
  
1<=n<=2 147 483 647

Non null-terminated varying character string with 4-byte string length indicator  

CLOB locator variable(TNTA4)
(964 or 965)


sql type is
clob_locator

Identifies CLOB entities residing on the server  

CLOB file reference variable(TNTA4)
(920 or 921)


sql type is
clob_file

Descriptor for file containing CLOB data  

BLOB(n)
(404 or 405)


sql type is
blob(n)
  
1<=n<=2 147 483 647

Non null-terminated varying binary string with 4-byte string length indicator  

BLOB locator variable(TNTA4)
(960 or 961)


sql type is
blob_locator

Identifies BLOB entities on the server  

BLOB file reference variable(TNTA4)
(916 or 917)


sql type is
blob_file

Descriptor for the file containing BLOB data  

DATE
(384 or 385)

null-terminated character form  Allow at least 11 characters to accommodate the null-terminator.  
VARCHAR structured form  Allow at least 10 characters.  

TIME
(388 or 389)

null-terminated character form  Allow at least 9 characters to accommodate the null-terminator.  
VARCHAR structured form  Allow at least 8 characters.  

TIMESTAMP
(392 or 393)

null-terminated character form  Allow at least 27 characters to accommodate the null-terminator.  
VARCHAR structured form  Allow at least 26 characters.  
Note: The following data types are only available in the DBCS or EUC environment when precompiled with the WCHARTYPE NOCONVERT option.  


GRAPHIC(1)
(468 or 469)

sqldbchar  Single double-byte character  

GRAPHIC(n)
(468 or 469)

No exact equivalent; use sqldbchar[n+1] where n is large enough to hold the data
1<=n<=127
Fixed-length double-byte character string  

VARGRAPHIC(n)
(464 or 465)


struct tag {
short int;
sqldbchar[n]
}
  
1<=n<=16 336

Non null-terminated varying double-byte character string with 2-byte string length indicator  
Alternately use sqldbchar[n+1] where n is large enough to hold the data
1<=n<=16 336
null-terminated variable-length double-byte character string Note: Assigned an SQL type of 400/401.  


LONG VARGRAPHIC
(472 or 473)


struct tag {
short int;
sqldbchar[n]
}
  
16 337<=n<=16 350

Non null-terminated varying double-byte character string with 2-byte string length indicator  
Note: The following data types are only available in the DBCS or EUC environment when precompiled with the WCHARTYPE CONVERT option.  


GRAPHIC(1)
(468 or 469)

wchar_t  Single wide character (for C-type)
Single double-byte character (for column type)



GRAPHIC(n)
(468 or 469)

No exact equivalent; use wchar_t [n+1] where n is large enough to hold the data
1<=n<=127
Fixed-length double-byte character string  

VARGRAPHIC(n)
(464 or 465)


struct tag {
short int;
wchar_t [n]
}

1<=n<=16 336

Non null-terminated varying double-byte character string with 2-byte string length indicator  
Alternately use char[n+1] where n is large enough to hold the data
1<=n<=16 336
null-terminated variable-length double-byte character string Note: Assigned an SQL type of 400/401.  


LONG VARGRAPHIC
(472 or 473)


struct tag {
short int;
wchar_t [n]
}
  
16 337<=n<=16 350

Non null-terminated varying double-byte character string with 2-byte string length indicator  
Note: The following data types are only available in the DBCS or EUC environment.  


DBCLOB(n)
(412 or 413)


sql type is
dbclob(n)
  
1<=n<=1 073 741 823

Non null-terminated varying double-byte character string with 4-byte string length indicator  

DBCLOB locator variable(TNTA4)
(968 or 969)


sql type is
dbclob_locator

Identifies DBCLOB entities residing on the server  

DBCLOB file reference
variable(TNTA4)
(924 or 925)


sql type is
dbclob_file

Descriptor for file containing DBCLOB data


我没有排版,你自己排吧,,

你可以在信息中心里面搜索到,,
关键字:
Supported SQL Data Types in C and C++
  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP