• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 735
  • Last Modified:

How to Create a Decimal-Type Command Parameter in ASP

Hi friends,

Can someone show me the right way to create decimal-type command parameterin ASP?  My code below give me a "precision is invalid" error.


Dim cmdClaimInsertUpdate
Set cmdClaimInsertUpdate = Server.CreateObject("ADODB.Command")
With cmdClaimInsertUpdate
      .ActiveConnection = cn
      .CommandText = "sp_ClaimInsertUpdate"
      .CommandType = adCmdStoredProc
      
      .Parameters.Append = .CreateParameter("@Claim_RepairLaborRate", adDecimal, adParamInput,  , Request.Form("txtClaimRepairLaborRate"))
      
      .Execute
End With
Set cmdClaimInsertUpdate = Nothing



In the sp_ClaimInsertUpdate stored procedure, I have the following declaration...

@Claim_RepairLaborRate      DECIMAL(18,2)      = NULL,

The field name Claim_RepairLaborRate is a decimal type with 18 precision and 2 scale.

Any help on this matter would be so greatly appreciated.

Thanks a bundle,


Jazon from Jacksonville, FL
0
piratepatrol
Asked:
piratepatrol
  • 3
  • 2
1 Solution
 
davidlars99Commented:
0
 
davidlars99Commented:
0
 
piratepatrolAuthor Commented:
Actually, the following line solved my problem.

.Parameters("@Claim_RepairLaborRate").Precision = 18

Thank you for your response.
0
 
davidlars99Commented:
yes, but Decimal is 14 not 18
0
 
piratepatrolAuthor Commented:
What database are you using?  Mine is 18 by default.
0

Featured Post

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now