|
database
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Decimal Digits Lost When Using Decimal(9,2) ParameterHello,
I am trying to use a decimal type parameter in my stored procedure. When I pass any decimal value to it (for example: 12.34), the decimal part is always truncated off. I am left with only 12 as the value that get put into my table. I have checked the obvious...the datatype is decimal in the procedure. The data type for the column is decimal(9,2) in my table. Any idea about what is going on here? Can you show some code so we can repro/diagnose?
<joey.pow***@topscene.com> wrote in message Show quote news:1125598102.549921.46630@g47g2000cwa.googlegroups.com... > Hello, > > I am trying to use a decimal type parameter in my stored procedure. > When I pass any decimal value to it (for example: 12.34), the decimal > part is always truncated off. I am left with only 12 as the value that > get put into my table. I have checked the obvious...the datatype is > decimal in the procedure. The data type for the column is decimal(9,2) > in my table. Any idea about what is going on here? > joey.pow***@topscene.com wrote:
> Hello, You are proably using the value in a calculation that includes an > > I am trying to use a decimal type parameter in my stored procedure. > When I pass any decimal value to it (for example: 12.34), the decimal > part is always truncated off. I am left with only 12 as the value that > get put into my table. I have checked the obvious...the datatype is > decimal in the procedure. The data type for the column is decimal(9,2) > in my table. Any idea about what is going on here? integer data type. Make sure all operations use decimal as the data type. Joey,
The datatype DECIMAL is shorthand for DECIMAL(18,0). Change the data type of the procedure parameter to DECIMAL(9,2). Steve Kass Drew University joey.pow***@topscene.com wrote: Show quote >Hello, > >I am trying to use a decimal type parameter in my stored procedure. >When I pass any decimal value to it (for example: 12.34), the decimal >part is always truncated off. I am left with only 12 as the value that >get put into my table. I have checked the obvious...the datatype is >decimal in the procedure. The data type for the column is decimal(9,2) >in my table. Any idea about what is going on here? > > > |
|||||||||||||||||||||||