Microsoft SQL Server
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsDatabaseMicrosoft SQL Server

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old April 7th, 2005, 07:29 PM
Natasha Natasha is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Oct 2004
Posts: 27 Natasha User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 9 h 31 m 2 sec
Reputation Power: 0
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.

Reply With Quote
  #2  
Old April 9th, 2005, 01:56 AM
gregory.owen@hp's Avatar
gregory.owen@hp gregory.owen@hp is offline
Maniac
ASP Free Novice (500 - 999 posts)
 
Join Date: Sep 2003
Location: Sweet Home, Oregon
Posts: 548 gregory.owen@hp User rank is Sergeant (500 - 2000 Reputation Level)gregory.owen@hp User rank is Sergeant (500 - 2000 Reputation Level)gregory.owen@hp User rank is Sergeant (500 - 2000 Reputation Level)gregory.owen@hp User rank is Sergeant (500 - 2000 Reputation Level)gregory.owen@hp User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 3 Days 4 h 37 m 8 sec
Reputation Power: 14
It doesn't appear that it would be rounded in the code you have posted. What does your stored procedure look like?

Reply With Quote
  #3  
Old April 11th, 2005, 11:02 AM
Natasha Natasha is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Oct 2004
Posts: 27 Natasha User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 9 h 31 m 2 sec
Reputation Power: 0
Quote:
Originally Posted by gregory.owen@hp
It doesn't appear that it would be rounded in the code you have posted. What does your stored procedure look like?


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

Reply With Quote
  #4  
Old April 13th, 2005, 11:18 AM
gregory.owen@hp's Avatar
gregory.owen@hp gregory.owen@hp is offline
Maniac
ASP Free Novice (500 - 999 posts)
 
Join Date: Sep 2003
Location: Sweet Home, Oregon
Posts: 548 gregory.owen@hp User rank is Sergeant (500 - 2000 Reputation Level)gregory.owen@hp User rank is Sergeant (500 - 2000 Reputation Level)gregory.owen@hp User rank is Sergeant (500 - 2000 Reputation Level)gregory.owen@hp User rank is Sergeant (500 - 2000 Reputation Level)gregory.owen@hp User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 3 Days 4 h 37 m 8 sec
Reputation Power: 14
Yep, you need to declare your decimal like @qty Decimal(8,3)

Reply With Quote
  #5  
Old April 19th, 2005, 11:10 AM
Natasha Natasha is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Oct 2004
Posts: 27 Natasha User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 9 h 31 m 2 sec
Reputation Power: 0
Thank you, it works.

Reply With Quote
Reply

Viewing: ASP Free ForumsDatabaseMicrosoft SQL Server > Urgent! Problem with adDecimal type in stored procedure


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway
Stay green...Green IT