HighDots Forums  

datatype, command and stored procedures

Macromedia Dreamweaver Macromedia Dreamweaver Discussions (macromedia.dreamweaver)


Discuss datatype, command and stored procedures in the Macromedia Dreamweaver forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
shank
 
Posts: n/a

Default datatype, command and stored procedures - 09-01-2004 , 10:51 AM






I'm trying to use an UPDATE stored procedure call by Command and I'm getting:
Microsoft OLE DB Provider for SQL Server error '80004005' The precision is
invalid.

This must be related to the number field(s), but I don't see where I can
change the precision.

Also, where can I find a cross reference to show what these numbers represent?
200,1,255

thanks

rsPubUpdate.Parameters.Append rsPubUpdate.CreateParameter("@Title",
200,1,255,rsPubUpdate__Title)
rsPubUpdate.Parameters.Append rsPubUpdate.CreateParameter("@Artist",
200,1,255,rsPubUpdate__Artist)
rsPubUpdate.Parameters.Append rsPubUpdate.CreateParameter("@Genre",
200,1,50,rsPubUpdate__Genre)
rsPubUpdate.Parameters.Append rsPubUpdate.CreateParameter("@GroupLevel",200,
1,50,rsPubUpdate__GroupLevel)
rsPubUpdate.Parameters.Append rsPubUpdate.CreateParameter("@Writers",
200,1,255,rsPubUpdate__Writers)
rsPubUpdate.Parameters.Append rsPubUpdate.CreateParameter("@Publisher",
200,1,50,rsPubUpdate__Publisher)
rsPubUpdate.Parameters.Append rsPubUpdate.CreateParameter("@Royalty",
6,1,8,rsPubUpdate__Royalty)
rsPubUpdate.Parameters.Append rsPubUpdate.CreateParameter("@Ownership",
131,1,9,rsPubUpdate__Ownership)
rsPubUpdate.Parameters.Append rsPubUpdate.CreateParameter("@Comments",
200,1,8000,rsPubUpdate__Comments)
rsPubUpdate.Parameters.Append rsPubUpdate.CreateParameter("@ID",
131,1,9,rsPubUpdate__ID)


CREATE TABLE [bls2000].[Publishers] (
[Title] [varchar] (255) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
[Artist] [varchar] (255) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
[Genre] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[GroupLevel] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[Writers] [varchar] (255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[Publisher] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[Royalty] [money] NULL ,
[Ownership] [numeric](18, 1) NULL ,
[Comments] [varchar] (8000) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[ID] [numeric](10, 0) IDENTITY (1, 1) NOT NULL
) ON [PRIMARY]
GO




Reply With Quote
  #2  
Old   
cmbergin
 
Posts: n/a

Default Re: datatype, command and stored procedures - 09-01-2004 , 02:37 PM






The first number is the data type of the parameter. Here's a reference for the
data type enum:
http://www.w3schools.com/ado/prop_type.asp#datatypeenum

The second number is the direction. 1 = in, 2=out, 3=in/out, 4=return value

The third number is the size of the parameter in bytes.

Try setting the precision on your two NUMERIC parameters (type 131)
rsPubUpdate.Parameters("@Ownership").Precision = 18
for example.




Reply With Quote
  #3  
Old   
shank
 
Posts: n/a

Default Re: datatype, command and stored procedures - 09-01-2004 , 03:37 PM



I tried the following and now get a Type Mismatch error. Royalty is a MONEY
field and Ownership is FLOAT field. Does that make a difference?
thanks

rsUpdate.Parameters.Append rsUpdate.CreateParameter("@Royalty", 6,
1,8,varRoyalty).Precision = 18
rsUpdate.Parameters.Append rsUpdate.CreateParameter("@Ownership", 131,
1,9,varOwnership).Precision = 18


Reply With Quote
  #4  
Old   
cmbergin
 
Posts: n/a

Default Re: datatype, command and stored procedures - 09-01-2004 , 06:46 PM



Don't set the precision on your Royalty field. Type 6 is MONEY when length=8
and SMALLMONEY when length=4. The precision on MONEY is 19 (and you don't have
to set it, type 6 will be sufficient), so setting it to 18 will cause a type
mismatch error.


Reply With Quote
Reply




Thread Tools
Display Modes

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



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.