Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

Troubleshooting
Research
Professional Opinions
Ask a Question
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE

troubleshooting Question

MySql Stored Procedure problem

Avatar of tantormedia
tantormediaFlag for United States of America asked on
MySQL Server.NET Programming
49 Comments1 Solution1104 ViewsLast Modified:
I am trying to update records using MySQL stored procedure run through ODBC and ADO.Net. On execution, I get the following error:
Restricted data type attribute violation(SQL_C_NUMERIC)

I have attached my stored procedure code. Can anybody please tell what is wrong?
Thanks.


DELIMITER $$

DROP PROCEDURE IF EXISTS `InsertBookQuest` $$
CREATE PROCEDURE `InsertBookQuest`(
IN pEAN VARCHAR(13),
IN pTitle VARCHAR(255),
IN pRespParty VARCHAR(255),
IN pPublisher VARCHAR(255),
IN pPubDate DATE,
IN pSubject VARCHAR(255),
IN pBinding VARCHAR(45),
IN pPageCount INT,
IN pUSListPrice DECIMAL(19,2),
IN pDemand INT,
IN pOnOrder INT,
IN pOnBackorder INT,
IN pSpeedStock BOOLEAN,
IN pStatus VARCHAR(45),
IN pBTKey INT,
IN pBTFirstPrinting INT,
OUT pIsInsert BOOLEAN
)
BEGIN
DECLARE vCount INT;

SELECT COUNT(1) FROM BookQuest WHERE EAN = pEAN INTO vCount;

IF vCount = 0 THEN
  INSERT INTO BookQuest (EAN, Title, RespParty, Publisher, PubDate, `Subject`, Binding, PageCount, USListPrice, Demand, OnOrder, OnBackorder, SpeedStock, `Status`, BTKey, BTFirstPrinting)
  VALUES (pEAN, pTitle, pRespParty, pPublisher, pPubDate, pSubject, pBinding, pPageCount, pUSListPrice, pDemand, pOnOrder, pOnBackorder, pSpeedStock, pStatus, pBTKey, pBTFirstPrinting);
  SET pIsInsert = 1;
ELSE
  UPDATE BookQuest SET Title = pTitle, RespParty = pRespParty, Publisher = pPublisher, PubDate = pPubDate, `Subject` = pSubject, Binding = pBinding, PageCount = pPageCount, Demand = pDemand, OnOrder = pOnOrder, OnBackorder = pOnBackorder, SpeedStock = pSpeedStock, `Status` = pStatus, BTKey = pBTKey, BTFirstPrinting = pBTFirstPrinting
  WHERE EAN = pEAN;
  SET pIsInsert = 0;
END IF;

END $$

DELIMITER ;
ASKER CERTIFIED SOLUTION
Avatar of ViaTom
ViaTomFlag of United States of America image

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Commented:
This problem has been solved!
Unlock 1 Answer and 49 Comments.
See Answers