| Author |
Topic |
|
mvodnala
Starting Member
6 Posts |
Posted - 2008-05-12 : 04:07:02
|
| there are some problems with char(15) columns:(1) Purely fractional numbers sometimes have the first zero removed. So "0.03875" is stored as ".03875" (2) Some numbers have trailing zeros added. So "70.7" is stored as "70.700000". Can someone help how to overcome the formatting errors.Thanks, |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-05-12 : 04:34:41
|
| Are you trying to insert these values from some other column? If yes, what's the datatype of source field? |
 |
|
|
mvodnala
Starting Member
6 Posts |
Posted - 2008-05-12 : 04:37:27
|
| Am trying to fetch these values from a table(where it is stored as .355) not inserting.. |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-05-12 : 04:38:44
|
| Whats data type of column containing this? |
 |
|
|
mvodnala
Starting Member
6 Posts |
Posted - 2008-05-12 : 04:41:12
|
| Char datatype |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-05-12 : 04:43:25
|
quote: Originally posted by mvodnala Char datatype
and your destination column is also char? |
 |
|
|
mvodnala
Starting Member
6 Posts |
Posted - 2008-05-12 : 04:44:03
|
| yes |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-05-12 : 04:45:25
|
quote: Originally posted by mvodnala yes
Then i dont think you'll have a problem unless the lengths are different. |
 |
|
|
mvodnala
Starting Member
6 Posts |
Posted - 2008-05-12 : 05:00:56
|
| i need to put the value .355 has 0.355 at destination there am getting prob... |
 |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2008-05-12 : 05:16:49
|
SELECT CASE WHEN LEFT(Col1, 1) = '.' THEN '0' ELSE '' END + Col1FROM Table1 E 12°55'05.25"N 56°04'39.16" |
 |
|
|
harsh_athalye
Master Smack Fu Yak Hacker
5581 Posts |
Posted - 2008-05-12 : 05:18:51
|
| This is purely formatting issue. Why do you want to handle it at database level rather than in your application?Harsh AthalyeIndia."The IMPOSSIBLE is often UNTRIED" |
 |
|
|
mvodnala
Starting Member
6 Posts |
Posted - 2008-05-12 : 05:37:43
|
| at application level i cant check, it is some other system hence i want to feed correct values to the system by avoiding these kind of errors at database level itself... |
 |
|
|
|