|
|
Choosing A Webhost: |
datatype conversion: msg#00195db.tds.freetds
Hi, I am introducing myself as software engineer and working on data warehousing tool. I have few doubts in datatype conversion using the DB library API function dbconvert(). I have tried the following numbers to insert into SQL Server database after conversion. 123456789123456.8800 123456789123456.9900 123456789123456.9800 First, I converted the money datatype to decimal. Again I converted from decimal into character. The pSrc is the char *pSrc; dbconvert(dbproc, SYBMONEY, pSrc, sizeof(DBMONEY), SYBDECIMAL, (unsigned char *)&decTemp, sizeof(DBDECIMAL)); dbconvert(dbproc, SYBDECIMAL, (unsigned char *const)&decTemp, sizeof(DBDECIMAL), SYBCHAR, tmpstr, -1); After conversion, the above values loses its scale value by 1. Before the first conversion, I have set the precision and scale value length to 38 and 5. For example, after conversion I am getting the result as follows. 123456789123456.8700 123456789123456.9800 123456789123456.9700 But, I have tried the same conversion using the following query in SQL Server Query Analyzer. SELECT CONVERT(decimal(38,4) , 123456789123456.8800) I am getting the correct answer for the above query. Also, I have converted the converted value to character. SELECT CONVERT(CHAR(50),CONVERT(decimal(38,4) , 123456789123456.8800)) In this case, there is no loss in scale value. Could you please suggest the solution for this problem. Rgds, Sankar.P.
|
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | RE: UTF-8 progress, ZIGLIO Frediano |
|---|---|
| Next by Date: | RE: datatype conversion, ZIGLIO Frediano |
| Previous by Thread: | Failing to connect from Redhat Linux to MS SQL Server, FTL Africa |
| Next by Thread: | RE: datatype conversion, ZIGLIO Frediano |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
Free MagazinesCisco NewsReceive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business. subscribe Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field. subscribe The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business. subscribe Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company. subscribe Total Telecom Total Telecom is "The Economist of the communications industry". subscribe |