MySql IN Parameter – Does a VarChar IN Parameter val need to be single quoted when used in Stored Procedure?
I have created my classic ASP code just like normal but I am not getting the column to update.
Do I need to quote a VarChar parameter?
DELIMITER $$
DROP PROCEDURE IF EXISTS `usp_update_map_record` $$
CREATE DEFINER=`ddddddd`@`%` PROCEDURE `usp_update_map_record`(
IN p_intGrillId INT(10),
IN p_intPartId INT(10),
IN p_ManRef VARCHAR(10)
)
BEGIN
UPDATE parts_map SET manualref = 'p_ManRef' WHERE grillid = p_intGrillId AND partid = p_intPartId;
END $$
DELIMITER ;
VBSCRIPT PORTION:
With comm
.ActiveConnection = conn
.CommandType = adCmdStoredProc
.CommandText = "usp_update_map_record"
.Parameters.Append .CreateParameter("p_intGrillId", adInteger, adParamInput, 10, intGrillId)
.Parameters.Append .CreateParameter("p_intPartId", adInteger, adParamInput, 10, CIntPartId)
.Parameters.Append .CreateParameter("p_ManRef", adVarChar, adParamInput, 10, strManualRef)
.Execute
End With
Also I tested all 3 values and they are not empty.
Thanks.
This is incorrect:
The quotes turn that “field” into a string. – you’re not comparing two fields, you’re comparing the manualref field against a string whose value happens to be the NAME of a parameter for your sproc.
Try: