|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Urgent! Problem with adDecimal type in stored procedure
Hi, I have a problem with input parameter which has Decimal DataType again. Stored procedure works but it rounds all
values, i.e 5.555 input becomes 6 and 1.3 input becomes 1. In table QTY has data type decimal(5) - precision(8) scale(3). Please, suggest what's wrong with this: newqty = Request.Form("quantity") .......... cmd.Parameters.Append(cmd.CreateParameter("qty", adDecimal, adParamInput, 5, newqty)) cmd.Parameters("qty").Precision = 8 cmd.Parameters("qty").NumericScale = 3 Please, help! Thanks in advance. |
|
#2
|
||||
|
||||
|
It doesn't appear that it would be rounded in the code you have posted. What does your stored procedure look like?
|
|
#3
|
|||
|
|||
|
Quote:
It's simple: CREATE PROCEDURE ms_updatitems @mkey int, @jobno varchar(20), @pono int, @qty decimal(5), @recdat datetime, @comment varchar(400), @docmtr bit AS INSERT MATSTAT (mkey, jobno, pono, recivqty, recivdate, comment, docmtr) VALUES(@mkey, @jobno, @pono, @qty, @recdat, @comment, @docmtr) GO |
|
#4
|
||||
|
||||
|
Yep, you need to declare your decimal like @qty Decimal(8,3)
|
|
#5
|
|||
|
|||
|
Thank you, it works.
|
![]() |
| Viewing: ASP Free Forums > Database > Microsoft SQL Server > Urgent! Problem with adDecimal type in stored procedure |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|