Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > PHP/MySQL > MySQL
Password Reminder
Register
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
MySQL General discussion about the MySQL database.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the MySQL section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old December 16th, 2006, 07:30 PM
Authorized User
Points: 139, Level: 2
Points: 139, Level: 2 Points: 139, Level: 2 Points: 139, Level: 2
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2003
Location: Spokane, WA, USA.
Posts: 25
Thanks: 0
Thanked 0 Times in 0 Posts
Default Error 'SQL_C_NUMERIC' with param Insert query

With the code below I get "ERROR[07006]...Restricted data type attribute violation (SQL_C_NUMERIC)" when the query is executed. There is no mention of this SQLSTATE error in the MySQL documentation
of Appendix C.1 (server) or C.2 (client).

Dim strSQLSchedule As String = "INSERT INTO schedule " & _
       "(crsno,sesno,schdate,cost) VALUES (?,?,?,?);"
Dim cmdSchedule As New OdbcCommand(strSQLSchedule, cnAqua)
With cmdSchedule.Parameters
         .Add("?", OdbcType.SmallInt).Value = Convert.ToInt16(crsnum.Value)
         .Add("?", OdbcType.SmallInt).Value = Convert.ToInt16(sesnum.Value)
         .Add("?", OdbcType.DateTime).Value = Convert.ToDateTime(schedte.Value)
         .Add("?", OdbcType.Decimal).Value = Convert.ToDecimal(costof.Value)
 End With
cmdSchedule.ExecuteNonQuery()

Previously conversion/assignment for the integers and date was successful but when decimal processing was added the error occurred. Thanks for the help.

Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Insert Query Error & Run-Time Error 3022 DavidWE Access 1 July 31st, 2008 11:17 AM
Error in SQL INSERT query lawsoncobol Access VBA 1 August 4th, 2006 04:25 AM
HELP! Insert Query Error zrm22 Classic ASP Databases 1 January 30th, 2006 06:34 PM
insert data param into xml from external file alexshiell XSLT 0 January 24th, 2006 01:47 PM
Insert into error with union query in Access 2002 roniestein Access 8 December 21st, 2004 07:47 PM



All times are GMT -4. The time now is 09:53 PM.


Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.