Wrox Programmer Forums
Go Back   Wrox Programmer Forums > PHP/MySQL > MySQL
|
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 software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old December 16th, 2006, 07:30 PM
Authorized User
 
Join Date: Aug 2003
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.






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





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