|
|
Choosing A Webhost: |
RE: datatype conversion: msg#00196db.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 > Which sql server (Microsoft or Sybase?) type are server columns ? > First, I converted the money datatype to decimal. Again I converted > > from decimal into character. > > The pSrc is the > > char *pSrc; > Where does pSrc come? > 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) > This query do not convert number to money so it's not the same thing. > 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. > bye freddy77
|
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | datatype conversion, P. Sankar |
|---|---|
| Next by Date: | Re: Compiling and using FreeTDS on Mac OS X, Duncan Wilcox |
| Previous by Thread: | datatype conversion, P. Sankar |
| Next by Thread: | RE: datatype conversion, Lowden, James K |
| 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 |